summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Weigelt, metux IT consult <info@metux.net>2024-05-14 13:36:52 +0200
committerEnrico Weigelt, metux IT consult <info@metux.net>2024-05-23 18:37:02 +0200
commit15d68316524c593bd67a6ea59b5c746a94c6c1f6 (patch)
treea2067abda15da990664915ca333ed047448cd0da
parentf6ed544a2c98bd4e3b086ce456d90204194d128b (diff)
drop compat to pre-1.18 xorg-server versionsHEADmaster
Since we're now relying on >= 1.18, we can drop lots of old compat stuff. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-cirrus/-/merge_requests/8>
-rw-r--r--src/Makefile.am1
-rw-r--r--src/alp_driver.c43
-rw-r--r--src/cir.h5
-rw-r--r--src/cir_dga.c2
-rw-r--r--src/cir_pcirename.h25
-rw-r--r--src/cir_shadow.c5
-rw-r--r--src/compat-api.h99
-rw-r--r--src/lg_driver.c45
8 files changed, 43 insertions, 182 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 82e8530..ad444f8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -35,7 +35,6 @@ cirrus_drv_la_SOURCES = \
CirrusClk.c \
cir_shadow.c \
cir_pcirename.h \
- compat-api.h \
alp_driver.c \
alp.h \
alp_hwcurs.c \
diff --git a/src/alp_driver.c b/src/alp_driver.c
index eedabe5..5c355ff 100644
--- a/src/alp_driver.c
+++ b/src/alp_driver.c
@@ -70,20 +70,20 @@ static void AlpProbeI2C(int scrnIndex);
/* Mandatory functions */
Bool AlpPreInit(ScrnInfoPtr pScrn, int flags);
-Bool AlpScreenInit(SCREEN_INIT_ARGS_DECL);
-Bool AlpEnterVT(VT_FUNC_ARGS_DECL);
-void AlpLeaveVT(VT_FUNC_ARGS_DECL);
-static Bool AlpCloseScreen(CLOSE_SCREEN_ARGS_DECL);
+Bool AlpScreenInit(ScreenPtr pScreen, int argc, char **argv);
+Bool AlpEnterVT(ScrnInfoPtr arg);
+void AlpLeaveVT(ScrnInfoPtr arg);
+static Bool AlpCloseScreen(ScreenPtr pScreen);
static Bool AlpSaveScreen(ScreenPtr pScreen, int mode);
/* Required if the driver supports mode switching */
-Bool AlpSwitchMode(SWITCH_MODE_ARGS_DECL);
+Bool AlpSwitchMode(ScrnInfoPtr arg, DisplayModePtr mode);
/* Required if the driver supports moving the viewport */
-void AlpAdjustFrame(ADJUST_FRAME_ARGS_DECL);
+void AlpAdjustFrame(ScrnInfoPtr arg, int x, int y);
/* Optional functions */
-void AlpFreeScreen(FREE_SCREEN_ARGS_DECL);
-ModeStatus AlpValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode,
+void AlpFreeScreen(ScrnInfoPtr arg);
+ModeStatus AlpValidMode(ScrnInfoPtr arg, DisplayModePtr mode,
Bool verbose, int flags);
/* Internally used functions */
static void AlpSave(ScrnInfoPtr pScrn);
@@ -737,7 +737,7 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags)
}
else
xf86SetDDCproperties(pScrn,xf86PrintEDID(
- xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn),pCir->I2CPtr1)));
+ xf86DoEDID_DDC2(pScrn,pCir->I2CPtr1)));
#ifdef XSERVER_LIBPCIACCESS
#ifndef PCI_CHIP_QEMU
@@ -1393,7 +1393,7 @@ AlpRestore(ScrnInfoPtr pScrn)
/* This gets called at the start of each server generation */
Bool
-AlpScreenInit(SCREEN_INIT_ARGS_DECL)
+AlpScreenInit(ScreenPtr pScreen, int argc, char **argv)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
vgaHWPtr hwp;
@@ -1444,7 +1444,7 @@ AlpScreenInit(SCREEN_INIT_ARGS_DECL)
AlpSaveScreen(pScreen, SCREEN_SAVER_ON);
/* Set the viewport */
- AlpAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0));
+ AlpAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0);
/*
* The next step is to setup the screen's visuals, and initialise the
@@ -1658,9 +1658,8 @@ AlpScreenInit(SCREEN_INIT_ARGS_DECL)
/* Usually mandatory */
Bool
-AlpSwitchMode(SWITCH_MODE_ARGS_DECL)
+AlpSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
{
- SCRN_INFO_PTR(arg);
return AlpModeInit(pScrn, mode);
}
@@ -1671,9 +1670,8 @@ AlpSwitchMode(SWITCH_MODE_ARGS_DECL)
*/
/* Usually mandatory */
void
-AlpAdjustFrame(ADJUST_FRAME_ARGS_DECL)
+AlpAdjustFrame(ScrnInfoPtr pScrn, int x, int y)
{
- SCRN_INFO_PTR(arg);
int Base, tmp;
vgaHWPtr hwp;
@@ -1714,9 +1712,8 @@ AlpAdjustFrame(ADJUST_FRAME_ARGS_DECL)
/* Mandatory */
Bool
-AlpEnterVT(VT_FUNC_ARGS_DECL)
+AlpEnterVT(ScrnInfoPtr pScrn)
{
- SCRN_INFO_PTR(arg);
CirPtr pCir = CIRPTR(pScrn);
Bool ret;
@@ -1744,9 +1741,8 @@ AlpEnterVT(VT_FUNC_ARGS_DECL)
/* Mandatory */
void
-AlpLeaveVT(VT_FUNC_ARGS_DECL)
+AlpLeaveVT(ScrnInfoPtr pScrn)
{
- SCRN_INFO_PTR(arg);
vgaHWPtr hwp = VGAHWPTR(pScrn);
#ifdef ALP_DEBUG
ErrorF("AlpLeaveVT\n");
@@ -1766,7 +1762,7 @@ AlpLeaveVT(VT_FUNC_ARGS_DECL)
/* Mandatory */
static Bool
-AlpCloseScreen(CLOSE_SCREEN_ARGS_DECL)
+AlpCloseScreen(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
vgaHWPtr hwp = VGAHWPTR(pScrn);
@@ -1789,7 +1785,7 @@ AlpCloseScreen(CLOSE_SCREEN_ARGS_DECL)
pScrn->vtSema = FALSE;
pScreen->CloseScreen = pCir->CloseScreen;
- return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
+ return (*pScreen->CloseScreen)(pScreen);
}
@@ -1797,9 +1793,8 @@ AlpCloseScreen(CLOSE_SCREEN_ARGS_DECL)
/* Optional */
void
-AlpFreeScreen(FREE_SCREEN_ARGS_DECL)
+AlpFreeScreen(ScrnInfoPtr pScrn)
{
- SCRN_INFO_PTR(arg);
#ifdef ALP_DEBUG
ErrorF("AlpFreeScreen\n");
#endif
@@ -1817,7 +1812,7 @@ AlpFreeScreen(FREE_SCREEN_ARGS_DECL)
/* Optional */
ModeStatus
-AlpValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags)
+AlpValidMode(ScrnInfoPtr arg, DisplayModePtr mode, Bool verbose, int flags)
{
int lace;
diff --git a/src/cir.h b/src/cir.h
index 1d1affa..9691db1 100644
--- a/src/cir.h
+++ b/src/cir.h
@@ -8,7 +8,6 @@
#include <string.h>
#include <stdlib.h>
-#include "compat-api.h"
#include "cir_pcirename.h"
/* Card-specific driver information */
@@ -60,7 +59,7 @@ typedef struct {
int rotate;
int ShadowPitch;
unsigned char * ShadowPtr;
- void (*PointerMoved)(SCRN_ARG_TYPE arg, int x, int y);
+ void (*PointerMoved)(ScrnInfoPtr arg, int x, int y);
int pitch;
unsigned char ** ScanlineColorExpandBuffers;
@@ -86,7 +85,7 @@ extern void cirProbeDDC(ScrnInfoPtr pScrn, int index);
extern Bool CirDGAInit(ScreenPtr pScreen);
/* in cir_shadow.c */
-void cirPointerMoved(SCRN_ARG_TYPE arg, int x, int y);
+void cirPointerMoved(ScrnInfoPtr arg, int x, int y);
void cirRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
void cirRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
void cirRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
diff --git a/src/cir_dga.c b/src/cir_dga.c
index 92d32da..6a50e71 100644
--- a/src/cir_dga.c
+++ b/src/cir_dga.c
@@ -179,7 +179,7 @@ Cir_SetViewport(
CirPtr pCir = CIRPTR(pScrn);
vgaHWPtr hwp = VGAHWPTR(pScrn);
- pScrn->AdjustFrame(ADJUST_FRAME_ARGS(pScrn, x, y));
+ pScrn->AdjustFrame(pScrn, x, y);
while((hwp->readST01(hwp) & 0x08));
while(!(hwp->readST01(hwp) & 0x08));
diff --git a/src/cir_pcirename.h b/src/cir_pcirename.h
index c1fb249..5c47f99 100644
--- a/src/cir_pcirename.h
+++ b/src/cir_pcirename.h
@@ -36,31 +36,6 @@ enum region_type {
#include "xf86Module.h"
-#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 12
-
-#if (defined(__alpha__) || defined(__ia64__)) && defined (linux)
-#define PCI_DOM_MASK 0x01fful
-#else
-#define PCI_DOM_MASK 0x0ffu
-#endif
-
-#ifndef PCI_DOM_MASK
-# define PCI_DOM_MASK 0x0ffu
-#endif
-#define PCI_DOMBUS_MASK (((PCI_DOM_MASK) << 8) | 0x0ffu)
-
-static inline uint32_t
-pciTag(int busnum, int devnum, int funcnum)
-{
- uint32_t tag;
- tag = (busnum & (PCI_DOMBUS_MASK)) << 16;
- tag |= (devnum & 0x00001fu) << 11;
- tag |= (funcnum & 0x000007u) << 8;
-
- return tag;
-}
-#endif /* GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 12 */
-
#ifndef XSERVER_LIBPCIACCESS
/* pciVideoPtr */
diff --git a/src/cir_shadow.c b/src/cir_shadow.c
index 7345924..377c9fb 100644
--- a/src/cir_shadow.c
+++ b/src/cir_shadow.c
@@ -53,9 +53,8 @@ cirRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
}
_X_EXPORT void
-cirPointerMoved(SCRN_ARG_TYPE arg, int x, int y)
+cirPointerMoved(ScrnInfoPtr pScrn, int x, int y)
{
- SCRN_INFO_PTR(arg);
CirPtr pCir = CIRPTR(pScrn);
int newX, newY;
@@ -67,7 +66,7 @@ cirPointerMoved(SCRN_ARG_TYPE arg, int x, int y)
newY = pScrn->pScreen->width - x - 1;
}
- (*pCir->PointerMoved)(arg, newX, newY);
+ (*pCir->PointerMoved)(pScrn, newX, newY);
}
_X_EXPORT void
diff --git a/src/compat-api.h b/src/compat-api.h
deleted file mode 100644
index 205ac59..0000000
--- a/src/compat-api.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * 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 <airlied@redhat.com>
- */
-
-/* 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 scrnIndex, 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/lg_driver.c b/src/lg_driver.c
index 5ecdbd7..e840b76 100644
--- a/src/lg_driver.c
+++ b/src/lg_driver.c
@@ -84,26 +84,26 @@
* Mandatory functions
*/
Bool LgPreInit(ScrnInfoPtr pScrn, int flags);
-Bool LgScreenInit(SCREEN_INIT_ARGS_DECL);
-Bool LgEnterVT(VT_FUNC_ARGS_DECL);
-void LgLeaveVT(VT_FUNC_ARGS_DECL);
-static Bool LgCloseScreen(CLOSE_SCREEN_ARGS_DECL);
+Bool LgScreenInit(ScreenPtr pScreen, int argc, char **argv);
+Bool LgEnterVT(ScrnInfoPtr arg);
+void LgLeaveVT(ScrnInfoPtr arg);
+static Bool LgCloseScreen(ScreenPtr pScreen);
static Bool LgSaveScreen(ScreenPtr pScreen, Bool mode);
/*
* Required if the driver supports mode switching.
*/
-Bool LgSwitchMode(SWITCH_MODE_ARGS_DECL);
+Bool LgSwitchMode(ScrnInfoPtr arg, DisplayModePtr mode);
/*
* Required if the driver supports moving the viewport.
*/
-void LgAdjustFrame(ADJUST_FRAME_ARGS_DECL);
+void LgAdjustFrame(ScrnInfoPtr arg, int x, int y);
/*
* Optional functions
*/
-void LgFreeScreen(FREE_SCREEN_ARGS_DECL);
-ModeStatus LgValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode,
+void LgFreeScreen(ScrnInfoPtr arg);
+ModeStatus LgValidMode(ScrnInfoPtr arg, DisplayModePtr mode,
Bool verbose, int flags);
/*
@@ -353,7 +353,7 @@ LgDoDDC(ScrnInfoPtr pScrn)
/*
* Read and output monitor info using DDC2 over I2C bus.
*/
- MonInfo = xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn), pCir->I2CPtr1);
+ MonInfo = xf86DoEDID_DDC2(pScrn, pCir->I2CPtr1);
if (!MonInfo) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Failed to obtain EDID.\n");
@@ -1571,7 +1571,7 @@ LgRestore(ScrnInfoPtr pScrn)
* Mandatory
*/
Bool
-LgScreenInit(SCREEN_INIT_ARGS_DECL)
+LgScreenInit(ScreenPtr pScreen, int argc, char **argv)
{
/*
* The vgaHW references will disappear one day
@@ -1632,9 +1632,7 @@ LgScreenInit(SCREEN_INIT_ARGS_DECL)
/*
* Set the viewport.
*/
- LgAdjustFrame(ADJUST_FRAME_ARGS(pScrn,
- pScrn->frameX0,
- pScrn->frameY0));
+ LgAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0);
/*
* The next step is to setup the screen's visuals, and initialise
@@ -1807,9 +1805,8 @@ LgScreenInit(SCREEN_INIT_ARGS_DECL)
* Usually mandatory
*/
Bool
-LgSwitchMode(SWITCH_MODE_ARGS_DECL)
+LgSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
{
- SCRN_INFO_PTR(arg);
return LgModeInit(pScrn, mode);
}
@@ -1823,8 +1820,7 @@ LgSwitchMode(SWITCH_MODE_ARGS_DECL)
/*
* Usually mandatory
*/
-void LgAdjustFrame(ADJUST_FRAME_ARGS_DECL) {
- SCRN_INFO_PTR(arg);
+void LgAdjustFrame(ScrnInfoPtr pScrn, int x, int y) {
int Base, tmp;
CirPtr pCir = CIRPTR(pScrn);
vgaHWPtr hwp = VGAHWPTR(pScrn);
@@ -1933,9 +1929,8 @@ void LgAdjustFrame(ADJUST_FRAME_ARGS_DECL) {
* Mandatory
*/
Bool
-LgEnterVT(VT_FUNC_ARGS_DECL)
+LgEnterVT(ScrnInfoPtr pScrn)
{
- SCRN_INFO_PTR(arg);
CirPtr pCir = CIRPTR(pScrn);
#ifdef LG_DEBUG
ErrorF("LgEnterVT\n");
@@ -1964,8 +1959,7 @@ LgEnterVT(VT_FUNC_ARGS_DECL)
/*
* Mandatory
*/
-void LgLeaveVT(VT_FUNC_ARGS_DECL) {
- SCRN_INFO_PTR(arg);
+void LgLeaveVT(ScrnInfoPtr pScrn) {
vgaHWPtr hwp = VGAHWPTR(pScrn);
CirPtr pCir = CIRPTR(pScrn);
#ifdef LG_DEBUG
@@ -1996,7 +1990,7 @@ void LgLeaveVT(VT_FUNC_ARGS_DECL) {
* Mandatory
*/
static Bool
-LgCloseScreen(CLOSE_SCREEN_ARGS_DECL)
+LgCloseScreen(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
vgaHWPtr hwp = VGAHWPTR(pScrn);
@@ -2023,7 +2017,7 @@ LgCloseScreen(CLOSE_SCREEN_ARGS_DECL)
pScrn->vtSema = FALSE;
pScreen->CloseScreen = pCir->CloseScreen;
- return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
+ return (*pScreen->CloseScreen)(pScreen);
}
/*
@@ -2033,9 +2027,8 @@ LgCloseScreen(CLOSE_SCREEN_ARGS_DECL)
* Optional
*/
void
-LgFreeScreen(FREE_SCREEN_ARGS_DECL)
+LgFreeScreen(ScrnInfoPtr pScrn)
{
- SCRN_INFO_PTR(arg);
#ifdef LG_DEBUG
ErrorF("LgFreeScreen\n");
#endif
@@ -2055,7 +2048,7 @@ LgFreeScreen(FREE_SCREEN_ARGS_DECL)
* Optional
*/
ModeStatus
-LgValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode,
+LgValidMode(ScrnInfoPtr arg, DisplayModePtr mode,
Bool verbose, int flags)
{
int lace;