st/vdpau: resolve delayed rendering for GL interop v2
authorGrigori Goronzy <greg@chown.ath.cx>
Tue, 5 Nov 2013 23:35:31 +0000 (00:35 +0100)
committerChristian König <christian.koenig@amd.com>
Wed, 6 Nov 2013 07:45:57 +0000 (08:45 +0100)
Otherwise OutputSurface interop has funny results sometimes.
This fixes interop with the mpv media player.

v2 (chk): add proper locking

Signed-off-by: Christian König <christian.koenig@amd.com>
src/gallium/state_trackers/vdpau/output.c

index def01c89d2ab154e439c1247c15001a239b1a9dc..e4e1433eeaad38c1157bdedabbba74a7110dabdd 100644 (file)
@@ -734,5 +734,9 @@ struct pipe_resource *vlVdpOutputSurfaceGallium(VdpOutputSurface surface)
    if (!vlsurface || !vlsurface->surface)
       return NULL;
 
+   pipe_mutex_lock(vlsurface->device->mutex);
+   vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);
+   pipe_mutex_unlock(vlsurface->device->mutex);
+
    return vlsurface->surface->texture;
 }