ChangeLog | 58 ++++++++++++ configure.ac | 19 ++++ debian/changelog | 12 ++ debian/control | 2 debian/patches/01_default_to_noaccel_on_69k.diff | 8 + src/Makefile.am | 3 src/compat-api.h | 99 ++++++++++++++++++++++ src/ct_accel.c | 20 +++- src/ct_bank.c | 61 ++++++------- src/ct_cursor.c | 7 - src/ct_ddc.c | 5 - src/ct_dga.c | 32 +++++-- src/ct_driver.c | 103 ++++++++++++----------- src/ct_driver.h | 16 ++- src/ct_regs.c | 3 src/ct_shadow.c | 7 - src/ct_video.c | 9 -- 17 files changed, 338 insertions(+), 126 deletions(-)
New commits: commit 490bc88dfde542124dbc89314a4463b0c94e6600 Author: Michele Cane <michele.c...@gmail.com> Date: Sat Sep 7 16:15:42 2013 +0200 Bump Standards-Version to 3.9.4, no changes needed. diff --git a/debian/changelog b/debian/changelog index 11cba6e..bfc7a67 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ xserver-xorg-video-chips (1:1.2.5-1) UNRELEASED; urgency=low [ Michele Cane ] * Refresh patches. + * Bump Standards-Version to 3.9.4, no changes needed. -- Maarten Lankhorst <maarten.lankho...@canonical.com> Wed, 18 Jul 2012 15:55:15 +0200 diff --git a/debian/control b/debian/control index 89944a4..49d5aed 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,7 @@ Build-Depends: x11proto-render-dev, x11proto-xext-dev, xutils-dev -Standards-Version: 3.9.3 +Standards-Version: 3.9.4 Vcs-Git: git://git.debian.org/git/pkg-xorg/driver/xserver-xorg-video-chips Vcs-Browser: http://git.debian.org/?p=pkg-xorg/driver/xserver-xorg-video-chips.git commit a147d8b2799c5e1c03f9b1720598bcfeaa4a8523 Author: Michele Cane <michele.c...@gmail.com> Date: Sat Sep 7 16:14:11 2013 +0200 Refresh patches diff --git a/debian/changelog b/debian/changelog index 1a546c5..11cba6e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,12 @@ xserver-xorg-video-chips (1:1.2.5-1) UNRELEASED; urgency=low + [ Maarten Lankhorst ] * New upstream release. * Bump Standards-Version to 3.9.3 (no changes needed) + [ Michele Cane ] + * Refresh patches. + -- Maarten Lankhorst <maarten.lankho...@canonical.com> Wed, 18 Jul 2012 15:55:15 +0200 xserver-xorg-video-chips (1:1.2.4-2) unstable; urgency=low diff --git a/debian/patches/01_default_to_noaccel_on_69k.diff b/debian/patches/01_default_to_noaccel_on_69k.diff index 8ab7afc..076c85c 100644 --- a/debian/patches/01_default_to_noaccel_on_69k.diff +++ b/debian/patches/01_default_to_noaccel_on_69k.diff @@ -1,6 +1,8 @@ ---- xserver-xorg-video-chips.orig/src/ct_driver.c -+++ xserver-xorg-video-chips/src/ct_driver.c -@@ -1606,8 +1606,28 @@ +Index: xserver-xorg-video-chips.git/src/ct_driver.c +=================================================================== +--- xserver-xorg-video-chips.git.orig/src/ct_driver.c 2013-09-07 16:11:54.000000000 +0200 ++++ xserver-xorg-video-chips.git/src/ct_driver.c 2013-09-07 16:11:54.000000000 +0200 +@@ -1521,8 +1521,28 @@ "rgb bits %d\n", val); } } commit 27e2c6f9ac107882d7844f5e53d499865e721ded Author: Maarten Lankhorst <maarten.lankho...@canonical.com> Date: Wed Jul 18 15:56:11 2012 +0200 Bump Standards-Version to 3.9.3 (no changes needed) diff --git a/debian/changelog b/debian/changelog index ec25513..1a546c5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ xserver-xorg-video-chips (1:1.2.5-1) UNRELEASED; urgency=low * New upstream release. + * Bump Standards-Version to 3.9.3 (no changes needed) -- Maarten Lankhorst <maarten.lankho...@canonical.com> Wed, 18 Jul 2012 15:55:15 +0200 diff --git a/debian/control b/debian/control index e59f467..89944a4 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,7 @@ Build-Depends: x11proto-render-dev, x11proto-xext-dev, xutils-dev -Standards-Version: 3.9.1 +Standards-Version: 3.9.3 Vcs-Git: git://git.debian.org/git/pkg-xorg/driver/xserver-xorg-video-chips Vcs-Browser: http://git.debian.org/?p=pkg-xorg/driver/xserver-xorg-video-chips.git commit 9a126e4e10c7bf08abc491b3e1c62962f94e562f Author: Maarten Lankhorst <maarten.lankho...@canonical.com> Date: Wed Jul 18 15:55:41 2012 +0200 New upstream release. diff --git a/debian/changelog b/debian/changelog index ed5c3c6..ec25513 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xserver-xorg-video-chips (1:1.2.5-1) UNRELEASED; urgency=low + + * New upstream release. + + -- Maarten Lankhorst <maarten.lankho...@canonical.com> Wed, 18 Jul 2012 15:55:15 +0200 + xserver-xorg-video-chips (1:1.2.4-2) unstable; urgency=low * Merge upstream master branch up to 989cf4f1fb to cope with commit 7865afeb0e34856fe60f90066c6f791a3ad58308 Author: Maarten Lankhorst <maarten.lankho...@canonical.com> Date: Wed Jul 18 15:55:06 2012 +0200 Bump changelog diff --git a/ChangeLog b/ChangeLog index a30a8c7..a430a30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,61 @@ +commit bce7917e2ed8f6f4edcea0ff5c06b82eb1e85527 +Author: Dave Airlie <airl...@redhat.com> +Date: Tue Jul 17 16:05:09 2012 +1000 + + xf86-video-chips: bump to version 1.2.5 + + Signed-off-by: Dave Airlie <airl...@redhat.com> + +commit ffbe4a08d0326c6cd37af55233f27ddfa49c427e +Author: Dave Airlie <airl...@redhat.com> +Date: Tue Jul 17 15:24:04 2012 +1000 + + chips: fix make dist. + + Signed-off-by: Dave Airlie <airl...@redhat.com> + +commit b3a693335779ac80d98734b0f4e5e229f878079f +Author: Dave Airlie <airl...@redhat.com> +Date: Mon Jul 16 04:39:40 2012 +0100 + + chips: build without XAA support at all. + + Signed-off-by: Dave Airlie <airl...@redhat.com> + +commit a912214b4739f9c85919178a060ac37563490179 +Author: Dave Airlie <airl...@redhat.com> +Date: Tue Jun 5 19:09:05 2012 +0100 + + chips: drop usage of deprecated xf86PciInfo.h + + Just takes the pci ids chips needs into the driver. + + Signed-off-by: Dave Airlie <airl...@redhat.com> + +commit 93f4ceaa288f639eef26d4c935a278f39b1cbcd6 +Author: Dave Airlie <airl...@redhat.com> +Date: Tue Jun 5 19:05:43 2012 +0100 + + chips: move to new compat API. + + Signed-off-by: Dave Airlie <airl...@redhat.com> + +commit 2d23302d8249c5877a4ab784ba5d60eb0d5a384c +Author: Dave Airlie <airl...@redhat.com> +Date: Tue Jun 5 18:41:10 2012 +0100 + + chips: use new scrn/screen conversion APIs. + + Generated by util/modular/x-driver-screen-scrn-conv.sh + + Signed-off-by: Dave Airlie <airl...@redhat.com> + +commit 846257efe85d86210470164471df5db3384d8da3 +Author: Dave Airlie <airl...@redhat.com> +Date: Tue Jun 5 18:40:48 2012 +0100 + + chips: add compat API header + commit 989cf4f1fb2ac57f38d363734b71a5cf749db146 Author: Adam Jackson <a...@redhat.com> Date: Mon Dec 19 17:45:41 2011 -0500 commit bce7917e2ed8f6f4edcea0ff5c06b82eb1e85527 Author: Dave Airlie <airl...@redhat.com> Date: Tue Jul 17 16:05:09 2012 +1000 xf86-video-chips: bump to version 1.2.5 Signed-off-by: Dave Airlie <airl...@redhat.com> diff --git a/configure.ac b/configure.ac index 2a8207a..14f6c25 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-video-chips], - [1.2.4], + [1.2.5], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xf86-video-chips]) AC_CONFIG_SRCDIR([Makefile.am]) commit ffbe4a08d0326c6cd37af55233f27ddfa49c427e Author: Dave Airlie <airl...@redhat.com> Date: Tue Jul 17 15:24:04 2012 +1000 chips: fix make dist. Signed-off-by: Dave Airlie <airl...@redhat.com> diff --git a/src/Makefile.am b/src/Makefile.am index b7daac0..473df17 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -53,4 +53,4 @@ chips_drv_la_SOURCES = \ ct_regs.c \ ct_shadow.c \ ct_video.c \ - compat_api.h + compat-api.h commit b3a693335779ac80d98734b0f4e5e229f878079f Author: Dave Airlie <airl...@redhat.com> Date: Mon Jul 16 04:39:40 2012 +0100 chips: build without XAA support at all. Signed-off-by: Dave Airlie <airl...@redhat.com> diff --git a/configure.ac b/configure.ac index c0ed508..2a8207a 100644 --- a/configure.ac +++ b/configure.ac @@ -77,6 +77,23 @@ if test "x$XSERVER_LIBPCIACCESS" = xyes; then XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" fi AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes) +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]) save_CFLAGS="$CFLAGS" CFLAGS="$XORG_CFLAGS" diff --git a/src/ct_accel.c b/src/ct_accel.c index e349baf..a829ee3 100644 --- a/src/ct_accel.c +++ b/src/ct_accel.c @@ -71,6 +71,8 @@ #define CTNAME(subname) CATNAME(CHIPS,subname) #endif +#ifdef HAVE_XAA_H + #ifdef DEBUG # define DEBUG_P(x) ErrorF(x"\n"); #elif defined X_DEBUG @@ -166,10 +168,11 @@ static void CTNAME(ReadPixmap)(ScrnInfoPtr pScrn, int x, int y, int w, int h, # define BE_SWAPON(pScrn,cPtr) # define BE_SWAPOFF(pScrn,cPtr) #endif - +#endif Bool CTNAME(AccelInit)(ScreenPtr pScreen) { +#ifdef HAVE_XAA_H XAAInfoRecPtr infoPtr; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); CHIPSPtr cPtr = CHIPSPTR(pScrn); @@ -426,8 +429,12 @@ chips_imagewrite: #endif return(XAAInit(pScreen, infoPtr)); +#else + return FALSE; +#endif } +#ifdef HAVE_XAA_H #ifdef CHIPS_HIQV void CTNAME(DepthChange)(ScrnInfoPtr pScrn, int depth) @@ -459,15 +466,19 @@ CTNAME(DepthChange)(ScrnInfoPtr pScrn, int depth) } #endif +#endif void CTNAME(Sync)(ScrnInfoPtr pScrn) { +#ifdef HAVE_XAA_H CHIPSPtr cPtr = CHIPSPTR(pScrn); DEBUG_P("sync"); ctBLTWAIT; BE_SWAPON(pScrn,cPtr); +#endif } +#ifdef HAVE_XAA_H static void CTNAME(8SetupForSolidFill)(ScrnInfoPtr pScrn, int color, int rop, unsigned int planemask) @@ -1735,3 +1746,5 @@ CTNAME(ReadPixmap)(ScrnInfoPtr pScrn, int x, int y, int w, int h, #endif /* ReadPixmap */ #endif + +#endif diff --git a/src/ct_dga.c b/src/ct_dga.c index b2f8ded..1e1d7b8 100644 --- a/src/ct_dga.c +++ b/src/ct_dga.c @@ -6,8 +6,6 @@ #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Pci.h" -#include "xaa.h" -#include "xaalocal.h" #include "ct_driver.h" #include "dgaproc.h" @@ -17,12 +15,14 @@ static Bool CHIPS_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **, static Bool CHIPS_SetMode(ScrnInfoPtr, DGAModePtr); static int CHIPS_GetViewport(ScrnInfoPtr); static void CHIPS_SetViewport(ScrnInfoPtr, int, int, int); +#ifdef HAVE_XAA_H static void CHIPS_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long); static void CHIPS_BlitRect(ScrnInfoPtr, int, int, int, int, int, int); #if 0 static void CHIPS_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int, unsigned long); #endif +#endif static DGAFunctionRec CHIPS_DGAFuncs = { @@ -31,6 +31,7 @@ DGAFunctionRec CHIPS_DGAFuncs = { CHIPS_SetMode, CHIPS_SetViewport, CHIPS_GetViewport, +#ifdef HAVE_XAA_H CHIPSSync, CHIPS_FillRect, CHIPS_BlitRect, @@ -39,6 +40,9 @@ DGAFunctionRec CHIPS_DGAFuncs = { #else NULL #endif +#else + NULL, NULL, NULL, NULL +#endif }; static @@ -48,6 +52,7 @@ DGAFunctionRec CHIPS_MMIODGAFuncs = { CHIPS_SetMode, CHIPS_SetViewport, CHIPS_GetViewport, +#ifdef HAVE_XAA_H CHIPSMMIOSync, CHIPS_FillRect, CHIPS_BlitRect, @@ -56,6 +61,9 @@ DGAFunctionRec CHIPS_MMIODGAFuncs = { #else NULL #endif +#else + NULL, NULL, NULL, NULL +#endif }; static @@ -65,6 +73,7 @@ DGAFunctionRec CHIPS_HiQVDGAFuncs = { CHIPS_SetMode, CHIPS_SetViewport, CHIPS_GetViewport, +#ifdef HAVE_XAA_H CHIPSHiQVSync, CHIPS_FillRect, CHIPS_BlitRect, @@ -73,6 +82,9 @@ DGAFunctionRec CHIPS_HiQVDGAFuncs = { #else NULL #endif +#else + NULL, NULL, NULL, NULL +#endif }; @@ -114,9 +126,11 @@ SECOND_PASS: currentMode->mode = pMode; currentMode->flags = DGA_CONCURRENT_ACCESS | DGA_PIXMAP_AVAILABLE; +#ifdef HAVE_XAA_H if(cPtr->Flags & ChipsAccelSupport) currentMode->flags |= (cPtr->Flags & ChipsAccelSupport) ? (DGA_FILL_RECT | DGA_BLIT_RECT) : 0; +#endif if(pMode->Flags & V_DBLSCAN) currentMode->flags |= DGA_DOUBLESCAN; if(pMode->Flags & V_INTERLACE) @@ -246,6 +260,7 @@ CHIPS_SetViewport( cPtr->DGAViewportStatus = 0; /* CHIPSAdjustFrame loops until finished */ } +#ifdef HAVE_XAA_H static void CHIPS_FillRect ( ScrnInfoPtr pScrn, @@ -295,7 +310,7 @@ CHIPS_BlitTransRect( prohibit usage of ~0 as the key */ } #endif - +#endif static Bool CHIPS_OpenFramebuffer( ScrnInfoPtr pScrn, diff --git a/src/ct_driver.c b/src/ct_driver.c index 01cff63..6f3a5d4 100644 --- a/src/ct_driver.c +++ b/src/ct_driver.c @@ -130,6 +130,7 @@ #include "dixstruct.h" +#include "xf86fbman.h" /* Driver specific headers */ #include "ct_driver.h" @@ -4515,8 +4516,10 @@ CHIPSCloseScreen(CLOSE_SCREEN_ARGS_DECL) cPtrEnt = pPriv->ptr; cPtrEnt->refCount--; } +#ifdef HAVE_XAA_H if (cPtr->AccelInfoRec) XAADestroyInfoRec(cPtr->AccelInfoRec); +#endif if (cPtr->CursorInfoRec) xf86DestroyCursorInfoRec(cPtr->CursorInfoRec); free(cPtr->ShadowPtr); diff --git a/src/ct_driver.h b/src/ct_driver.h index cbb7da3..d90a67f 100644 --- a/src/ct_driver.h +++ b/src/ct_driver.h @@ -27,9 +27,11 @@ #define _CT_DRIVER_H_ #include "ct_pcirename.h" +#ifdef HAVE_XAA_H #include "xaa.h" -#include "vbe.h" #include "xaalocal.h" /* XAA internals as we replace some of XAA */ +#endif +#include "vbe.h" #include "xf86Cursor.h" #include "xf86i2c.h" #include "xf86DDC.h" @@ -324,7 +326,9 @@ typedef struct _CHIPSRec { unsigned int * Regs32; unsigned int Flags; CARD32 Bus; +#ifdef HAVE_XAA_H XAAInfoRecPtr AccelInfoRec; +#endif xf86CursorInfoPtr CursorInfoRec; CHIPSACLRec Accel; unsigned int HWCursorContents; diff --git a/src/ct_video.c b/src/ct_video.c index 248d2cf..35dad9f 100644 --- a/src/ct_video.c +++ b/src/ct_video.c @@ -12,8 +12,6 @@ #include "ct_driver.h" #include <X11/extensions/Xv.h> -#include "xaa.h" -#include "xaalocal.h" #include "dixstruct.h" #include "fourcc.h" commit a912214b4739f9c85919178a060ac37563490179 Author: Dave Airlie <airl...@redhat.com> Date: Tue Jun 5 19:09:05 2012 +0100 chips: drop usage of deprecated xf86PciInfo.h Just takes the pci ids chips needs into the driver. Signed-off-by: Dave Airlie <airl...@redhat.com> diff --git a/src/ct_accel.c b/src/ct_accel.c index c369362..e349baf 100644 --- a/src/ct_accel.c +++ b/src/ct_accel.c @@ -46,9 +46,6 @@ /* Drivers that need to access the PCI config space directly need this */ #include "xf86Pci.h" -/* Drivers for PCI hardware need this */ -#include "xf86PciInfo.h" - /* Drivers that use XAA need this */ #include "xf86fbman.h" diff --git a/src/ct_bank.c b/src/ct_bank.c index 3bd9c5d..0264616 100644 --- a/src/ct_bank.c +++ b/src/ct_bank.c @@ -47,9 +47,6 @@ /* Everything using inb/outb, etc needs "compiler.h" */ #include "compiler.h" -/* 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/ct_cursor.c b/src/ct_cursor.c index 6f5ebf0..2bf04f2 100644 --- a/src/ct_cursor.c +++ b/src/ct_cursor.c @@ -36,9 +36,6 @@ /* Everything using inb/outb, etc needs "compiler.h" */ #include "compiler.h" -/* 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/ct_ddc.c b/src/ct_ddc.c index 9f64826..5e2346a 100644 --- a/src/ct_ddc.c +++ b/src/ct_ddc.c @@ -10,9 +10,6 @@ /* Everything using inb/outb, etc needs "compiler.h" */ #include "compiler.h" -/* 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/ct_dga.c b/src/ct_dga.c index bed4df0..b2f8ded 100644 --- a/src/ct_dga.c +++ b/src/ct_dga.c @@ -6,7 +6,6 @@ #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Pci.h" -#include "xf86PciInfo.h" #include "xaa.h" #include "xaalocal.h" #include "ct_driver.h" diff --git a/src/ct_driver.c b/src/ct_driver.c index c0c3bce..01cff63 100644 --- a/src/ct_driver.c +++ b/src/ct_driver.c @@ -79,9 +79,6 @@ /* Everything using inb/outb, etc needs "compiler.h" */ #include "compiler.h" -/* Drivers for PCI hardware need this */ -#include "xf86PciInfo.h" - /* Drivers that need to access the PCI config space directly need this */ #include "xf86Pci.h" @@ -480,6 +477,19 @@ static DisplayModeRec ChipsNTSCMode = { #ifdef XSERVER_LIBPCIACCESS +#ifndef _XF86_PCIINFO_H +#define PCI_VENDOR_CHIPSTECH 0x102C +/* Chips & Tech */ +#define PCI_CHIP_65545 0x00D8 +#define PCI_CHIP_65548 0x00DC +#define PCI_CHIP_65550 0x00E0 +#define PCI_CHIP_65554 0x00E4 +#define PCI_CHIP_65555 0x00E5 +#define PCI_CHIP_68554 0x00F4 +#define PCI_CHIP_69000 0x00C0 +#define PCI_CHIP_69030 0x0C30 +#endif + #define CHIPS_DEVICE_MATCH(d, i) \ { PCI_VENDOR_CHIPSTECH, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) } diff --git a/src/ct_regs.c b/src/ct_regs.c index e9a4c20..4446b33 100644 --- a/src/ct_regs.c +++ b/src/ct_regs.c @@ -58,9 +58,6 @@ /* Everything using inb/outb, etc needs "compiler.h" */ #include "compiler.h" -/* 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/ct_shadow.c b/src/ct_shadow.c index ad089d9..66b0ba7 100644 --- a/src/ct_shadow.c +++ b/src/ct_shadow.c @@ -5,7 +5,6 @@ #include "xf86.h" #include "xf86_OSproc.h" -#include "xf86PciInfo.h" #include "xf86Pci.h" #include "shadowfb.h" #include "servermd.h" diff --git a/src/ct_video.c b/src/ct_video.c index 61a90ef..248d2cf 100644 --- a/src/ct_video.c +++ b/src/ct_video.c @@ -6,7 +6,6 @@ #include "xf86.h" #include "xf86_OSproc.h" #include "compiler.h" -#include "xf86PciInfo.h" #include "xf86Pci.h" #include "xf86fbman.h" #include "regionstr.h" commit 93f4ceaa288f639eef26d4c935a278f39b1cbcd6 Author: Dave Airlie <airl...@redhat.com> Date: Tue Jun 5 19:05:43 2012 +0100 chips: move to new compat API. Signed-off-by: Dave Airlie <airl...@redhat.com> diff --git a/src/compat-api.h b/src/compat-api.h index 1bb7724..6bc946f 100644 --- a/src/compat-api.h +++ b/src/compat-api.h @@ -38,4 +38,62 @@ #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/ct_ddc.c b/src/ct_ddc.c index ab02d47..9f64826 100644 --- a/src/ct_ddc.c +++ b/src/ct_ddc.c @@ -96,7 +96,7 @@ chips_ddc1(ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "DDC1 found\n"); else return; - xf86PrintEDID(xf86DoEDID_DDC1(pScrn->scrnIndex, vgaHWddc1SetSpeedWeak(), + xf86PrintEDID(xf86DoEDID_DDC1(XF86_SCRN_ARG(pScrn), vgaHWddc1SetSpeedWeak(), chips_ddc1Read)); /* restore */ diff --git a/src/ct_dga.c b/src/ct_dga.c index 47a0871..bed4df0 100644 --- a/src/ct_dga.c +++ b/src/ct_dga.c @@ -198,21 +198,21 @@ CHIPS_SetMode( /* put the ScreenParameters back */ if (cPtr->DGAactive) { pScrn->displayWidth = OldDisplayWidth[index]; - pScrn->EnterVT(pScrn->scrnIndex,0); + pScrn->EnterVT(VT_FUNC_ARGS); cPtr->DGAactive = FALSE; } } else { if(!cPtr->DGAactive) { /* save the old parameters */ OldDisplayWidth[index] = pScrn->displayWidth; - pScrn->LeaveVT(pScrn->scrnIndex,0); + pScrn->LeaveVT(VT_FUNC_ARGS); cPtr->DGAactive = TRUE; } pScrn->displayWidth = pMode->bytesPerScanline / (pMode->bitsPerPixel >> 3); - CHIPSSwitchMode(index, pMode->mode, 0); + CHIPSSwitchMode(SWITCH_MODE_ARGS(pScrn, pMode->mode)); } return TRUE; @@ -243,7 +243,7 @@ CHIPS_SetViewport( while (!((hwp->readST01(hwp)) & 0x08)){}; } - CHIPSAdjustFrame(pScrn->pScreen->myNum, x, y, flags); + CHIPSAdjustFrame(ADJUST_FRAME_ARGS(pScrn, x, y)); cPtr->DGAViewportStatus = 0; /* CHIPSAdjustFrame loops until finished */ } diff --git a/src/ct_driver.c b/src/ct_driver.c index af80221..c0c3bce 100644 --- a/src/ct_driver.c +++ b/src/ct_driver.c @@ -146,13 +146,12 @@ static Bool CHIPSPciProbe(DriverPtr drv, int entity_num, static Bool CHIPSProbe(DriverPtr drv, int flags); #endif static Bool CHIPSPreInit(ScrnInfoPtr pScrn, int flags); -static Bool CHIPSScreenInit(int Index, ScreenPtr pScreen, int argc, - char **argv); -static Bool CHIPSEnterVT(int scrnIndex, int flags); -static void CHIPSLeaveVT(int scrnIndex, int flags); -static Bool CHIPSCloseScreen(int scrnIndex, ScreenPtr pScreen); -static void CHIPSFreeScreen(int scrnIndex, int flags); -static ModeStatus CHIPSValidMode(int scrnIndex, DisplayModePtr mode, +static Bool CHIPSScreenInit(SCREEN_INIT_ARGS_DECL); +static Bool CHIPSEnterVT(VT_FUNC_ARGS_DECL); +static void CHIPSLeaveVT(VT_FUNC_ARGS_DECL); +static Bool CHIPSCloseScreen(CLOSE_SCREEN_ARGS_DECL); +static void CHIPSFreeScreen(FREE_SCREEN_ARGS_DECL); +static ModeStatus CHIPSValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags); static Bool CHIPSSaveScreen(ScreenPtr pScreen, int mode); @@ -202,7 +201,7 @@ static void chipsLoadPalette(ScrnInfoPtr pScrn, int numColors, static void chipsLoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, VisualPtr pVisual); static void chipsSetPanelType(CHIPSPtr cPtr); -static void chipsBlockHandler(int, pointer, pointer, pointer); +static void chipsBlockHandler(BLOCKHANDLER_ARGS_DECL); /* * This is intentionally screen-independent. It indicates the binding @@ -1918,7 +1917,7 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) if (!ddc_done) if (xf86LoadSubModule(pScrn, "i2c")) { if (chips_i2cInit(pScrn)) { - if ((pMon = xf86PrintEDID(xf86DoEDID_DDC2(pScrn->scrnIndex, + if ((pMon = xf86PrintEDID(xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn), cPtr->I2C))) != NULL) ddc_done = TRUE; xf86SetDDCproperties(pScrn,pMon); @@ -3675,9 +3674,9 @@ chipsPreInit655xx(ScrnInfoPtr pScrn, int flags) /* Mandatory */ static Bool -CHIPSEnterVT(int scrnIndex, int flags) +CHIPSEnterVT(VT_FUNC_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + SCRN_INFO_PTR(arg); CHIPSPtr cPtr = CHIPSPTR(pScrn); CHIPSEntPtr cPtrEnt; @@ -3697,16 +3696,16 @@ CHIPSEnterVT(int scrnIndex, int flags) chipsHWCursorOn(cPtr, pScrn); /* cursor settle delay */ usleep(50000); - CHIPSAdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + CHIPSAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); usleep(50000); return TRUE; } /* Mandatory */ static void -CHIPSLeaveVT(int scrnIndex, int flags) +CHIPSLeaveVT(VT_FUNC_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + SCRN_INFO_PTR(arg); CHIPSPtr cPtr = CHIPSPTR(pScrn); CHIPSACLPtr cAcl = CHIPSACLPTR(pScrn); CHIPSEntPtr cPtrEnt; @@ -3848,7 +3847,7 @@ chipsLoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices, /* Mandatory */ static Bool -CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) +CHIPSScreenInit(SCREEN_INIT_ARGS_DECL) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); vgaHWPtr hwp; @@ -3938,7 +3937,7 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (!chipsModeInit(pScrn,pScrn->currentMode)) return FALSE; CHIPSSaveScreen(pScreen,SCREEN_SAVER_ON); - CHIPSAdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + CHIPSAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); /* * The next step is to setup the screen's visuals, and initialise the @@ -4162,7 +4161,7 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) } else currentaddr = allocatebase; if (serverGeneration == 1) - xf86DrvMsg(scrnIndex, X_PROBED, + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "%d bytes off-screen memory available\n", freespace); /* @@ -4187,7 +4186,7 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) cAcl->CursorAddress = currentaddr; } if (cAcl->CursorAddress == -1) - xf86DrvMsg(scrnIndex, X_ERROR, + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Too little space for H/W cursor.\n"); } @@ -4247,7 +4246,7 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) cAcl->CacheEnd = currentaddr; if (cAcl->CacheStart >= cAcl->CacheEnd) { - xf86DrvMsg(scrnIndex, X_ERROR, + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Too little space for pixmap cache.\n"); cAcl->CacheStart = 0; cAcl->CacheEnd = 0; @@ -4298,7 +4297,7 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if ((cAcl->UseHWCursor) && (cAcl->CursorAddress != -1)) { /* HW cursor functions */ if (!CHIPSCursorInit(pScreen)) { - xf86DrvMsg(scrnIndex, X_ERROR, + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Hardware cursor initialization failed\n"); return FALSE; } @@ -4371,9 +4370,9 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Mandatory */ Bool -CHIPSSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) +CHIPSSwitchMode(SWITCH_MODE_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + SCRN_INFO_PTR(arg); CHIPSPtr cPtr = CHIPSPTR(pScrn); CHIPSEntPtr cPtrEnt; @@ -4386,14 +4385,14 @@ CHIPSSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) DUALREOPEN; } - return chipsModeInit(xf86Screens[scrnIndex], mode); + return chipsModeInit(pScrn, mode); } /* Mandatory */ void -CHIPSAdjustFrame(int scrnIndex, int x, int y, int flags) +CHIPSAdjustFrame(ADJUST_FRAME_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + SCRN_INFO_PTR(arg); CHIPSPtr cPtr = CHIPSPTR(pScrn); CHIPSEntPtr cPtrEnt; @@ -4478,9 +4477,9 @@ CHIPSAdjustFrame(int scrnIndex, int x, int y, int flags) /* Mandatory */ static Bool -CHIPSCloseScreen(int scrnIndex, ScreenPtr pScreen) +CHIPSCloseScreen(CLOSE_SCREEN_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); CHIPSPtr cPtr = CHIPSPTR(pScrn); CHIPSEntPtr cPtrEnt; @@ -4518,23 +4517,24 @@ CHIPSCloseScreen(int scrnIndex, ScreenPtr pScreen) pScreen->CloseScreen = cPtr->CloseScreen; /*§§§*/ xf86ClearPrimInitDone(pScrn->entityList[0]); - return (*pScreen->CloseScreen)(scrnIndex, pScreen);/*§§§*/ + return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);/*§§§*/ } /* Optional */ static void -CHIPSFreeScreen(int scrnIndex, int flags) +CHIPSFreeScreen(FREE_SCREEN_ARGS_DECL) { + SCRN_INFO_PTR(arg); if (xf86LoaderCheckSymbol("vgaHWFreeHWRec")) - vgaHWFreeHWRec(xf86Screens[scrnIndex]); - CHIPSFreeRec(xf86Screens[scrnIndex]); + vgaHWFreeHWRec(pScrn); -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1vijj9-0006gh...@vasks.debian.org