xserver-xorg-video-chips: Changes to 'debian-experimental'
ChangeLog | 246 ++++++++++++
configure.ac | 19
debian/README.source | 24 -
debian/changelog | 35 +
debian/compat | 2
debian/control | 22 -
debian/rules | 104 -----
debian/watch | 1
debian/xserver-xorg-video-chips.install | 1
debian/xserver-xorg-video-chips.manpages | 1
debian/xsfbs/repack.sh | 32 -
debian/xsfbs/xsfbs.mk | 285 --------------
debian/xsfbs/xsfbs.sh | 622 -------------------------------
man/chips.man | 4
src/Makefile.am | 3
src/compat-api.h | 99 ++++
src/ct_accel.c | 68 +--
src/ct_bank.c | 61 +--
src/ct_cursor.c | 7
src/ct_ddc.c | 9
src/ct_dga.c | 42 +-
src/ct_driver.c | 383 +++++--------------
src/ct_driver.h | 23 -
src/ct_regs.c | 3
src/ct_shadow.c | 7
src/ct_video.c | 43 --
util/dRegs.c | 57 --
util/iopl.h | 60 ++
util/mRegs.c | 57 --
util/modClock.c | 53 --
30 files changed, 714 insertions(+), 1659 deletions(-)
New commits:
commit 27e2c6f9ac107882d7844f5e53d499865e721ded
Author: Maarten Lankhorst <maarten.lankhorst@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.lankhorst@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.lankhorst@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.lankhorst@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.lankhorst@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 <airlied@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 <airlied@redhat.com>
+
+commit ffbe4a08d0326c6cd37af55233f27ddfa49c427e
+Author: Dave Airlie <airlied@redhat.com>
+Date: Tue Jul 17 15:24:04 2012 +1000
+
+ chips: fix make dist.
+
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit b3a693335779ac80d98734b0f4e5e229f878079f
+Author: Dave Airlie <airlied@redhat.com>
+Date: Mon Jul 16 04:39:40 2012 +0100
+
+ chips: build without XAA support at all.
+
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit a912214b4739f9c85919178a060ac37563490179
+Author: Dave Airlie <airlied@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 <airlied@redhat.com>
+
+commit 93f4ceaa288f639eef26d4c935a278f39b1cbcd6
+Author: Dave Airlie <airlied@redhat.com>
+Date: Tue Jun 5 19:05:43 2012 +0100
+
+ chips: move to new compat API.
+
+ Signed-off-by: Dave Airlie <airlied@redhat.com>
+
+commit 2d23302d8249c5877a4ab784ba5d60eb0d5a384c
+Author: Dave Airlie <airlied@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 <airlied@redhat.com>
+
+commit 846257efe85d86210470164471df5db3384d8da3
+Author: Dave Airlie <airlied@redhat.com>
+Date: Tue Jun 5 18:40:48 2012 +0100
+
+ chips: add compat API header
+
commit 989cf4f1fb2ac57f38d363734b71a5cf749db146
Author: Adam Jackson <ajax@redhat.com>
Date: Mon Dec 19 17:45:41 2011 -0500
commit bce7917e2ed8f6f4edcea0ff5c06b82eb1e85527
Author: Dave Airlie <airlied@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 <airlied@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 <airlied@redhat.com>
Date: Tue Jul 17 15:24:04 2012 +1000
chips: fix make dist.
Signed-off-by: Dave Airlie <airlied@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 <airlied@redhat.com>
Date: Mon Jul 16 04:39:40 2012 +0100
chips: build without XAA support at all.
Signed-off-by: Dave Airlie <airlied@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 <airlied@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 <airlied@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 <airlied@redhat.com>
Date: Tue Jun 5 19:05:43 2012 +0100
chips: move to new compat API.
Signed-off-by: Dave Airlie <airlied@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);
+ CHIPSFreeRec(pScrn);
}
/* Optional */
static ModeStatus
-CHIPSValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
+CHIPSValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
CHIPSPtr cPtr = CHIPSPTR(pScrn);
/* The tests here need to be expanded */
@@ -7477,18 +7477,14 @@ chipsSetPanelType(CHIPSPtr cPtr)
}
static void
-chipsBlockHandler (
- int i,
- pointer blockData,
- pointer pTimeout,
- pointer pReadmask
-){
- ScreenPtr pScreen = screenInfo.screens[i];
- ScrnInfoPtr pScrn = xf86Screens[i];
+chipsBlockHandler (BLOCKHANDLER_ARGS_DECL)
+{
+ SCREEN_PTR(arg);
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
CHIPSPtr cPtr = CHIPSPTR(pScrn);
pScreen->BlockHandler = cPtr->BlockHandler;
- (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+ (*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
pScreen->BlockHandler = chipsBlockHandler;
if(cPtr->VideoTimerCallback) {
diff --git a/src/ct_driver.h b/src/ct_driver.h
index f07555a..cbb7da3 100644
--- a/src/ct_driver.h
+++ b/src/ct_driver.h
@@ -291,7 +291,7 @@ typedef struct _CHIPSRec {
unsigned char * ShadowPtr;
int ShadowPitch;
int Rotate;
- void (*PointerMoved)(int index, int x, int y);
+ void (*PointerMoved)(SCRN_ARG_TYPE arg, int x, int y);
int FbOffset16;
int FbSize16;
OptionInfoPtr Options;
@@ -384,8 +384,8 @@ extern unsigned int ChipsReg32HiQV[];
/* Prototypes */
-void CHIPSAdjustFrame(int scrnIndex, int x, int y, int flags);
-Bool CHIPSSwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
+void CHIPSAdjustFrame(ADJUST_FRAME_ARGS_DECL);
+Bool CHIPSSwitchMode(SWITCH_MODE_ARGS_DECL);
Reply to: