asahi: Don't hardcode is_dmabuf_modifier_supported

So we can add more modifiers more easily.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>
This commit is contained in:
Alyssa Rosenzweig 2022-11-25 11:54:50 -05:00 committed by Marge Bot
parent a6079e5aa8
commit efa240b74b

View file

@ -1543,13 +1543,12 @@ agx_is_dmabuf_modifier_supported(struct pipe_screen *screen,
if (external_only)
*external_only = false;
switch (modifier) {
case DRM_FORMAT_MOD_APPLE_TWIDDLED:
case DRM_FORMAT_MOD_LINEAR:
return true;
default:
return false;
for (unsigned i = 0; i < ARRAY_SIZE(agx_best_modifiers); ++i) {
if (agx_best_modifiers[i] == modifier)
return true;
}
return false;
}
static void