imlib/draw: Fixed transpose on SDRAM-less boards.

This commit is contained in:
Kwabena W. Agyeman 2024-11-24 15:11:49 -08:00
parent 37ec53ca8e
commit b32899f103

View File

@ -3144,8 +3144,14 @@ void imlib_draw_image(image_t *dst_img,
t_src_img.data = src_img->data; t_src_img.data = src_img->data;
} }
// Query available on-chip RAM.
uint32_t size; uint32_t size;
void *data = fb_alloc_all(&size, FB_ALLOC_PREFER_SPEED | FB_ALLOC_CACHE_ALIGN); void *data = fb_alloc_all(&size, FB_ALLOC_PREFER_SPEED | FB_ALLOC_CACHE_ALIGN);
fb_free();
// Allocate a buffer to hold chunks of the transposed image while not using all of the on-chip RAM.
size = IM_MIN(size, image_size(&t_src_img));
data = fb_alloc(size, FB_ALLOC_PREFER_SPEED | FB_ALLOC_CACHE_ALIGN);
// line_num stores how many lines we can do at a time with on-chip RAM. // line_num stores how many lines we can do at a time with on-chip RAM.
image_t temp = {.w = t_roi.w, .h = t_roi.h, .pixfmt = t_src_img.pixfmt}; image_t temp = {.w = t_roi.w, .h = t_roi.h, .pixfmt = t_src_img.pixfmt};