c1e706d
From 73fc15d94136a87807c1ce69d56fb8a34c09fe4f Mon Sep 17 00:00:00 2001
c1e706d
From: Fedora X Ninjas <x@fedoraproject.org>
c1e706d
Date: Tue, 8 Jan 2013 09:41:36 +1000
c1e706d
Subject: [PATCH] dix: allow pixmap dirty helper to be used for non-shared
c1e706d
 pixmaps
c1e706d
c1e706d
this allows the pixmap dirty helper to be used for reverse optimus
c1e706d
---
c1e706d
 dix/pixmap.c  | 2 ++
c1e706d
 fb/fbpixmap.c | 1 +
c1e706d
 2 files changed, 3 insertions(+)
c1e706d
c1e706d
diff --git a/dix/pixmap.c b/dix/pixmap.c
c1e706d
index 2418812..fe92147 100644
c1e706d
--- a/dix/pixmap.c
c1e706d
+++ b/dix/pixmap.c
c1e706d
@@ -243,6 +243,8 @@ Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region)
c1e706d
     }
c1e706d
 
c1e706d
     dst = dirty->slave_dst->master_pixmap;
c1e706d
+    if (!dst)
c1e706d
+        dst = dirty->slave_dst;
c1e706d
 
c1e706d
     RegionTranslate(dirty_region, -dirty->x, -dirty->y);
c1e706d
     n = RegionNumRects(dirty_region);
c1e706d
diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c
c1e706d
index fbcdca9..0824b64 100644
c1e706d
--- a/fb/fbpixmap.c
c1e706d
+++ b/fb/fbpixmap.c
c1e706d
@@ -67,6 +67,7 @@ fbCreatePixmapBpp(ScreenPtr pScreen, int width, int height, int depth, int bpp,
c1e706d
     pPixmap->devKind = paddedWidth;
c1e706d
     pPixmap->refcnt = 1;
c1e706d
     pPixmap->devPrivate.ptr = (pointer) ((char *) pPixmap + base + adjust);
c1e706d
+    pPixmap->master_pixmap = NULL;
c1e706d
 
c1e706d
 #ifdef FB_DEBUG
c1e706d
     pPixmap->devPrivate.ptr =
c1e706d
-- 
c1e706d
1.8.1
c1e706d