From e33452a6d36338f7fc5b3931844afc84c91192a5 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Fri, 3 Jan 2025 11:02:43 +0100 Subject: [PATCH] ac/surface: Don't force linear for VIDEO_REFERENCE with emulated image opcodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This caused regression by using higher pitch than needed on compute-only devices, resulting in video decode errors. Fixes: 308bae950fe ("ac/surface: Add RADEON_SURF_VIDEO_REFERENCE") Tested-by: Sathishkumar S Reviewed-by: Leo Liu Reviewed-by: Marek Olšák Part-of: --- src/amd/common/ac_surface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c index a9b1bae7876..efe96a58265 100644 --- a/src/amd/common/ac_surface.c +++ b/src/amd/common/ac_surface.c @@ -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. */