panfrost: Gate tiled AFBC on GPUs that support it

Introduced with v7.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16697>
This commit is contained in:
Alyssa Rosenzweig 2022-05-04 17:11:59 -04:00 committed by Marge Bot
parent 3fbfd356af
commit 1f1da58ed1

View file

@ -587,6 +587,7 @@ panfrost_walk_dmabuf_modifiers(struct pipe_screen *screen,
struct panfrost_device *dev = pan_device(screen);
bool afbc = dev->has_afbc && panfrost_format_supports_afbc(dev, format);
bool ytr = panfrost_afbc_can_ytr(format);
bool tiled_afbc = panfrost_afbc_can_tile(dev);
unsigned count = 0;
@ -597,6 +598,9 @@ panfrost_walk_dmabuf_modifiers(struct pipe_screen *screen,
if ((pan_best_modifiers[i] & AFBC_FORMAT_MOD_YTR) && !ytr)
continue;
if ((pan_best_modifiers[i] & AFBC_FORMAT_MOD_TILED) && !tiled_afbc)
continue;
if (test_modifier != DRM_FORMAT_MOD_INVALID &&
test_modifier != pan_best_modifiers[i])
continue;