va: postproc: Set usage hint generic if DMABuf.

iHD driver sets a tiled DRM modifier if surface's usage hint is set to
VPP_WRITE. This result in a garbled rendering when using glimagesink.

This patch changes the usage hint to generic if the caps feature is
DMABuf. Either way only iHD driver, so far, uses the usage hint flag.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2127>
This commit is contained in:
Víctor Manuel Jáquez Leal 2021-03-31 11:04:17 +02:00
parent b4535093f6
commit 9365073d50

View file

@ -691,6 +691,9 @@ gst_va_vpp_decide_allocation (GstBaseTransform * trans, GstQuery * query)
} }
if (!allocator) { if (!allocator) {
/* XXX(victor): VPP_WRITE uses a tiled drm modifier by iHD */
if (gst_caps_is_dmabuf (outcaps) && GST_VIDEO_INFO_IS_RGB (&vinfo))
usage_hint = VA_SURFACE_ATTRIB_USAGE_HINT_GENERIC;
if (!(allocator = _create_allocator (self, outcaps, usage_hint))) if (!(allocator = _create_allocator (self, outcaps, usage_hint)))
return FALSE; return FALSE;
} }