aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/vdpau/output.c')
-rw-r--r--src/gallium/state_trackers/vdpau/output.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/vdpau/output.c b/src/gallium/state_trackers/vdpau/output.c
index 64574b23762..d67ead80f83 100644
--- a/src/gallium/state_trackers/vdpau/output.c
+++ b/src/gallium/state_trackers/vdpau/output.c
@@ -798,7 +798,6 @@ VdpStatus vlVdpOutputSurfaceDMABuf(VdpOutputSurface surface,
pipe_mutex_lock(vlsurface->device->mutex);
vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);
vlsurface->device->context->flush(vlsurface->device->context, NULL, 0);
- pipe_mutex_unlock(vlsurface->device->mutex);
memset(&whandle, 0, sizeof(struct winsys_handle));
whandle.type = DRM_API_HANDLE_TYPE_FD;
@@ -806,8 +805,12 @@ VdpStatus vlVdpOutputSurfaceDMABuf(VdpOutputSurface surface,
pscreen = vlsurface->surface->texture->screen;
if (!pscreen->resource_get_handle(pscreen, vlsurface->device->context,
vlsurface->surface->texture, &whandle,
- PIPE_HANDLE_USAGE_READ_WRITE))
+ PIPE_HANDLE_USAGE_READ_WRITE)) {
+ pipe_mutex_unlock(vlsurface->device->mutex);
return VDP_STATUS_NO_IMPLEMENTATION;
+ }
+
+ pipe_mutex_unlock(vlsurface->device->mutex);
result->handle = whandle.handle;
result->width = vlsurface->surface->width;