diff --git a/src/intel_dri.c b/src/intel_dri.c index 198d5d4..2d27761 100644 --- a/src/intel_dri.c +++ b/src/intel_dri.c @@ -73,6 +73,21 @@ typedef struct { unsigned int attachment; } I830DRI2BufferPrivateRec, *I830DRI2BufferPrivatePtr; +/* If the drawable is one that might have GLX_texture_from_pixmap done + * to it, flush rendering before handing a reference to it back to + * GLX. + */ +static void +do_tfp_flush(DrawablePtr drawable) +{ + if (drawable->type == DRAWABLE_PIXMAP) { + ScreenPtr screen = drawable->pScreen; + ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + + intel_batch_submit(scrn, FALSE); + } +} + #if DRI2INFOREC_VERSION < 2 static DRI2BufferPtr @@ -100,6 +115,7 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments, pDepthPixmap = NULL; for (i = 0; i < count; i++) { if (attachments[i] == DRI2BufferFrontLeft) { + do_tfp_flush(drawable); pixmap = get_drawable_pixmap(drawable); pixmap->refcnt++; } else if (attachments[i] == DRI2BufferStencil && pDepthPixmap) { @@ -206,6 +222,7 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment, } if (attachment == DRI2BufferFrontLeft) { + do_tfp_flush(drawable); pixmap = get_drawable_pixmap(drawable); pixmap->refcnt++; } else {