summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2006-08-30 19:15:55 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2006-09-27 10:48:49 +0200
commit2206a92a97901977910a6e39b4174ca805f9f4a7 (patch)
tree36031dade7e8fafa5212b3cac6ac48f08de72c97 /hw
parent54d371e7a4ebab79a0f616669e2f601d8370cef3 (diff)
Push information about cliprects of DRI windows to the DRM.
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/dri/dri.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 7b4d5bda4..9e52e6146 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -992,6 +992,10 @@ DRICreateDrawable(ScreenPtr pScreen, Drawable id,
pWin = (WindowPtr)pDrawable;
if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
pDRIDrawablePriv->refCount++;
+
+ if (!pDRIDrawablePriv->hwDrawable) {
+ drmCreateDrawable(pDRIPriv->drmFD, &pDRIDrawablePriv->hwDrawable);
+ }
}
else {
/* allocate a DRI Window Private record */
@@ -1000,13 +1004,13 @@ DRICreateDrawable(ScreenPtr pScreen, Drawable id,
}
/* Only create a drm_drawable_t once */
- if (drmCreateDrawable(pDRIPriv->drmFD, hHWDrawable)) {
+ if (drmCreateDrawable(pDRIPriv->drmFD,
+ &pDRIDrawablePriv->hwDrawable)) {
xfree(pDRIDrawablePriv);
return FALSE;
}
/* add it to the list of DRI drawables for this screen */
- pDRIDrawablePriv->hwDrawable = *hHWDrawable;
pDRIDrawablePriv->pScreen = pScreen;
pDRIDrawablePriv->refCount = 1;
pDRIDrawablePriv->drawableIndex = -1;
@@ -1029,6 +1033,15 @@ DRICreateDrawable(ScreenPtr pScreen, Drawable id,
/* track this in case this window is destroyed */
AddResource(id, DRIDrawablePrivResType, (pointer)pWin);
}
+
+ if (pDRIDrawablePriv->hwDrawable) {
+ drmUpdateDrawableInfo(pDRIPriv->drmFD,
+ pDRIDrawablePriv->hwDrawable,
+ DRM_DRAWABLE_CLIPRECTS,
+ REGION_NUM_RECTS(&pWin->clipList),
+ REGION_RECTS(&pWin->clipList));
+ *hHWDrawable = pDRIDrawablePriv->hwDrawable;
+ }
}
else { /* pixmap (or for GLX 1.3, a PBuffer) */
/* NOT_DONE */
@@ -1813,6 +1826,11 @@ DRIClipNotify(WindowPtr pWin, int dx, int dy)
pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp
= DRIDrawableValidationStamp++;
+
+ drmUpdateDrawableInfo(pDRIPriv->drmFD, pDRIDrawablePriv->hwDrawable,
+ DRM_DRAWABLE_CLIPRECTS,
+ REGION_NUM_RECTS(&pWin->clipList),
+ REGION_RECTS(&pWin->clipList));
}
/* call lower wrapped functions */