summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va/surface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/va/surface.c')
-rw-r--r--src/gallium/state_trackers/va/surface.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c
index 8a6a397528a..5efb8934c5c 100644
--- a/src/gallium/state_trackers/va/surface.c
+++ b/src/gallium/state_trackers/va/surface.c
@@ -621,6 +621,14 @@ vlVaCreateSurfaces2(VADriverContextP ctx, unsigned int format,
switch (memory_type) {
case VA_SURFACE_ATTRIB_MEM_TYPE_VA:
+ /* The application will clear the TILING flag when the surface is
+ * intended to be exported as dmabuf. Adding shared flag because not
+ * null memory_attibute means VASurfaceAttribExternalBuffers is used.
+ */
+ if (memory_attibute &&
+ !(memory_attibute->flags & VA_SURFACE_EXTBUF_DESC_ENABLE_TILING))
+ templat.bind = PIPE_BIND_LINEAR | PIPE_BIND_SHARED;
+
surf->buffer = drv->pipe->create_video_buffer(drv->pipe, &templat);
if (!surf->buffer) {
FREE(surf);