From 7a47a7b4c4ea969ffa03d7aa729393c51f3016df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Mon, 15 Feb 2021 15:54:11 +0100 Subject: [PATCH] va: allocator: set workaround only for i965 driver In commit 117453b9 a i965 driver workaround was added for all drivers, because at that time we didn't have a driver implementation API. Now there's one. This patch set the workaround only for the i965 driver. Part-of: --- sys/va/gstvaallocator.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/va/gstvaallocator.c b/sys/va/gstvaallocator.c index 0a2ff65c2f..ab111bb019 100644 --- a/sys/va/gstvaallocator.c +++ b/sys/va/gstvaallocator.c @@ -644,9 +644,10 @@ gst_va_dmabuf_allocator_setup_buffer_full (GstAllocator * allocator, &surface, 1)) return FALSE; - /* FIXME(victor): find a better way since this is just a hack for - * i965 driver */ - if (fourcc == VA_FOURCC_YUY2 || fourcc == VA_FOURCC_UYVY) { + /* workaround for missing layered dmabuf formats in i965 */ + if (gst_va_display_is_implementation (self->display, + GST_VA_IMPLEMENTATION_INTEL_I965) + && (fourcc == VA_FOURCC_YUY2 || fourcc == VA_FOURCC_UYVY)) { /* These are not representable as separate planes */ export_flags = VA_EXPORT_SURFACE_COMPOSED_LAYERS; } else {