[PATCH xf86-video-neomagic] Unbreak shadowfb initialization with modern X servers.

Matthieu Herrb matthieu.herrb at laas.fr
Thu Jun 13 14:38:13 PDT 2013


Signed-off-by: Matthieu Herrb <matthieu.herrb at laas.fr>
---
 src/neo.h        |  1 +
 src/neo_driver.c | 40 +++++++++++++++++++++++++++++++++++++++-
 2 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/src/neo.h b/src/neo.h
index 6812e7a..7b386d4 100644
--- a/src/neo.h
+++ b/src/neo.h
@@ -261,6 +261,7 @@ typedef struct neoRec
     vbeInfoPtr          pVbe;
     unsigned char * ShadowPtr;
     int ShadowPitch;
+    CreateScreenResourcesProcPtr CreateScreenResources;
     RefreshAreaFuncPtr refreshArea;
     void	(*PointerMoved)(SCRN_ARG_TYPE arg, int x, int y);
     int rotate;
diff --git a/src/neo_driver.c b/src/neo_driver.c
index a17b925..7e60f3e 100644
--- a/src/neo_driver.c
+++ b/src/neo_driver.c
@@ -1401,6 +1401,44 @@ NEOLoadPalette(
    } 
 }
 
+static Bool
+NEOCreateScreenResources(ScreenPtr pScreen)
+{
+	ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+	NEOPtr pNeo = NEOPTR(pScrn);
+	PixmapPtr pPixmap;
+	Bool ret;
+
+	pScreen->CreateScreenResources = pNeo->CreateScreenResources;
+	ret = pScreen->CreateScreenResources(pScreen);
+	pScreen->CreateScreenResources = NEOCreateScreenResources;
+
+	if (!ret)
+		return FALSE;
+
+	pPixmap = pScreen->GetScreenPixmap(pScreen);
+
+	if (!shadowAdd(pScreen, pPixmap, neoShadowUpdate,
+		NULL, 0, NULL)) {
+		return FALSE;
+	}
+	return TRUE;
+}
+
+static Bool
+NEOShadowInit(ScreenPtr pScreen)
+{
+	ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+	NEOPtr pNeo = NEOPTR(pScrn);
+
+	if (!shadowSetup(pScreen))
+		return FALSE;
+	pNeo->CreateScreenResources = pScreen->CreateScreenResources;
+	pScreen->CreateScreenResources = NEOCreateScreenResources;
+
+	return TRUE;
+}
+
 /* Mandatory */
 static Bool
 NEOScreenInit(SCREEN_INIT_ARGS_DECL)
@@ -1651,7 +1689,7 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL)
 #if 0
 	ShadowFBInit(pScreen, nPtr->refreshArea);
 #else
-	shadowInit (pScreen, neoShadowUpdate, 0);
+	NEOShadowInit (pScreen);
 #endif
     }
     
-- 
1.8.3



More information about the xorg-devel mailing list