summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Hourihane <[email protected]>2008-06-26 22:53:29 +0100
committerAlan Hourihane <[email protected]>2008-06-26 22:53:29 +0100
commit3b132b297febf99d7f3989d82f09578471880321 (patch)
treed9d837fc35f70e4427d7ca05d6ef85a237b49d00
parent5174b85a0cb13b06779ea6fc0a8362c9fe57e2ea (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 10d2e801dcc..9655741bbba 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -283,7 +283,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;
@@ -291,7 +291,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. */
@@ -460,6 +460,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);