DRI2: Pass the context instead of the screen to __dri2ParseEvents().
authorKristian Høgsberg <krh@sasori.boston.redhat.com>
Mon, 10 Mar 2008 01:19:17 +0000 (21:19 -0400)
committerKristian Høgsberg <krh@sasori.boston.redhat.com>
Mon, 10 Mar 2008 01:19:17 +0000 (21:19 -0400)
Makes a lot more sense, since the screen is always implicit in the
DRI drawable, but it may not be possible to track down a context from
just a drawable.

src/mesa/drivers/dri/common/dri_util.c
src/mesa/drivers/dri/common/dri_util.h
src/mesa/drivers/dri/intel/intel_context.c

index 733cfae165036bc1b87ed12825698bc441e544f7..aa6c31ddb84011e73820817717f3d0d218e989e2 100644 (file)
@@ -193,8 +193,8 @@ static GLboolean driBindContext(__DRIcontext * ctx,
     */
 
     if (psp->dri2.enabled) {
-       __driParseEvents(psp, pdp);
-       __driParseEvents(psp, prp);
+       __driParseEvents(pcp, pdp);
+       __driParseEvents(pcp, prp);
     } else {
        if (!pdp->pStamp || *pdp->pStamp != pdp->lastStamp) {
            DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
@@ -286,17 +286,14 @@ __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp)
 }
 
 int
-__driParseEvents(__DRIscreenPrivate *psp, __DRIdrawablePrivate *pdp)
+__driParseEvents(__DRIcontextPrivate *pcp, __DRIdrawablePrivate *pdp)
 {
+    __DRIscreenPrivate *psp = pcp->driScreenPriv;
     __DRIDrawableConfigEvent *dc, *last_dc;
     __DRIBufferAttachEvent *ba, *last_ba;
     unsigned int tail, mask, *p, end, total, size, changed;
     unsigned char *data;
     size_t rect_size;
-    __DRIcontextPrivate *pcp = pdp->driContextPriv;
-
-    if (pcp == NULL)
-       return 0;
 
     /* Check for wraparound. */
     if (psp->dri2.buffer->prealloc - pdp->dri2.tail > psp->dri2.buffer->size) {
index e6659811d75dee5541515c99943897e9413bee00..aaaf2427888c784880238ba29873bdf5bf5db8fb 100644 (file)
@@ -559,7 +559,7 @@ extern void
 __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp);
 
 extern int
-__driParseEvents(__DRIscreenPrivate *psp, __DRIdrawablePrivate *pdp);
+__driParseEvents(__DRIcontextPrivate *psp, __DRIdrawablePrivate *pdp);
 
 extern float
 driCalculateSwapUsage( __DRIdrawablePrivate *dPriv,
index cad8277c998afef0149421e53a6aa43ece2b6f5a..12300e914638a7fd3caf9057574795165729d19e 100644 (file)
@@ -864,7 +864,7 @@ intelContendedLock(struct intel_context *intel, GLuint flags)
     */
    if (dPriv) {
       if (sPriv->dri2.enabled)
-        drawable_changed = __driParseEvents(sPriv, dPriv);
+       drawable_changed = __driParseEvents(dPriv->driContextPriv, dPriv);
       else
         DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
    }