vaallocator: only i965 can switch derived/non-derived at mapping

Since newer drivers change the strides and offset, and they have to be defined
at allocation time because those parameters are stored in the GstVideoMeta in
the buffer pool.

Thinks patch is based on commit 6b1fba14 and commit 809a984b

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5778>
This commit is contained in:
Víctor Manuel Jáquez Leal 2023-12-11 15:26:11 +01:00 committed by GStreamer Marge Bot
parent 099741e35f
commit 8944d5326e

View file

@ -1372,13 +1372,6 @@ _va_map_unlocked (GstVaMemory * mem, GstMapFlags flags)
use_derived = FALSE;
} else {
switch (gst_va_display_get_implementation (display)) {
case GST_VA_IMPLEMENTATION_INTEL_IHD:
/* On Gen7+ Intel graphics the memory is mappable but not
* cached, so normal memcpy() access is very slow to read, but
* it's ok for writing. So let's assume that users won't prefer
* direct-mapped memory if they request read access. */
use_derived = va_allocator->use_derived && !(flags & GST_MAP_READ);
break;
case GST_VA_IMPLEMENTATION_INTEL_I965:
/* YUV derived images are tiled, so writing them is also
* problematic */
@ -1386,12 +1379,6 @@ _va_map_unlocked (GstVaMemory * mem, GstMapFlags flags)
|| ((flags & GST_MAP_WRITE)
&& GST_VIDEO_INFO_IS_YUV (&va_allocator->info)));
break;
case GST_VA_IMPLEMENTATION_MESA_GALLIUM:
/* Reading RGB derived images, with non-standard resolutions,
* looks like tiled too. TODO(victor): fill a bug in Mesa. */
use_derived = va_allocator->use_derived && !((flags & GST_MAP_READ)
&& GST_VIDEO_INFO_IS_RGB (&va_allocator->info));
break;
default:
use_derived = va_allocator->use_derived;
break;