/* Bind the drawable to the context */
pcp->driDrawablePriv = pdp;
+ pcp->driReadablePriv = prp;
pdp->driContextPriv = pcp;
pdp->refcount++;
if ( pdp != prp ) {
DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
}
+ if ((pdp != prp) && (!pdp->pStamp || *pdp->pStamp != pdp->lastStamp)) {
+ DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
+ __driUtilUpdateDrawableInfo(prp);
+ DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
+ }
+
/* Call device-specific MakeCurrent */
(*psp->DriverAPI.MakeCurrent)(pcp, pdp, prp);
__DRIscreenPrivate *psp;
__DRIcontextPrivate *pcp = pdp->driContextPriv;
- if (!pcp || (pdp != pcp->driDrawablePriv)) {
+ if (!pcp
+ || ((pdp != pcp->driDrawablePriv) && (pdp != pcp->driReadablePriv))) {
/* ERROR!!! */
return;
}
__DRInativeDisplay *display;
/**
- * Pointer to drawable currently bound to this context.
+ * Pointer to drawable currently bound to this context for drawing.
*/
__DRIdrawablePrivate *driDrawablePriv;
+ /**
+ * Pointer to drawable currently bound to this context for reading.
+ */
+ __DRIdrawablePrivate *driReadablePriv;
+
/**
* Pointer to screen on which this context was created.
*/