From a84753dd495bcfd724406cae470e17d0c561d0c3 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 25 Sep 2012 12:55:05 +0000
Subject: Remove mibstore.h

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
diff --git a/src/xgi_driver.c b/src/xgi_driver.c
index 580a03a..8ce071b 100644
--- a/src/xgi_driver.c
+++ b/src/xgi_driver.c
@@ -53,8 +53,6 @@
 
 /* initialise a SW cursor */
 #include "mipointer.h"
-/* implementing backing store */
-#include "mibstore.h"
 
 /* colormap initialization */
 #include "micmap.h"
@@ -2041,10 +2039,6 @@ pScrn->pScreen = pScreen;
         xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "FB Manager init failed \n");
     }
 
-    /* If backing store is to be supported (as is usually the case), initialise it. */
-    miInitializeBackingStore(pScreen);
-    XGIDebug(DBG_FUNCTION, "[DBG] Jong 06142006-After miInitializeBackingStore()\n");
-
     xf86SetBackingStore(pScreen);
     XGIDebug(DBG_FUNCTION, "[DBG] Jong 06142006-After xf86SetBackingStore()\n");
 
--
cgit v0.9.0.2-2-gbebe
From e881cbb7cc4aa2d3a4477fd3e0681dc35075457a Mon Sep 17 00:00:00 2001
From: Egbert Eich <eich@freedesktop.org>
Date: Fri, 19 Jul 2013 12:10:57 +0200
Subject: Remove symbol lists as they are not used any more

Remove symbol lists once used by the old Metrolink module
loader to ensure that all symbols used by the driver are
present.
This module loader has been dropped ages ago, the function
calls into this module loader to perform this verification
has been dropped from this driver howver the symbol lists
have survived - not referenced from anywhere any more.

Reviewed-by:  <wharms@bfs.de>
Signed-off-by: Egbert Eich <eich@freedesktop.org>

diff --git a/src/xgi_driver.c b/src/xgi_driver.c
index 8ce071b..c98fcf7 100644
--- a/src/xgi_driver.c
+++ b/src/xgi_driver.c
@@ -149,149 +149,6 @@ static void xg47_setup_fb_wrap(ReadMemoryProcPtr *read_ptr,
     WriteMemoryProcPtr *write_ptr, DrawablePtr pDraw);
 static void xg47_finish_fb_wrap(DrawablePtr pDraw);
 
-
-static const char *vgahwSymbols[] = {
-    "vgaHWBlankScreen",
-    "vgaHWddc1SetSpeedWeak",
-    "vgaHWFreeHWRec",
-    "vgaHWGetHWRec",
-    "vgaHWGetIOBase",
-    "vgaHWGetIndex",
-    "vgaHWInit",
-    "vgaHWLock",
-    "vgaHWMapMem",
-    "vgaHWProtect",
-    "vgaHWRestore",
-    "vgaHWSave",
-    "vgaHWSaveScreen",
-    "vgaHWSetMmioFuncs",
-    "vgaHWUnlock",
-    NULL
-};
-
-static const char *ddcSymbols[] = {
-    "xf86DoEDID_DDC1",
-    "xf86DoEDID_DDC2",
-    "xf86PrintEDID",
-    "xf86SetDDCproperties",
-    NULL
-};
-
-static const char *i2cSymbols[] = {
-    "xf86CreateI2CBusRec",
-    "xf86I2CBusInit",
-    NULL
-};
-
-static const char *fbSymbols[] = {
-#if X_BYTE_ORDER == X_BIG_ENDIAN
-    "wfbPictureInit",
-    "wfbScreenInit",
-#else
-    "fbPictureInit",
-    "fbScreenInit",
-#endif
-    NULL
-};
-
-static const char *xaaSymbols[] = {
-    "XAACreateInfoRec",
-    "XAAestroyInfoRec",
-    "XAAFillSolidRects",
-    "XAAGetCopyROP",
-    "XAAGetPatternROP", 
-    "XAAInit",
-    "XAAScreenIndex",
-    "XAAStippleScanlineFuncLSBFirst",
-    "XAAOverlayFBfuncs",
-    "XAACachePlanarMonoStipple",
-    "XAAHelpPatternROP",
-    NULL
-};
-
-static const char *ramdacSymbols[] = {
-    "xf86CreateCursorInfoRec",
-    "xf86DestroyCursorInfoRec",
-    "xf86InitCursor",
-    NULL
-};
-
-static const char *drmSymbols[] = {
-    "drmGetInterruptFromBusID",
-    "drmCtlInstHandler",
-    "drmCtlUninstHandler",
-    "drmCommandNone",
-    "drmCommandRead",
-    "drmCommandWrite",
-    "drmCommandWriteRead",
-    "drmFreeVersion",
-    "drmGetLibVersion",
-    "drmGetVersion",
-    "drmMap",
-    "drmUnmap",
-    NULL
-};
-
-static const char *driSymbols[] = {
-    "DRICloseScreen",
-    "DRICreateInfoRec",
-    "DRIDestroyInfoRec",
-    "DRIFinishScreenInit",
-    "DRIGetContext",
-    "DRIGetDeviceInfo",
-    "DRIGetSAREAPrivate",
-    "DRILock",
-    "DRIQueryVersion",
-    "DRIScreenInit",
-    "DRIUnlock",
-    "DRICreatePCIBusID",
-    NULL
-};
-
-static const char *vbeSymbols[] = {
-    "VBEInit",
-    "VBEDPMSSet",
-    "vbeDoEDID",
-    "vbeFree",
-    NULL
-};
-
-static const char *int10Symbols[] = {
-    "xf86ExecX86int10",
-    "xf86FreeInt10",
-    "xf86InitInt10",
-    NULL
-};
-
-static const char *shadowSymbols[] = {
-    "shadowInit",
-    NULL
-};
-
-static const char *fbdevHWSymbols[] = {
-    "fbdevHWInit",
-    "fbdevHWUseBuildinMode",
-    "fbdevHWGetLineLength",
-    "fbdevHWGetVidmem",
-    "fbdevHWDPMSSet",
-    /* colormap */
-    "fbdevHWLoadPaletteWeak",
-    /* ScrnInfo hooks */
-    "fbdevHWAdjustFrameWeak",
-    "fbdevHWEnterVT",
-    "fbdevHWLeaveVT",
-    "fbdevHWModeInit",
-    "fbdevHWRestore",
-    "fbdevHWSave",
-    "fbdevHWSwitchModeWeak",
-    "fbdevHWValidModeWeak",
-    "fbdevHWMapMMIO",
-    "fbdevHWMapVidmem",
-    "fbdevHWUnmapMMIO",
-    "fbdevHWUnmapVidmem",
-    NULL
-};
-
 #ifdef XSERVER_LIBPCIACCESS
 #define XGI_DEVICE_MATCH(d, i) \
     { 0x18ca, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
-- 
cgit v0.10.2

From e5789dfd027424996711f366e036a933d1b98c3f Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 29 Jul 2014 09:37:18 -0400
Subject: shadow: shadowInit -> shadowAdd/Remove

Signed-off-by: Adam Jackson <ajax@redhat.com>

diff --git a/src/xgi.h b/src/xgi.h
index 8cbe77d..e122f1c 100644
--- a/src/xgi.h
+++ b/src/xgi.h
@@ -534,6 +534,7 @@ typedef struct {
     RefreshAreaFuncPtr  RefreshArea;
     CloseScreenProcPtr  CloseScreen;
     ScreenBlockHandlerProcPtr   BlockHandler;
+    CreateScreenResourcesProcPtr CreateScreenResources;
     xf86PointerMovedProc        *PointerMoved;
 
     struct xgi_regs           savedReg;
diff --git a/src/xgi_driver.c b/src/xgi_driver.c
index c98fcf7..637e360 100644
--- a/src/xgi_driver.c
+++ b/src/xgi_driver.c
@@ -1702,6 +1702,25 @@ Bool XGIFBManagerInit(ScreenPtr pScreen)
     return ret;
 }
 
+static Bool
+XGICreateScreenResources(ScreenPtr pScreen)
+{
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+    XGIPtr pXGI = XGIPTR(pScrn);
+    Bool ret;
+
+    pScreen->CreateScreenResources = pXGI->CreateScreenResources;
+    ret = pScreen->CreateScreenResources(pScreen);
+    pXGI->CreateScreenResources = pScreen->CreateScreenResources;
+    pScreen->CreateScreenResources = XGICreateScreenResources;
+
+    if (ret)
+	ret = shadowAdd(pScreen, pScreen->GetScreenPixmap(pScreen),
+			XGIShadowUpdate, NULL, 0, 0);
+
+    return ret;
+}
+
 /* Called at the start of each server generation. */
 Bool XGIScreenInit(SCREEN_INIT_ARGS_DECL)
 {
@@ -2011,7 +2030,10 @@ pScrn->pScreen = pScreen;
         {
             pXGI->RefreshArea = XGIRefreshArea;
         }
-        shadowInit(pScreen, XGIShadowUpdate, 0);
+        if (!shadowSetup(pScreen))
+	    return FALSE;
+	pXGI->CreateScreenResources = pScreen->CreateScreenResources;
+	pScreen->CreateScreenResources = XGICreateScreenResources;
     }
     XGIDebug(DBG_FUNCTION, "[DBG] Jong 06142006-After pXGI->isShadowFB\n");
 
@@ -2272,8 +2294,10 @@ static Bool XGICloseScreen(CLOSE_SCREEN_ARGS_DECL)
 
     if (pXGI->pShadow)
     {
+	shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen));
         free(pXGI->pShadow);
         pXGI->pShadow = NULL;
+	pScreen->CreateScreenResources = pXGI->CreateScreenResources;
     }
 
     if (pXGI->pDgaModes)
-- 
cgit v0.10.2

From cb0ebfa54639619c11ea8277ab7573a5db7484f9 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 29 Jul 2014 09:37:44 -0400
Subject: Stop using deprecated xf86PciInfo.h

Signed-off-by: Adam Jackson <ajax@redhat.com>

diff --git a/src/xgi_driver.c b/src/xgi_driver.c
index 637e360..b440e85 100644
--- a/src/xgi_driver.c
+++ b/src/xgi_driver.c
@@ -43,9 +43,6 @@
 #include <xf86RandR12.h>
 #include "vbe.h"
 
-/* PCI vendor/device definitions */
-#include "xf86PciInfo.h"
-
 /* fbdevhw & vgahw */
 #include "fbdevhw.h"
 #include "vgaHW.h"
-- 
cgit v0.10.2

From e36331f3f2641900efe8363fe3dc15877a72c027 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Wed, 8 Oct 2014 10:34:45 +0200
Subject: Update for new damage API

Signed-off-by: Adam Jackson <ajax@redhat.com>

diff --git a/src/xgi_shadow.c b/src/xgi_shadow.c
index 80f3645..c146ce4 100644
--- a/src/xgi_shadow.c
+++ b/src/xgi_shadow.c
@@ -86,7 +86,7 @@ void XGIRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
 
 void XGIShadowUpdate (ScreenPtr pScreen, shadowBufPtr pBuf)
 {
-    RegionPtr       pRegion = &pBuf->damage;
+    RegionPtr       pRegion = DamageRegion(pBuf->pDamage);
     ScrnInfoPtr     pScrn;
     pScrn = xf86ScreenToScrn(pScreen);
 
-- 
cgit v0.10.2

From 81c1cc40820a3e24efc0565b68f44eb6748a2db9 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 19 Jul 2016 10:03:56 -0400
Subject: Adapt Block/WakeupHandler signature for ABI 23

Signed-off-by: Adam Jackson <ajax@redhat.com>

diff --git a/src/compat-api.h b/src/compat-api.h
index 98ba435..44daea4 100644
--- a/src/compat-api.h
+++ b/src/compat-api.h
@@ -78,11 +78,19 @@
 
 #define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
 
+#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0)
+#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout
+#define BLOCKHANDLER_ARGS arg, pTimeout
+
+#define WAKEUPHANDLER_ARGS_DECL ScreenPtr arg, unsigned long result
+#define WAKEUPHANDLER_ARGS arg, result
+#else
 #define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
 #define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
 
 #define WAKEUPHANDLER_ARGS_DECL ScreenPtr arg, unsigned long result, pointer read_mask
 #define WAKEUPHANDLER_ARGS arg, result, read_mask
+#endif
 
 #define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
 #define CLOSE_SCREEN_ARGS pScreen
-- 
cgit v0.10.2

