mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 03:31:05 +00:00
va:allocator: Rework the func va_map_unlocked
Rework the va_map_unlocked() after we keep mapping behavior (whether to use derive) consistent with allocator_try stage. Also remove the flag for iHD case because pitch/stride difference between vaCreateImage and vaDeriveImage only possibly happen on iHD by now. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5046>
This commit is contained in:
parent
b997f541b2
commit
809a984b91
1 changed files with 5 additions and 15 deletions
|
@ -1387,24 +1387,12 @@ _va_map_unlocked (GstVaMemory * mem, GstMapFlags flags)
|
||||||
mem->mapped_data = &mem->surface;
|
mem->mapped_data = &mem->surface;
|
||||||
goto success;
|
goto success;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (va_allocator->feat_use_derived == GST_VA_FEATURE_ENABLED) {
|
|
||||||
use_derived = TRUE;
|
|
||||||
} else if (va_allocator->feat_use_derived == GST_VA_FEATURE_DISABLED) {
|
|
||||||
use_derived = FALSE;
|
|
||||||
} else {
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
/* XXX: Derived image doesn't seem to work for D3D backend */
|
/* XXX: Derived image doesn't seem to work for D3D backend */
|
||||||
use_derived = FALSE;
|
use_derived = FALSE;
|
||||||
#else
|
#else
|
||||||
|
if (va_allocator->feat_use_derived == GST_VA_FEATURE_AUTO) {
|
||||||
switch (gst_va_display_get_implementation (display)) {
|
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:
|
case GST_VA_IMPLEMENTATION_INTEL_I965:
|
||||||
/* YUV derived images are tiled, so writing them is also
|
/* YUV derived images are tiled, so writing them is also
|
||||||
* problematic */
|
* problematic */
|
||||||
|
@ -1422,6 +1410,8 @@ _va_map_unlocked (GstVaMemory * mem, GstMapFlags flags)
|
||||||
use_derived = va_allocator->use_derived;
|
use_derived = va_allocator->use_derived;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
use_derived = va_allocator->use_derived;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
info = &va_allocator->info;
|
info = &va_allocator->info;
|
||||||
|
|
Loading…
Reference in a new issue