summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@tungstengraphics.com>2008-06-26 22:53:29 +0100
committerAlan Hourihane <alanh@tungstengraphics.com>2008-07-04 15:17:08 +0100
commitf46c1d43ae2b56f38846ac48c7d2df75bbc79af8 (patch)
treee41609c710d91cd9cd08945f814c75e810257c42
parentf539988340131ae37e65958c96e9faea102a7132 (diff)
Check in SwapBuffers for any new pending dri2 events
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 2013125efe..b4f648ada4 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -307,7 +307,7 @@ __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp)
int
__driParseEvents(__DRIcontextPrivate *pcp, __DRIdrawablePrivate *pdp)
{
- __DRIscreenPrivate *psp = pcp->driScreenPriv;
+ __DRIscreenPrivate *psp = pdp->driScreenPriv;
__DRIDrawableConfigEvent *dc, *last_dc;
__DRIBufferAttachEvent *ba, *last_ba;
unsigned int tail, mask, *p, end, total, size, changed;
@@ -315,7 +315,7 @@ __driParseEvents(__DRIcontextPrivate *pcp, __DRIdrawablePrivate *pdp)
size_t rect_size;
/* Check for wraparound. */
- if (psp->dri2.buffer->prealloc - pdp->dri2.tail > psp->dri2.buffer->size) {
+ if (pcp && psp->dri2.buffer->prealloc - pdp->dri2.tail > psp->dri2.buffer->size) {
/* If prealloc overlaps into what we just parsed, the
* server overwrote it and we have to reset our tail
* pointer. */
@@ -484,6 +484,9 @@ static void driSwapBuffers(__DRIdrawable *dPriv)
if (!dPriv->numClipRects)
return;
+ if (psp->dri2.enabled)
+ __driParseEvents(NULL, dPriv);
+
psp->DriverAPI.SwapBuffers(dPriv);
driReportDamage(dPriv, dPriv->pClipRects, dPriv->numClipRects);