From 2d358cb22a65c34838bc76f082e4f599b627873f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 30 Aug 2023 13:01:04 +0200 Subject: [PATCH] vaallocator: fix assumption object size equal fd size Remove the comment and warning message that object size should be equal to the file descriptor size. Part-of: --- .../gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c index 1c258ed10b..178d03c622 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c @@ -704,14 +704,14 @@ gst_va_dmabuf_allocator_setup_buffer_full (GstAllocator * allocator, for (i = 0; i < desc.num_objects; i++) { gint fd = desc.objects[i].fd; - /* don't rely on prime descriptor reported size since gallium drivers report - * different values */ + /* prime descriptor reports the total size of the object, including regions + * which aren't part surface's space. Let's just grab the surface's size: */ gsize size = _get_fd_size (fd); GstMemory *mem = gst_dmabuf_allocator_alloc (allocator, fd, size); - if (size != desc.objects[i].size) { + if (desc.objects[i].size < size) { GST_WARNING_OBJECT (self, "driver bug: fd size (%" G_GSIZE_FORMAT - ") differs from object descriptor size (%" G_GUINT32_FORMAT ")", + ") is bigger than object descriptor size (%" G_GUINT32_FORMAT ")", size, desc.objects[i].size); }