lima: set yuv formats as external_only

lima is not able to use yuv textures directly.
Set them as external_only so that drivers don't attempt to send yuv
planes directly as dma bufs.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8549>
This commit is contained in:
Erico Nunes 2021-01-18 02:44:46 +01:00 committed by Marge Bot
parent 774fae34f0
commit f17c8dc798

View file

@ -501,6 +501,11 @@ static const uint64_t lima_available_modifiers[] = {
DRM_FORMAT_MOD_LINEAR,
};
static bool lima_is_modifier_external_only(enum pipe_format format)
{
return util_format_is_yuv(format);
}
static void
lima_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen,
enum pipe_format format, int max,
@ -519,7 +524,7 @@ lima_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen,
for (int i = 0; i < *count; i++) {
modifiers[i] = lima_available_modifiers[i];
if (external_only)
external_only[i] = false;
external_only[i] = lima_is_modifier_external_only(format);
}
}
@ -532,7 +537,7 @@ lima_screen_is_dmabuf_modifier_supported(struct pipe_screen *pscreen,
for (int i = 0; i < ARRAY_SIZE(lima_available_modifiers); i++) {
if (lima_available_modifiers[i] == modifier) {
if (external_only)
*external_only = false;
*external_only = lima_is_modifier_external_only(format);
return true;
}