configure.ac | 29 +++++++---- src/Makefile.am | 3 - src/compat-api.h | 99 ++++++++++++++++++++++++++++++++++++++++ src/neo.h | 26 ++++++++-- src/neo_2070.c | 16 ++++-- src/neo_2090.c | 15 +++--- src/neo_2097.c | 11 +++- src/neo_2200.c | 10 +++- src/neo_cursor.c | 4 - src/neo_dga.c | 28 ++++++----- src/neo_driver.c | 135 ++++++++++++++++++++++++++++++++++--------------------- src/neo_i2c.c | 1 src/neo_shadow.c | 11 ++-- src/neo_video.c | 10 +--- 14 files changed, 291 insertions(+), 107 deletions(-)
New commits: commit a559a07989265a84ee31530a2b002899b40389ae Author: Matt Turner <[email protected]> Date: Fri Aug 16 11:12:14 2013 -0700 xf86-video-neomagic 1.2.8 Signed-off-by: Matt Turner <[email protected]> diff --git a/configure.ac b/configure.ac index a6eafa3..dce0d93 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-video-neomagic], - [1.2.7], + [1.2.8], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/Neomagic], [xf86-video-neomagic]) AC_CONFIG_SRCDIR([Makefile.am]) commit d7c14dfbac1b50ad484c0070075f060b53783550 Author: Matthieu Herrb <[email protected]> Date: Thu Jun 13 23:38:13 2013 +0200 Unbreak shadowfb initialization with modern X servers. Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=434468 Signed-off-by: Matthieu Herrb <[email protected]> Signed-off-by: Matt Turner <[email protected]> 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 } commit 005d61313e989bf054b1cc2190f1c743362d86ff Author: Adam Jackson <[email protected]> Date: Tue Sep 25 08:54:44 2012 -0400 Remove mibstore.h Signed-off-by: Adam Jackson <[email protected]> diff --git a/src/neo_driver.c b/src/neo_driver.c index ce89ce0..a17b925 100644 --- a/src/neo_driver.c +++ b/src/neo_driver.c @@ -69,9 +69,6 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* All drivers initialising the SW cursor need this */ #include "mipointer.h" -/* All drivers implementing backing store need this */ -#include "mibstore.h" - /* All drivers using the mi colormap manipulation need this */ #include "micmap.h" @@ -1618,7 +1615,6 @@ NEOScreenInit(SCREEN_INIT_ARGS_DECL) "Acceleration %s Initialized\n",ret ? "" : "not"); } - miInitializeBackingStore(pScreen); xf86SetBackingStore(pScreen); xf86SetSilkenMouse(pScreen); commit bc78be1c268d02c91926425cdf09ba1f7f1e3879 Author: Matt Turner <[email protected]> Date: Sun Sep 9 14:07:22 2012 -0700 Don't check for unneeded proto headers DGA unneeded since b6633ee7, others probably never needed. Signed-off-by: Matt Turner <[email protected]> diff --git a/configure.ac b/configure.ac index 342b133..a6eafa3 100644 --- a/configure.ac +++ b/configure.ac @@ -53,14 +53,6 @@ AC_ARG_WITH(xorg-module-dir, [moduledir="$withval"], [moduledir="$libdir/xorg/modules"]) - -# Store the list of server defined optional extensions in REQUIRED_MODULES -XORG_DRIVER_CHECK_EXT(RANDR, randrproto) -XORG_DRIVER_CHECK_EXT(RENDER, renderproto) -XORG_DRIVER_CHECK_EXT(XV, videoproto) -XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) -XORG_DRIVER_CHECK_EXT(XFreeXDGA, xf86dgaproto) - # Obtain compiler/linker options for the driver dependencies PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_MODULES]) commit a419c141d67728f84fdb376257618fe199154d29 Author: Matt Turner <[email protected]> Date: Sun Sep 9 13:29:24 2012 -0700 Remove uses of xf86PciInfo.h Signed-off-by: Matt Turner <[email protected]> diff --git a/src/neo.h b/src/neo.h index 6aecc33..6812e7a 100644 --- a/src/neo.h +++ b/src/neo.h @@ -320,3 +320,14 @@ typedef struct { #define PROBED_NM2097 0x83 #define PROBED_NM2160 0x44 #define PROBED_NM2200 0x45 + +#define PCI_VENDOR_NEOMAGIC 0x10C8 +#define PCI_CHIP_NM2070 0x0001 +#define PCI_CHIP_NM2090 0x0002 +#define PCI_CHIP_NM2093 0x0003 +#define PCI_CHIP_NM2097 0x0083 +#define PCI_CHIP_NM2160 0x0004 +#define PCI_CHIP_NM2200 0x0005 +#define PCI_CHIP_NM2230 0x0025 +#define PCI_CHIP_NM2360 0x0006 +#define PCI_CHIP_NM2380 0x0016 diff --git a/src/neo_2090.c b/src/neo_2090.c index 5049ab4..2f1efc8 100644 --- a/src/neo_2090.c +++ b/src/neo_2090.c @@ -42,7 +42,6 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "xf86.h" #include "xf86_OSproc.h" #include "compiler.h" -#include "xf86PciInfo.h" /* Drivers that use XAA need this */ #include "xf86fbman.h" diff --git a/src/neo_dga.c b/src/neo_dga.c index 8ea31a9..c5d60d5 100644 --- a/src/neo_dga.c +++ b/src/neo_dga.c @@ -29,7 +29,6 @@ #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Pci.h" -#include "xf86PciInfo.h" #include "neo.h" #include "neo_reg.h" #include "dgaproc.h" diff --git a/src/neo_driver.c b/src/neo_driver.c index d7369e2..ce89ce0 100644 --- a/src/neo_driver.c +++ b/src/neo_driver.c @@ -60,9 +60,6 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "xf86RAC.h" #endif -/* Drivers for PCI hardware need this */ -#include "xf86PciInfo.h" - /* Drivers that need to access the PCI config space directly need this */ #include "xf86Pci.h" diff --git a/src/neo_i2c.c b/src/neo_i2c.c index 82d1f2a..5bbb3fb 100644 --- a/src/neo_i2c.c +++ b/src/neo_i2c.c @@ -44,7 +44,6 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "compiler.h" #include "xf86Pci.h" -#include "xf86PciInfo.h" #include "vgaHW.h" diff --git a/src/neo_shadow.c b/src/neo_shadow.c index 2df7657..04efe4f 100644 --- a/src/neo_shadow.c +++ b/src/neo_shadow.c @@ -10,7 +10,6 @@ #include "xf86.h" #include "xf86_OSproc.h" -#include "xf86PciInfo.h" #include "xf86Pci.h" #include "shadowfb.h" #include "servermd.h" commit 3a4cd45c63671f89bed7b1c9cc518ac028c189d3 Author: Matt Turner <[email protected]> Date: Sun Sep 9 13:23:35 2012 -0700 Add &component=Driver/Neomagic to Bugzilla link Signed-off-by: Matt Turner <[email protected]> diff --git a/configure.ac b/configure.ac index 29cf772..342b133 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.60]) AC_INIT([xf86-video-neomagic], [1.2.7], - [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], + [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/Neomagic], [xf86-video-neomagic]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) commit 66f7229838ce725cff0813a9eae02ed452204ad1 Author: Matt Turner <[email protected]> Date: Sun Sep 9 13:10:24 2012 -0700 Don't call NEO_Sync with no XAA The commit that makes XAA optional left a use of NEO_Sync while putting the body inside an #ifdef HAVE_XAA_H block, which caused undefined symbol errors when loading the driver. NEO_Sync doesn't do anything without XAA, so don't bother calling it without XAA. Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=434468 Reviewed-by: Alex Deucher <[email protected]> diff --git a/src/neo_dga.c b/src/neo_dga.c index b6346c5..8ea31a9 100644 --- a/src/neo_dga.c +++ b/src/neo_dga.c @@ -38,10 +38,10 @@ static Bool NEO_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **, int *, int *, int *); static Bool NEO_SetMode(ScrnInfoPtr, DGAModePtr); -static void NEO_Sync(ScrnInfoPtr); static int NEO_GetViewport(ScrnInfoPtr); static void NEO_SetViewport(ScrnInfoPtr, int, int, int); #ifdef HAVE_XAA_H +static void NEO_Sync(ScrnInfoPtr); static void NEO_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long); static void NEO_BlitRect(ScrnInfoPtr, int, int, int, int, int, int); #if 0 @@ -57,8 +57,8 @@ DGAFunctionRec NEODGAFuncs = { NEO_SetMode, NEO_SetViewport, NEO_GetViewport, - NEO_Sync, #ifdef HAVE_XAA_H + NEO_Sync, NEO_FillRect, NEO_BlitRect, #if 0 @@ -219,17 +219,14 @@ NEO_FillRect ( } } - static void NEO_Sync( ScrnInfoPtr pScrn ){ NEOPtr pNEO = NEOPTR(pScrn); -#ifdef HAVE_XAA_H if(pNEO->AccelInfoRec) { (*pNEO->AccelInfoRec->Sync)(pScrn); } -#endif } static void commit 7a10cbda5a0a9ae31e33c5cc77c6b1bda8cae852 Author: Dave Airlie <[email protected]> Date: Tue Jul 17 16:05:09 2012 +1000 xf86-video-neomagic: bump to version 1.2.7 Signed-off-by: Dave Airlie <[email protected]> diff --git a/configure.ac b/configure.ac index 48bce17..29cf772 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-video-neomagic], - [1.2.6], + [1.2.7], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xf86-video-neomagic]) AC_CONFIG_SRCDIR([Makefile.am]) commit 808aa999ad78ccc3384d08d501d43688795bee5e Author: Dave Airlie <[email protected]> Date: Mon Jul 16 03:29:55 2012 +0100 neomagic: fix build when XAA is unavailable. Signed-off-by: Dave Airlie <[email protected]> diff --git a/configure.ac b/configure.ac index ded0912..48bce17 100644 --- a/configure.ac +++ b/configure.ac @@ -80,6 +80,23 @@ AC_CHECK_DECL(XSERVER_LIBPCIACCESS, [#include "xorg-server.h"]) CPPFLAGS="$SAVE_CPPFLAGS" +AC_ARG_ENABLE(xaa, + AS_HELP_STRING([--enable-xaa], + [Enable legacy X Acceleration Architecture (XAA) [default=auto]]), + [XAA="$enableval"], + [XAA=auto]) +if test "x$XAA" != xno; then + save_CFLAGS=$CFLAGS + save_CPPFLAGS=$CPPFLAGS + CFLAGS=$XORG_CFLAGS + CPPFLAGS="$XORG_CFLAGS" + AC_CHECK_HEADERS([xaa.h], XAA=yes, XAA=no) + CFLAGS=$save_CFLAGS + CPPFLAGS=$save_CPPFLAGS +fi +AC_MSG_CHECKING([whether to include XAA support]) +AM_CONDITIONAL(XAA, test "x$XAA" = xyes) +AC_MSG_RESULT([$XAA]) if test "x$XSERVER_LIBPCIACCESS" = xyes; then PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) diff --git a/src/neo.h b/src/neo.h index 7c7beb1..6aecc33 100644 --- a/src/neo.h +++ b/src/neo.h @@ -46,8 +46,11 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. /* Everything using inb/outb, etc needs "compiler.h" */ #include "compiler.h" +#ifdef HAVE_XAA_H #include "xaa.h" #include "xaalocal.h" /* XAA internals as we replace some of XAA */ +#endif +#include "xf86fbman.h" #include "xf86Cursor.h" #include "shadowfb.h" @@ -202,7 +205,9 @@ typedef struct neoRec PCITAG PciTag; #endif EntityInfoPtr pEnt; +#ifdef HAVE_XAA_H XAAInfoRecPtr AccelInfoRec; +#endif NEOACLRec Accel; unsigned long NeoMMIOAddr; unsigned long NeoLinearAddr; diff --git a/src/neo_2070.c b/src/neo_2070.c index fab01ab..4767b7d 100644 --- a/src/neo_2070.c +++ b/src/neo_2070.c @@ -52,6 +52,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "neo_reg.h" #include "neo_macros.h" +#ifdef HAVE_XAA_H /* Memory Mapped I/O for BitBlt */ #define NEO2070_BLTSTAT 0x00 #define NEO2070_BLTCNTL 0x04 @@ -99,9 +100,12 @@ static void Neo2070SetupForSolidFillRect(ScrnInfoPtr pScrn, int color, int rop, static void Neo2070SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h); +#endif + Bool Neo2070AccelInit(ScreenPtr pScreen) { +#ifdef HAVE_XAA_H XAAInfoRecPtr infoPtr; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); NEOPtr nPtr = NEOPTR(pScrn); @@ -160,9 +164,12 @@ Neo2070AccelInit(ScreenPtr pScreen) } return(XAAInit(pScreen, infoPtr)); - +#else + return FALSE; +#endif } +#ifdef HAVE_XAA_H static void Neo2070Sync(ScrnInfoPtr pScrn) { @@ -260,8 +267,5 @@ Neo2070SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h) OUTREG(NEO2070_XYEXT, ((h-1)<<16) | ((w-1) & 0xffff)); OUTREG(NEO2070_DSTSTART, (y * nAcl->Pitch) + (x * nAcl->PixelWidth)); } - - - - +#endif diff --git a/src/neo_2090.c b/src/neo_2090.c index f7b407a..5049ab4 100644 --- a/src/neo_2090.c +++ b/src/neo_2090.c @@ -53,6 +53,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "neo_reg.h" #include "neo_macros.h" +#ifdef HAVE_XAA_H static unsigned int neo2090Rop[16] = { 0x000000, /* 0x0000 - GXclear */ 0x080000, /* 0x1000 - GXand */ @@ -95,10 +96,11 @@ static void Neo2093SubsequentScanlineCPUToScreenColorExpandFill( int w, int h, int skipleft); static void Neo2093SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno); - +#endif Bool Neo2090AccelInit(ScreenPtr pScreen) { +#ifdef HAVE_XAA_H XAAInfoRecPtr infoPtr; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); NEOPtr nPtr = NEOPTR(pScrn); @@ -198,8 +200,12 @@ Neo2090AccelInit(ScreenPtr pScreen) nAcl->BltCntlFlags |= NEO_BC3_FIFO_EN; return(XAAInit(pScreen, infoPtr)); +#else + return FALSE; +#endif } +#ifdef HAVE_XAA_H static void Neo2090Sync(ScrnInfoPtr pScrn) { @@ -363,6 +369,4 @@ Neo2093SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno) OUTREG(NEOREG_XYEXT, (1<<16) | (nAcl->CPUToScreenColorExpandFill_w & 0xffff)); } - - - +#endif diff --git a/src/neo_2097.c b/src/neo_2097.c index d1e2389..399ace0 100644 --- a/src/neo_2097.c +++ b/src/neo_2097.c @@ -56,6 +56,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "neo_reg.h" #include "neo_macros.h" +#ifdef HAVE_XAA_H static void Neo2097Sync(ScrnInfoPtr pScrn); static void Neo2097SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop, @@ -118,11 +119,12 @@ static unsigned int neo2097Rop[16] = { 0x070000, /* 0x0111 - GXnand */ 0x0f0000 /* 0x1111 - GXset */ }; - +#endif Bool Neo2097AccelInit(ScreenPtr pScreen) { +#ifdef HAVE_XAA_H XAAInfoRecPtr infoPtr; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); NEOPtr nPtr = NEOPTR(pScrn); @@ -249,8 +251,12 @@ Neo2097AccelInit(ScreenPtr pScreen) } return(XAAInit(pScreen, infoPtr)); +#else + return FALSE; +#endif } +#ifdef HAVE_XAA_H static void Neo2097Sync(ScrnInfoPtr pScrn) { @@ -544,3 +550,4 @@ Neo2097SubsequentImageWriteScanline( ){ /* should I be checking for fifo slots here ? */ } +#endif diff --git a/src/neo_2200.c b/src/neo_2200.c index 72864a5..5694ae4 100644 --- a/src/neo_2200.c +++ b/src/neo_2200.c @@ -51,6 +51,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "neo_reg.h" #include "neo_macros.h" +#ifdef HAVE_XAA_H static void Neo2200Sync(ScrnInfoPtr pScrn); static void Neo2200SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop, @@ -115,9 +116,11 @@ static unsigned int neo2200Rop[16] = { 0x0f0000 /* 0x1111 - GXset */ }; +#endif Bool Neo2200AccelInit(ScreenPtr pScreen) { +#ifdef HAVE_XAA_H XAAInfoRecPtr infoPtr; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); NEOPtr nPtr = NEOPTR(pScrn); @@ -254,8 +257,12 @@ Neo2200AccelInit(ScreenPtr pScreen) } return(XAAInit(pScreen, infoPtr)); +#else + return FALSE; +#endif } +#ifdef HAVE_XAA_H static void Neo2200Sync(ScrnInfoPtr pScrn) { @@ -647,3 +654,4 @@ Neo2200SubsequentMono8x8PatternFill(ScrnInfoPtr pScrn, OUTREG(NEOREG_XYEXT, (h<<16) | (w & 0xffff)); } #endif +#endif diff --git a/src/neo_dga.c b/src/neo_dga.c index 799150c..b6346c5 100644 --- a/src/neo_dga.c +++ b/src/neo_dga.c @@ -30,8 +30,6 @@ #include "xf86_OSproc.h" #include "xf86Pci.h" #include "xf86PciInfo.h" -#include "xaa.h" -#include "xaalocal.h" #include "neo.h" #include "neo_reg.h" #include "dgaproc.h" @@ -43,12 +41,14 @@ static Bool NEO_SetMode(ScrnInfoPtr, DGAModePtr); static void NEO_Sync(ScrnInfoPtr); static int NEO_GetViewport(ScrnInfoPtr); static void NEO_SetViewport(ScrnInfoPtr, int, int, int); +#ifdef HAVE_XAA_H static void NEO_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long); static void NEO_BlitRect(ScrnInfoPtr, int, int, int, int, int, int); #if 0 static void NEO_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int, unsigned long); #endif +#endif static DGAFunctionRec NEODGAFuncs = { @@ -58,6 +58,7 @@ DGAFunctionRec NEODGAFuncs = { NEO_SetViewport, NEO_GetViewport, NEO_Sync, +#ifdef HAVE_XAA_H NEO_FillRect, NEO_BlitRect, #if 0 @@ -65,6 +66,9 @@ DGAFunctionRec NEODGAFuncs = { #else NULL #endif +#else + NULL, NULL, NULL +#endif }; Bool @@ -99,8 +103,10 @@ NEODGAInit(ScreenPtr pScreen) currentMode->mode = pMode; currentMode->flags = DGA_CONCURRENT_ACCESS | DGA_PIXMAP_AVAILABLE; +#ifdef HAVE_XAA_H if (!pNEO->noAccel) currentMode->flags |= (DGA_FILL_RECT | DGA_BLIT_RECT); +#endif if(pMode->Flags & V_DBLSCAN) currentMode->flags |= DGA_DOUBLESCAN; if(pMode->Flags & V_INTERLACE) @@ -197,6 +203,7 @@ NEO_SetViewport( pNEO->DGAViewportStatus = 0; } +#ifdef HAVE_XAA_H static void NEO_FillRect ( ScrnInfoPtr pScrn, @@ -212,15 +219,17 @@ NEO_FillRect ( } } + static void NEO_Sync( ScrnInfoPtr pScrn ){ NEOPtr pNEO = NEOPTR(pScrn); - +#ifdef HAVE_XAA_H if(pNEO->AccelInfoRec) { (*pNEO->AccelInfoRec->Sync)(pScrn); } +#endif } static void @@ -257,7 +266,7 @@ NEO_BlitTransRect( prohibit usage of ~0 as the key */ } #endif - +#endif static Bool NEO_OpenFramebuffer( ScrnInfoPtr pScrn, @@ -277,3 +286,4 @@ NEO_OpenFramebuffer( return TRUE; } + diff --git a/src/neo_driver.c b/src/neo_driver.c index 124bd6f..d7369e2 100644 --- a/src/neo_driver.c +++ b/src/neo_driver.c @@ -1788,8 +1788,10 @@ NEOCloseScreen(CLOSE_SCREEN_ARGS_DECL) neoLock(pScrn); neoUnmapMem(pScrn); } +#ifdef HAVE_XAA_H if (nPtr->AccelInfoRec) XAADestroyInfoRec(nPtr->AccelInfoRec); +#endif if (nPtr->CursorInfo) xf86DestroyCursorInfoRec(nPtr->CursorInfo); if (nPtr->ShadowPtr) diff --git a/src/neo_video.c b/src/neo_video.c index 8e63947..be60421 100644 --- a/src/neo_video.c +++ b/src/neo_video.c @@ -38,8 +38,6 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) #include "dixstruct.h" -#include "xaa.h" -#include "xaalocal.h" static XF86VideoAdaptorPtr NEOSetupVideo(ScreenPtr); commit 9b33cc9fe94d97c8b954a3614ead34622d293bc3 Author: Dave Airlie <[email protected]> Date: Wed Jun 6 12:21:55 2012 +0100 neomagic: port to new compat API. Signed-off-by: Dave Airlie <[email protected]> diff --git a/src/Makefile.am b/src/Makefile.am index e07e52e..764cb5f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -43,4 +43,5 @@ neomagic_drv_la_SOURCES = \ neo_shadow.c \ neo_video.c \ neo_video.h \ - neo_pcirename.h + neo_pcirename.h \ + compat-api.h diff --git a/src/compat-api.h b/src/compat-api.h new file mode 100644 index 0000000..6bc946f --- /dev/null +++ b/src/compat-api.h @@ -0,0 +1,99 @@ +/* + * Copyright 2012 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Dave Airlie <[email protected]> + */ + +/* this file provides API compat between server post 1.13 and pre it, + it should be reused inside as many drivers as possible */ +#ifndef COMPAT_API_H +#define COMPAT_API_H + +#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR +#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum] +#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p +#endif + +#ifndef XF86_HAS_SCRN_CONV +#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum] +#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex] +#endif + +#ifndef XF86_SCRN_INTERFACE + +#define SCRN_ARG_TYPE int +#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)] + +#define SCREEN_ARG_TYPE int +#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)] + +#define SCREEN_INIT_ARGS_DECL int i, ScreenPtr pScreen, int argc, char **argv + +#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask +#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask + +#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen +#define CLOSE_SCREEN_ARGS scrnIndex, pScreen + +#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags +#define ADJUST_FRAME_ARGS(arg, x, y) (arg)->scrnIndex, x, y, 0 + +#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags +#define SWITCH_MODE_ARGS(arg, m) (arg)->scrnIndex, m, 0 + +#define FREE_SCREEN_ARGS_DECL int arg, int flags + +#define VT_FUNC_ARGS_DECL int arg, int flags +#define VT_FUNC_ARGS pScrn->scrnIndex, 0 + +#define XF86_SCRN_ARG(x) ((x)->scrnIndex) +#else +#define SCRN_ARG_TYPE ScrnInfoPtr +#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1) + +#define SCREEN_ARG_TYPE ScreenPtr +#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1) + +#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv + +#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask +#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask + +#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen +#define CLOSE_SCREEN_ARGS pScreen + +#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y +#define ADJUST_FRAME_ARGS(arg, x, y) arg, x, y + +#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode +#define SWITCH_MODE_ARGS(arg, m) arg, m + +#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg + +#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg +#define VT_FUNC_ARGS pScrn + +#define XF86_SCRN_ARG(x) (x) + +#endif + +#endif diff --git a/src/neo.h b/src/neo.h index f3f2b4c..7c7beb1 100644 --- a/src/neo.h +++ b/src/neo.h @@ -71,6 +71,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "neo_reg.h" #include "neo_macros.h" +#include "compat-api.h" /* Supported chipsets */ typedef enum { NM2070, @@ -86,8 +87,8 @@ typedef enum { /* function prototypes */ -extern Bool NEOSwitchMode(int scrnIndex, DisplayModePtr mode, int flags); -extern void NEOAdjustFrame(int scrnIndex, int x, int y, int flags); +extern Bool NEOSwitchMode(SWITCH_MODE_ARGS_DECL); +extern void NEOAdjustFrame(ADJUST_FRAME_ARGS_DECL); /* in neo_2070.c */ extern Bool Neo2070AccelInit(ScreenPtr pScreen); @@ -111,7 +112,7 @@ extern Bool neo_I2CInit(ScrnInfoPtr pScrn); /* in neo_shadow.c */ void neoShadowUpdate (ScreenPtr pScreen, shadowBufPtr pBuf); -void neoPointerMoved(int index, int x, int y); +void neoPointerMoved(SCRN_ARG_TYPE arg, int x, int y); void neoRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox); void neoRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox); void neoRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox); @@ -256,7 +257,7 @@ typedef struct neoRec unsigned char * ShadowPtr; int ShadowPitch; RefreshAreaFuncPtr refreshArea; - void (*PointerMoved)(int index, int x, int y); + void (*PointerMoved)(SCRN_ARG_TYPE arg, int x, int y); int rotate; Bool showcache; Bool video; diff --git a/src/neo_2070.c b/src/neo_2070.c index b3811d6..fab01ab 100644 --- a/src/neo_2070.c +++ b/src/neo_2070.c @@ -103,7 +103,7 @@ Bool Neo2070AccelInit(ScreenPtr pScreen) { XAAInfoRecPtr infoPtr; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); NEOPtr nPtr = NEOPTR(pScrn); NEOACLPtr nAcl = NEOACLPTR(pScrn); diff --git a/src/neo_2090.c b/src/neo_2090.c index 45f34dd..f7b407a 100644 --- a/src/neo_2090.c +++ b/src/neo_2090.c @@ -100,7 +100,7 @@ Bool Neo2090AccelInit(ScreenPtr pScreen) { XAAInfoRecPtr infoPtr; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); NEOPtr nPtr = NEOPTR(pScrn); NEOACLPtr nAcl = NEOACLPTR(pScrn); diff --git a/src/neo_2097.c b/src/neo_2097.c index 7d720df..d1e2389 100644 --- a/src/neo_2097.c +++ b/src/neo_2097.c @@ -124,7 +124,7 @@ Bool Neo2097AccelInit(ScreenPtr pScreen) { XAAInfoRecPtr infoPtr; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); NEOPtr nPtr = NEOPTR(pScrn); NEOACLPtr nAcl = NEOACLPTR(pScrn); diff --git a/src/neo_2200.c b/src/neo_2200.c index 4b354e7..72864a5 100644 --- a/src/neo_2200.c +++ b/src/neo_2200.c @@ -119,7 +119,7 @@ Bool Neo2200AccelInit(ScreenPtr pScreen) { XAAInfoRecPtr infoPtr; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); NEOPtr nPtr = NEOPTR(pScrn); NEOACLPtr nAcl = NEOACLPTR(pScrn); diff --git a/src/neo_cursor.c b/src/neo_cursor.c index c524527..40a517c 100644 --- a/src/neo_cursor.c +++ b/src/neo_cursor.c @@ -243,7 +243,7 @@ neoLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src) static Bool neoUseHWCursor(ScreenPtr pScr, CursorPtr pCurs) { - NEOACLPtr nAcl = NEOACLPTR(xf86Screens[pScr->myNum]); + NEOACLPtr nAcl = NEOACLPTR(xf86ScreenToScrn(pScr)); return(nAcl->UseHWCursor && !nAcl->NoCursorMode); } @@ -291,7 +291,7 @@ neoRealizeCursor(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) Bool NeoCursorInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); NEOPtr nPtr = NEOPTR(pScrn); xf86CursorInfoPtr infoPtr; infoPtr = xf86CreateCursorInfoRec(); diff --git a/src/neo_dga.c b/src/neo_dga.c index 3e2a02e..799150c 100644 --- a/src/neo_dga.c +++ b/src/neo_dga.c @@ -70,7 +70,7 @@ DGAFunctionRec NEODGAFuncs = { Bool NEODGAInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); NEOPtr pNEO = NEOPTR(pScrn); DGAModePtr modes = NULL, newmodes = NULL, currentMode; DisplayModePtr pMode, firstMode; @@ -155,8 +155,8 @@ NEO_SetMode( if(!pMode) { /* restore the original mode */ if(pNEO->DGAactive) { pScrn->currentMode = NEOSavedDGAModes[index]; -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected] Archive: http://lists.debian.org/[email protected]

