Signed-off-by: Chris Wilson <[email protected]>
Cc: Ville Syrjälä <[email protected]>
Cc: Dave Airlie <[email protected]>
Cc: Kristian Høgsberg <[email protected]>
Cc: Jesse Barnes <[email protected]>
Cc: Michel Dänzer <[email protected]>
---
 hw/xfree86/dri2/dri2.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 7896a61..0cdda07 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -107,6 +107,7 @@ typedef struct _DRI2Screen {
     HandleExposuresProcPtr       HandleExposures;
 
     ConfigNotifyProcPtr                 ConfigNotify;
+    SetWindowPixmapProcPtr      SetWindowPixmap;
 } DRI2ScreenRec;
 
 static DRI2ScreenPtr
@@ -1091,6 +1092,25 @@ DRI2ConfigNotify(WindowPtr pWin, int x, int y, int w, 
int h, int bw,
     return Success;
 }
 
+static void
+DRI2SetWindowPixmap(WindowPtr pWin, PixmapPtr pPixmap)
+{
+    DrawablePtr pDraw = &pWin->drawable;
+    ScreenPtr pScreen = pWin->drawable.pScreen;
+    DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
+
+    if (ds->SetWindowPixmap) {
+       pScreen->SetWindowPixmap = ds->SetWindowPixmap;
+
+       (*pScreen->SetWindowPixmap)(pWin, pPixmap);
+
+       ds->SetWindowPixmap = pScreen->SetWindowPixmap;
+       pScreen->SetWindowPixmap = DRI2SetWindowPixmap;
+    }
+
+    DRI2InvalidateDrawable(pDraw);
+}
+
 Bool
 DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
 {
@@ -1187,6 +1207,9 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
     ds->ConfigNotify = pScreen->ConfigNotify;
     pScreen->ConfigNotify = DRI2ConfigNotify;
 
+    ds->SetWindowPixmap = pScreen->SetWindowPixmap;
+    pScreen->SetWindowPixmap = DRI2SetWindowPixmap;
+
     xf86DrvMsg(pScreen->myNum, X_INFO, "[DRI2] Setup complete\n");
     for (i = 0; i < sizeof(driverTypeNames) / sizeof(driverTypeNames[0]); i++) 
{
        if (i < ds->numDrivers && ds->driverNames[i]) {
-- 
1.7.5.1

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to