39d9603
From 9f493b930ef99253ba7e37dc280daff6738b6401 Mon Sep 17 00:00:00 2001
39d9603
From: Soren Sandmann Pedersen <sandmann@redhat.com>
39d9603
Date: Fri, 6 Nov 2009 10:29:49 +1000
39d9603
Subject: [PATCH] [PATCH] fb: Use fb functions to copy the window to a temporary pixmap.
e973f43
48eea31
Previously, it would use the screen ops, but this meant that the new
48eea31
pixmap would be created by the DDX and then immediately accessed by
48eea31
software fallbacks without the DDX having a chance to map the drawable
48eea31
correctly.
48eea31
48eea31
Instead, use fbCreatePixmap() and fbCopyArea() directly, without going
48eea31
through the DDX hooks.
39d9603
39d9603
airlied: also remove the miClearDrawable call, since we are going
39d9603
to copy over the whole drawable, and this also reenters the wrap
39d9603
chain which confuses EXA.
e973f43
---
39d9603
 fb/fbpict.c |    7 +++----
39d9603
 1 files changed, 3 insertions(+), 4 deletions(-)
e973f43
e973f43
diff --git a/fb/fbpict.c b/fb/fbpict.c
39d9603
index 2fbef15..5c96427 100644
e973f43
--- a/fb/fbpict.c
e973f43
+++ b/fb/fbpict.c
48eea31
@@ -280,7 +280,7 @@ copy_drawable (DrawablePtr pDraw)
e973f43
     width = pDraw->width;
e973f43
     height = pDraw->height;
e973f43
     
e973f43
-    pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pDraw->depth, 0);
48eea31
+    pPixmap = fbCreatePixmap (pScreen, width, height, pDraw->depth, 0);
48eea31
     
48eea31
     if (!pPixmap)
48eea31
 	return NULL;
48eea31
@@ -289,7 +289,7 @@ copy_drawable (DrawablePtr pDraw)
48eea31
     
48eea31
     if (!pGC)
48eea31
     {
e973f43
-	(*pScreen->DestroyPixmap) (pPixmap);
48eea31
+	fbDestroyPixmap (pPixmap);
e973f43
 	return NULL;
48eea31
     }
48eea31
     
39d9603
@@ -298,11 +298,10 @@ copy_drawable (DrawablePtr pDraw)
39d9603
     gcv[1].val = IncludeInferiors;
39d9603
     dixChangeGC (NullClient, pGC, GCBackground | GCSubwindowMode, NULL, gcv);
39d9603
     ValidateGC ((DrawablePtr)pPixmap, pGC);
39d9603
-    miClearDrawable ((DrawablePtr)pPixmap, pGC);
e973f43
     
48eea31
     /* Then copy the window there */
48eea31
     ValidateGC(&pPixmap->drawable, pGC);
e973f43
-    (* pGC->ops->CopyArea) (pDraw, &pPixmap->drawable, pGC, 0, 0, width, height, 0, 0);
48eea31
+    fbCopyArea (pDraw, &pPixmap->drawable, pGC, 0, 0, width, height, 0, 0);
9c9ae67
     
48eea31
     FreeScratchGC (pGC);
e973f43
     
e973f43
-- 
39d9603
1.6.5.2
e973f43