diff --git a/src/i830_video.c b/src/i830_video.c index b0403d4..71ea620 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -326,9 +326,12 @@ drmmode_overlay_put_image(ScrnInfoPtr scrn, xf86CrtcPtr crtc, ret = drmCommandWrite(intel->drmSubFD, DRM_I915_OVERLAY_PUT_IMAGE, &request, sizeof(request)); - /* drop the newly displaying buffer right away */ drm_intel_bo_disable_reuse(adaptor_priv->buf); - drm_intel_bo_unreference(adaptor_priv->buf); + if (adaptor_priv->old_buf2) + drm_intel_bo_unreference(adaptor_priv->old_buf2); + + adaptor_priv->old_buf2 = adaptor_priv->old_buf; + adaptor_priv->old_buf = adaptor_priv->buf; adaptor_priv->buf = NULL; if (ret != 0) { diff --git a/src/i830_video.h b/src/i830_video.h index a2beae0..69887a5 100644 --- a/src/i830_video.h +++ b/src/i830_video.h @@ -52,6 +52,8 @@ typedef struct { Time freeTime; /** YUV data buffers */ drm_intel_bo *buf; + drm_intel_bo *old_buf; + drm_intel_bo *old_buf2; Bool textured; Rotation rotation; /* should remove intel->rotation later */