return NULL;
/* TODO: Reads */
- transfer->map = malloc(ALIGN(box->width, 16) * ALIGN(box->height, 16) * bytes_per_pixel);
+ /* TODO: Only allocate "just" enough, shortening the stride */
+ transfer->map = malloc(transfer->base.stride * box->height);
return transfer->map;
} else {
trans->base.box.height,
util_format_get_blocksize(rsrc->base.format),
bo->slices[level].stride,
+ u_minify(rsrc->base.width0, level),
trans->map,
bo->cpu
+ bo->slices[level].offset
void
panfrost_texture_swizzle(unsigned off_x,
unsigned off_y,
- int width, int height, int bytes_per_pixel, int source_stride,
+ int width, int height, int bytes_per_pixel, int source_stride, int dest_width,
const uint8_t *pixels,
uint8_t *ldest)
{
/* Calculate maximum size, overestimating a bit */
- int block_pitch = ALIGN(width, 16) >> 4;
+ int block_pitch = ALIGN(dest_width, 16) >> 4;
/* Use fast path if available */
if (!(off_x || off_y)) {
void
panfrost_texture_swizzle(unsigned off_x, unsigned off_y,
- int width, int height, int bytes_per_pixel, int source_stride,
+ int width, int height, int bytes_per_pixel, int source_stride, int dest_width,
const uint8_t *pixels,
uint8_t *ldest);