From 621c1077606182a6f42deff553b184d545aa12c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Thu, 28 Jun 2018 20:55:38 +0200 Subject: [PATCH] ac/surface/gfx9: let addrlib choose the preferred swizzle kind MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Our choices here are simply redundant as long as sin.flags is set correctly. (v2: - remove unused function parameter) Reviewed-by: Marek Olšák --- src/amd/common/ac_surface.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c index edd710a968c..4a79765d004 100644 --- a/src/amd/common/ac_surface.c +++ b/src/amd/common/ac_surface.c @@ -1038,8 +1038,7 @@ static int gfx6_compute_surface(ADDR_HANDLE addrlib, static int gfx9_get_preferred_swizzle_mode(ADDR_HANDLE addrlib, ADDR2_COMPUTE_SURFACE_INFO_INPUT *in, - bool is_fmask, unsigned flags, - AddrSwizzleMode *swizzle_mode) + bool is_fmask, AddrSwizzleMode *swizzle_mode) { ADDR_E_RETURNCODE ret; ADDR2_GET_PREFERRED_SURF_SETTING_INPUT sin = {0}; @@ -1064,16 +1063,6 @@ gfx9_get_preferred_swizzle_mode(ADDR_HANDLE addrlib, sin.numSamples = in->numSamples; sin.numFrags = in->numFrags; - if (flags & RADEON_SURF_SCANOUT) { - sin.preferredSwSet.sw_D = 1; - /* Raven only allows S for displayable surfaces with < 64 bpp, so - * allow it as fallback */ - sin.preferredSwSet.sw_S = 1; - } else if (in->flags.depth || in->flags.stencil || is_fmask) - sin.preferredSwSet.sw_Z = 1; - else - sin.preferredSwSet.sw_S = 1; - if (is_fmask) { sin.flags.display = 0; sin.flags.color = 0; @@ -1273,8 +1262,7 @@ static int gfx9_compute_miptree(ADDR_HANDLE addrlib, fout.size = sizeof(ADDR2_COMPUTE_FMASK_INFO_OUTPUT); ret = gfx9_get_preferred_swizzle_mode(addrlib, in, - true, surf->flags, - &fin.swizzleMode); + true, &fin.swizzleMode); if (ret != ADDR_OK) return ret; @@ -1476,8 +1464,7 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib, } r = gfx9_get_preferred_swizzle_mode(addrlib, &AddrSurfInfoIn, - false, surf->flags, - &AddrSurfInfoIn.swizzleMode); + false, &AddrSurfInfoIn.swizzleMode); if (r) return r; break; @@ -1513,8 +1500,7 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib, if (!AddrSurfInfoIn.flags.depth) { r = gfx9_get_preferred_swizzle_mode(addrlib, &AddrSurfInfoIn, - false, surf->flags, - &AddrSurfInfoIn.swizzleMode); + false, &AddrSurfInfoIn.swizzleMode); if (r) return r; } else -- 2.30.2