From eb71394ff38d05a42cb8d04fedb6539cc7bbe6fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Wed, 20 Sep 2017 16:45:48 +0200 Subject: [PATCH] ac/surface: handle error when choosing preferred swizzle mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit CID: 1418140 Fixes: c4ac522511d2 ("ac/surface: handle S8 on gfx9") Reviewed-by: Marek Olšák Reviewed-by: Dave Airlie --- src/amd/common/ac_surface.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c index 850d70715e5..22c653f0c4f 100644 --- a/src/amd/common/ac_surface.c +++ b/src/amd/common/ac_surface.c @@ -1141,10 +1141,12 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib, AddrSurfInfoIn.flags.stencil = 1; AddrSurfInfoIn.bpp = 8; - if (!AddrSurfInfoIn.flags.depth) + if (!AddrSurfInfoIn.flags.depth) { r = gfx9_get_preferred_swizzle_mode(addrlib, &AddrSurfInfoIn, false, &AddrSurfInfoIn.swizzleMode); - else + if (r) + return r; + } else AddrSurfInfoIn.flags.depth = 0; r = gfx9_compute_miptree(addrlib, surf, compressed, &AddrSurfInfoIn); -- 2.30.2