Blob Blame History Raw
From 73fc15d94136a87807c1ce69d56fb8a34c09fe4f Mon Sep 17 00:00:00 2001
From: Fedora X Ninjas <x@fedoraproject.org>
Date: Tue, 8 Jan 2013 09:41:36 +1000
Subject: [PATCH] dix: allow pixmap dirty helper to be used for non-shared
 pixmaps

this allows the pixmap dirty helper to be used for reverse optimus
---
 dix/pixmap.c  | 2 ++
 fb/fbpixmap.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/dix/pixmap.c b/dix/pixmap.c
index 2418812..fe92147 100644
--- a/dix/pixmap.c
+++ b/dix/pixmap.c
@@ -243,6 +243,8 @@ Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region)
     }
 
     dst = dirty->slave_dst->master_pixmap;
+    if (!dst)
+        dst = dirty->slave_dst;
 
     RegionTranslate(dirty_region, -dirty->x, -dirty->y);
     n = RegionNumRects(dirty_region);
diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c
index fbcdca9..0824b64 100644
--- a/fb/fbpixmap.c
+++ b/fb/fbpixmap.c
@@ -67,6 +67,7 @@ fbCreatePixmapBpp(ScreenPtr pScreen, int width, int height, int depth, int bpp,
     pPixmap->devKind = paddedWidth;
     pPixmap->refcnt = 1;
     pPixmap->devPrivate.ptr = (pointer) ((char *) pPixmap + base + adjust);
+    pPixmap->master_pixmap = NULL;
 
 #ifdef FB_DEBUG
     pPixmap->devPrivate.ptr =
-- 
1.8.1