vl/dri3: support receiving new pixmap for front buffer
authorLeo Liu <leo.liu@amd.com>
Thu, 9 Jun 2016 16:53:54 +0000 (12:53 -0400)
committerLeo Liu <leo.liu@amd.com>
Fri, 10 Jun 2016 15:24:24 +0000 (11:24 -0400)
With glx of gstreamer-vaapi, the temporary pixmap for front buffer gets
renewed in each frame, so when we receive a new pixmap, should get a new
front buffer for it.

This also fixes Totem player playback corruption.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/gallium/auxiliary/vl/vl_winsys_dri3.c

index c69e67796c0e7e54b1a17a1e2f91317300af87a9..f7f572ea5c2b3f1fdb1a5e6106427eb24eb5d4f6 100644 (file)
@@ -358,8 +358,13 @@ dri3_set_drawable(struct vl_dri3_screen *scrn, Drawable drawable)
    if (error) {
       if (error->error_code != BadWindow)
          ret = false;
-      else
+      else {
          scrn->is_pixmap = true;
+         if (scrn->front_buffer) {
+            dri3_free_front_buffer(scrn, scrn->front_buffer);
+            scrn->front_buffer = NULL;
+         }
+      }
       free(error);
    } else
       scrn->special_event =