st/vdpau: add flush on unmap
authorChristian König <christian.koenig@amd.com>
Tue, 28 Jan 2014 14:22:05 +0000 (15:22 +0100)
committerChristian König <christian.koenig@amd.com>
Thu, 6 Feb 2014 19:58:38 +0000 (20:58 +0100)
Flush the context when we unmap a buffer, otherwise VDPAU might
start rendering the next frame while we still reference that buffer.

Signed-off-by: Christian König <christian.koenig@amd.com>
Tested-by: StrangeNoises (rachel@strangenoises.org)
src/mesa/state_tracker/st_vdpau.c

index 4317b9e3479c89d6a972afd509a1c8760a95113b..c5b4780ce5b90e8857336c1e9ad91b0a739fce6c 100644 (file)
@@ -47,6 +47,7 @@
 #include "st_context.h"
 #include "st_texture.h"
 #include "st_format.h"
+#include "st_cb_flush.h"
 
 static void
 st_vdpau_map_surface(struct gl_context *ctx, GLenum target, GLenum access,
@@ -163,6 +164,7 @@ st_vdpau_unmap_surface(struct gl_context *ctx, GLenum target, GLenum access,
                        struct gl_texture_image *texImage,
                        const GLvoid *vdpSurface, GLuint index)
 {
+   struct st_context *st = st_context(ctx);
    struct st_texture_object *stObj = st_texture_object(texObj);
    struct st_texture_image *stImage = st_texture_image(texImage);
 
@@ -171,6 +173,8 @@ st_vdpau_unmap_surface(struct gl_context *ctx, GLenum target, GLenum access,
    pipe_resource_reference(&stImage->pt, NULL);
 
    _mesa_dirty_texobj(ctx, texObj);
+
+   st_flush(st, NULL, 0);
 }
 
 void