diff options
author | Eric Anholt <eric@anholt.net> | 2010-03-26 11:37:13 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-05-26 12:20:12 -0700 |
commit | f076bd02e9da1ed1e8481aefbc0b5a374cf17eb7 (patch) | |
tree | 1bc76d7aea5d8b0201719c90e1b2706109c489f7 | |
parent | 03bbb4c896ef3cd275312b413a2c85d9f499c032 (diff) |
Submit any existing batchbuffer before potentially handing off a BO to TFP.compositing-fix
Otherwise, a GL compositing manager could get the results of rendering
not synced with the X command stream as of the TFP call.
-rw-r--r-- | src/i830_dri.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c index 61abd36f..5d510733 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -72,6 +72,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); + } +} + #if DRI2INFOREC_VERSION < 2 static DRI2BufferPtr @@ -99,6 +114,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) { @@ -197,6 +213,7 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment, } if (attachment == DRI2BufferFrontLeft) { + do_tfp_flush(drawable); pixmap = get_drawable_pixmap(drawable); pixmap->refcnt++; } else { |