From: Nicolai Hähnle Date: Wed, 20 Sep 2017 14:45:48 +0000 (+0200) Subject: ac/surface: handle error when choosing preferred swizzle mode X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eb71394ff38d05a42cb8d04fedb6539cc7bbe6fa;p=mesa.git ac/surface: handle error when choosing preferred swizzle mode CID: 1418140 Fixes: c4ac522511d2 ("ac/surface: handle S8 on gfx9") Reviewed-by: Marek Olšák Reviewed-by: Dave Airlie --- 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);