mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
va: allocator: Hack for i965 to get linear RGB DMABufs.
i965 driver has a hack to provide linear dmabufs, which is required for RGB formats, since they are directly uploaded by glupload, ignoring tiled modifiers. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2127>
This commit is contained in:
parent
672c977927
commit
e2ff55b40d
1 changed files with 20 additions and 2 deletions
|
@ -87,7 +87,8 @@ _create_surfaces (GstVaDisplay * display, guint rt_format, guint fourcc,
|
||||||
.type = VASurfaceAttribMemoryType,
|
.type = VASurfaceAttribMemoryType,
|
||||||
.flags = VA_SURFACE_ATTRIB_SETTABLE,
|
.flags = VA_SURFACE_ATTRIB_SETTABLE,
|
||||||
.value.type = VAGenericValueTypeInteger,
|
.value.type = VAGenericValueTypeInteger,
|
||||||
.value.value.i = ext_buf ? VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME
|
.value.value.i = (ext_buf && ext_buf->num_buffers > 0)
|
||||||
|
? VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME
|
||||||
: VA_SURFACE_ATTRIB_MEM_TYPE_VA,
|
: VA_SURFACE_ATTRIB_MEM_TYPE_VA,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -636,6 +637,7 @@ gst_va_dmabuf_allocator_setup_buffer_full (GstAllocator * allocator,
|
||||||
GstVaDmabufAllocator *self = GST_VA_DMABUF_ALLOCATOR (allocator);
|
GstVaDmabufAllocator *self = GST_VA_DMABUF_ALLOCATOR (allocator);
|
||||||
GstVideoFormat format;
|
GstVideoFormat format;
|
||||||
VADRMPRIMESurfaceDescriptor desc = { 0, };
|
VADRMPRIMESurfaceDescriptor desc = { 0, };
|
||||||
|
VASurfaceAttribExternalBuffers *extbuf = NULL, ext_buf;
|
||||||
VASurfaceID surface;
|
VASurfaceID surface;
|
||||||
guint32 i, fourcc, rt_format, export_flags;
|
guint32 i, fourcc, rt_format, export_flags;
|
||||||
GDestroyNotify buffer_destroy = NULL;
|
GDestroyNotify buffer_destroy = NULL;
|
||||||
|
@ -651,9 +653,25 @@ gst_va_dmabuf_allocator_setup_buffer_full (GstAllocator * allocator,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* HACK(victor): disable tiling for i965 driver for RGB formats */
|
||||||
|
if (gst_va_display_is_implementation (self->display,
|
||||||
|
GST_VA_IMPLEMENTATION_INTEL_I965)
|
||||||
|
&& GST_VIDEO_INFO_IS_RGB (&self->info)) {
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
ext_buf = (VASurfaceAttribExternalBuffers) {
|
||||||
|
.width = GST_VIDEO_INFO_WIDTH (&self->info),
|
||||||
|
.height = GST_VIDEO_INFO_HEIGHT (&self->info),
|
||||||
|
.num_planes = GST_VIDEO_INFO_N_PLANES (&self->info),
|
||||||
|
.pixel_format = fourcc,
|
||||||
|
};
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
|
extbuf = &ext_buf;
|
||||||
|
}
|
||||||
|
|
||||||
if (!_create_surfaces (self->display, rt_format, fourcc,
|
if (!_create_surfaces (self->display, rt_format, fourcc,
|
||||||
GST_VIDEO_INFO_WIDTH (&self->info),
|
GST_VIDEO_INFO_WIDTH (&self->info),
|
||||||
GST_VIDEO_INFO_HEIGHT (&self->info), self->usage_hint, NULL,
|
GST_VIDEO_INFO_HEIGHT (&self->info), self->usage_hint, extbuf,
|
||||||
&surface, 1))
|
&surface, 1))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue