ac/surface: don't set is_displayable if displayable DCC is missing
authorMarek Olšák <marek.olsak@amd.com>
Wed, 10 Jun 2020 15:43:49 +0000 (11:43 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 11 Jun 2020 10:01:57 +0000 (10:01 +0000)
If flags.display isn't set, then displayable DCC will not be computed, so
is_displayable will always be false.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5424>

src/amd/common/ac_surface.c

index 0e9604affef5d8693de21ff6f21ea1fb26072371..4ef72b1b3232799ef4ab6f282ecd798f408f869c 100644 (file)
@@ -1932,9 +1932,12 @@ static int gfx9_compute_surface(struct ac_addrlib *addrlib,
 
                /* Display needs unaligned DCC. */
                if (surf->num_dcc_levels &&
-                   !is_dcc_supported_by_DCN(info, config, surf,
-                                            surf->u.gfx9.dcc.rb_aligned,
-                                            surf->u.gfx9.dcc.pipe_aligned))
+                   (!is_dcc_supported_by_DCN(info, config, surf,
+                                             surf->u.gfx9.dcc.rb_aligned,
+                                             surf->u.gfx9.dcc.pipe_aligned) ||
+                    /* Don't set is_displayable if displayable DCC is missing. */
+                    (info->use_display_dcc_with_retile_blit &&
+                     !surf->u.gfx9.dcc_retile_num_elements)))
                        displayable = false;
        }
        surf->is_displayable = displayable;