[PATCH 3/4] dix: allow pixmap dirty helper to be used for non-shared pixmaps
Dave Airlie
airlied at gmail.com
Mon Jan 7 17:31:55 PST 2013
From: Fedora X Ninjas <x at fedoraproject.org>
this allows the pixmap dirty helper to be used for reverse optimus,
where the GPU wants to copy from the shared pixmap to its VRAM copy.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
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
More information about the xorg-devel
mailing list