st/vdpau: fix deadlock in PresentationQueueQuerySurfaceStatus
authorChristian König <deathsimple@vodafone.de>
Thu, 29 Mar 2012 13:53:28 +0000 (15:53 +0200)
committerChristian König <deathsimple@vodafone.de>
Tue, 3 Apr 2012 15:33:26 +0000 (17:33 +0200)
Signed-off-by: Christian König <deathsimple@vodafone.de>
src/gallium/state_trackers/vdpau/presentation.c

index 2e3bea94154f00dd53310401bf014722c262f718..51a702eefde391c1ebe5c44f99f18ac87b760c46 100644 (file)
@@ -368,14 +368,15 @@ vlVdpPresentationQueueQuerySurfaceStatus(VdpPresentationQueue presentation_queue
       if (screen->fence_signalled(screen, surf->fence)) {
          screen->fence_reference(screen, &surf->fence, NULL);
          *status = VDP_PRESENTATION_QUEUE_STATUS_VISIBLE;
+         pipe_mutex_unlock(pq->device->mutex);
 
          // We actually need to query the timestamp of the last VSYNC event from the hardware
          vlVdpPresentationQueueGetTime(presentation_queue, first_presentation_time);
          *first_presentation_time += 1;
       } else {
          *status = VDP_PRESENTATION_QUEUE_STATUS_QUEUED;
+         pipe_mutex_unlock(pq->device->mutex);
       }
-      pipe_mutex_unlock(pq->device->mutex);
    }
 
    return VDP_STATUS_OK;