From 8fcb9d91b69abc72ddef31b9f2e8585580c6cad2 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 9 Jan 2013 12:52:08 +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, where the GPU wants to copy from the shared pixmap to its VRAM copy. [airlied: slave_dst is wrong name now but pointless ABI churn at this point] Reviewed-by: Keith Packard Signed-off-by: Dave Airlie --- dix/pixmap.c | 2 ++ fb/fbpixmap.c | 1 + 2 files changed, 3 insertions(+) diff --git a/dix/pixmap.c b/dix/pixmap.c index 241881262..fe9214739 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 fbcdca99c..0824b64bb 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 =