ac/surface: Allow S swizzle for displayable surfaces.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 11 Apr 2018 00:10:29 +0000 (02:10 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 12 Apr 2018 19:24:55 +0000 (21:24 +0200)
For dcn1 && < 64 bpp displayable surfaces, addrlib only accepts
S swizzles.

At the same time addrlib prefers D swizzles is allowed, so we can
just allow S swizzles as fallback.

Fixes: b64b712558 "ac/surface/gfx9: request desired micro tile mode explicitly"
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/amd/common/ac_surface.c

index 1b4d72e31bd25f34926fdd026c3a15758fc9d518..7558dd91e342a525db83b7328f5fb3dfaa102b26 100644 (file)
@@ -865,9 +865,12 @@ gfx9_get_preferred_swizzle_mode(ADDR_HANDLE addrlib,
        sin.numSamples = in->numSamples;
        sin.numFrags = in->numFrags;
 
-       if (flags & RADEON_SURF_SCANOUT)
+       if (flags & RADEON_SURF_SCANOUT) {
                sin.preferredSwSet.sw_D = 1;
-       else if (in->flags.depth || in->flags.stencil || is_fmask)
+               /* 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;