ac/surface: Don't force linear for VIDEO_REFERENCE with emulated image opcodes

This caused regression by using higher pitch than needed on compute-only
devices, resulting in video decode errors.

Fixes: 308bae950f ("ac/surface: Add RADEON_SURF_VIDEO_REFERENCE")
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32863>
This commit is contained in:
David Rosca 2025-01-03 11:02:43 +01:00 committed by Marge Bot
parent fb59a9fb08
commit e33452a6d3

View file

@ -3348,7 +3348,7 @@ int ac_compute_surface(struct ac_addrlib *addrlib, const struct radeon_info *inf
return r;
/* Images are emulated on some CDNA chips. */
if (!info->has_image_opcodes)
if (!info->has_image_opcodes && !(surf->flags & RADEON_SURF_VIDEO_REFERENCE))
mode = RADEON_SURF_MODE_LINEAR_ALIGNED;
/* 0 offsets mean disabled. */