summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau/surface.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-01-04 11:42:13 +0100
committerMarek Olšák <[email protected]>2017-01-04 17:27:41 +0100
commitdbba4e03b16b80bf4071016b8197369ccb20c72b (patch)
treebc03b523f11d063b0622a5df9a801aa52a50b20e /src/gallium/state_trackers/vdpau/surface.c
parent7d48a84b16b6f1e60dae921fc17fe4d1e55701d0 (diff)
vdpau: call texture_get_handle while the mutex is being held
The context may be used by texture_get_handle. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99158 Reviewed-by: Christian König <[email protected]> Cc: 13.0 <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/vdpau/surface.c')
-rw-r--r--src/gallium/state_trackers/vdpau/surface.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/vdpau/surface.c b/src/gallium/state_trackers/vdpau/surface.c
index 69afce00499..9a80605e24c 100644
--- a/src/gallium/state_trackers/vdpau/surface.c
+++ b/src/gallium/state_trackers/vdpau/surface.c
@@ -460,10 +460,10 @@ VdpStatus vlVdpVideoSurfaceDMABuf(VdpVideoSurface surface,
}
surf = p_surf->video_buffer->get_surfaces(p_surf->video_buffer)[plane];
- pipe_mutex_unlock(p_surf->device->mutex);
-
- if (!surf)
+ if (!surf) {
+ pipe_mutex_unlock(p_surf->device->mutex);
return VDP_STATUS_RESOURCES;
+ }
memset(&whandle, 0, sizeof(struct winsys_handle));
whandle.type = DRM_API_HANDLE_TYPE_FD;
@@ -472,8 +472,12 @@ VdpStatus vlVdpVideoSurfaceDMABuf(VdpVideoSurface surface,
pscreen = surf->texture->screen;
if (!pscreen->resource_get_handle(pscreen, p_surf->device->context,
surf->texture, &whandle,
- PIPE_HANDLE_USAGE_READ_WRITE))
+ PIPE_HANDLE_USAGE_READ_WRITE)) {
+ pipe_mutex_unlock(p_surf->device->mutex);
return VDP_STATUS_NO_IMPLEMENTATION;
+ }
+
+ pipe_mutex_unlock(p_surf->device->mutex);
result->handle = whandle.handle;
result->width = surf->width;