radeonsi: fix surf_pitch for subsampled surface
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tue, 4 Feb 2020 17:56:59 +0000 (18:56 +0100)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 27 Feb 2020 09:01:31 +0000 (10:01 +0100)
commit69aadc493310bb7306d10559bf48412eb5865962
tree41e16c409ff5f93f38e652d48f50e6c5a3035190
parentc4197fbcdde55e93693e5687842605ff70ed3d15
radeonsi: fix surf_pitch for subsampled surface

gfx9.surf_pitch is supposed to be in blocks (or elements) but addrlib
returns a pitch in pixels.
This cause a mismatch between surface->bpe and surface.u.gfx9.surf_pitch.

For subsampled formats like uyvy (bpe is 2) this breaks in various places:
 - sdma copy
 - video rendering (see issue https://gitlab.freedesktop.org/mesa/mesa/issues/2363)
   when the vl_compositor_gfx_render method is used

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3738>
src/amd/common/ac_surface.c
src/gallium/drivers/radeonsi/si_compute_blit.c