From 58de94c6d4c3e5d0845962191c472b726ce266d7 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 29 May 2024 16:26:54 +0200 Subject: drop obsolete compat macros Since we're relying on xserver >= 1.18, these macros aren't needed anymore. Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- src/compat-api.h | 40 ++++++++-------------------------------- src/savage_dga.c | 7 +++---- src/savage_dri.c | 2 -- src/savage_driver.c | 42 ++++++++++++++++++------------------------ src/savage_driver.h | 8 ++++---- src/savage_shadow.c | 5 ++--- 6 files changed, 35 insertions(+), 69 deletions(-) diff --git a/src/compat-api.h b/src/compat-api.h index b5d8d8f..7868283 100644 --- a/src/compat-api.h +++ b/src/compat-api.h @@ -28,42 +28,18 @@ #ifndef COMPAT_API_H #define COMPAT_API_H -#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 - #if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0) -#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout -#define BLOCKHANDLER_ARGS arg, pTimeout +#define BLOCKHANDLER_ARGS_DECL ScreenPtr pScreen, pointer pTimeout +#define BLOCKHANDLER_ARGS pScreen, pTimeout -#define WAKEUPHANDLER_ARGS_DECL ScreenPtr arg, int result -#define WAKEUPHANDLER_ARGS arg, result +#define WAKEUPHANDLER_ARGS_DECL ScreenPtr pScreen, int result +#define WAKEUPHANDLER_ARGS pScreen, result #else -#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask -#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask +#define BLOCKHANDLER_ARGS_DECL ScreenPtr pScreen, pointer pTimeout, pointer pReadmask +#define BLOCKHANDLER_ARGS pScreen, pTimeout, pReadmask -#define WAKEUPHANDLER_ARGS_DECL ScreenPtr arg, unsigned long result, pointer read_mask -#define WAKEUPHANDLER_ARGS arg, result, read_mask +#define WAKEUPHANDLER_ARGS_DECL ScreenPtr pScreen, unsigned long result, pointer read_mask +#define WAKEUPHANDLER_ARGS pScreen, result, read_mask #endif -#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 diff --git a/src/savage_dga.c b/src/savage_dga.c index d87a6a4..3acf7fe 100644 --- a/src/savage_dga.c +++ b/src/savage_dga.c @@ -268,7 +268,7 @@ Savage_SetMode( pScrn->currentMode = OldMode[index]; psav->DGAactive = FALSE; - SavageSwitchMode(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode)); + SavageSwitchMode(pScrn, pScrn->currentMode); if( psav->hwcursor && psav->hwc_on ) SavageShowCursor(pScrn); } else { @@ -303,8 +303,7 @@ Savage_SetMode( pScrn->displayWidth = pMode->bytesPerScanline / (pMode->bitsPerPixel >> 3); -/* psav->UseBIOS = FALSE; */ - SavageSwitchMode(SWITCH_MODE_ARGS(pScrn, pMode->mode)); + SavageSwitchMode(pScrn, pMode->mode); psav->UseBIOS = holdBIOS; } @@ -329,7 +328,7 @@ Savage_SetViewport( ){ SavagePtr psav = SAVPTR(pScrn); - SavageAdjustFrame(ADJUST_FRAME_ARGS(pScrn, x, y)); + SavageAdjustFrame(pScrn, x, y); psav->DGAViewportStatus = 0; /* MGAAdjustFrame loops until finished */ } diff --git a/src/savage_dri.c b/src/savage_dri.c index d91d18d..08185d0 100644 --- a/src/savage_dri.c +++ b/src/savage_dri.c @@ -103,7 +103,6 @@ static void SAVAGEDestroyContext( ScreenPtr pScreen, drm_context_t hwContext, static void SAVAGEWakeupHandler(WAKEUPHANDLER_ARGS_DECL) { - SCREEN_PTR(arg); ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SavagePtr psav = SAVPTR(pScrn); @@ -128,7 +127,6 @@ static void SAVAGEWakeupHandler(WAKEUPHANDLER_ARGS_DECL) static void SAVAGEBlockHandler(BLOCKHANDLER_ARGS_DECL) { - SCREEN_PTR(arg); ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SavagePtr psav = SAVPTR(pScrn); diff --git a/src/savage_driver.c b/src/savage_driver.c index 7804528..5eb665d 100644 --- a/src/savage_driver.c +++ b/src/savage_driver.c @@ -86,24 +86,24 @@ static int LookupChipID(PciChipsets* pset, int ChipID); #endif static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags); -static Bool SavageEnterVT(VT_FUNC_ARGS_DECL); -static void SavageLeaveVT(VT_FUNC_ARGS_DECL); +static Bool SavageEnterVT(ScrnInfoPtr pScrn); +static void SavageLeaveVT(ScrnInfoPtr pScrn); static void SavageSave(ScrnInfoPtr pScrn); static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr, SavageRegPtr, Bool); static void SavageInitStatus(ScrnInfoPtr pScrn); static void SavageInitShadowStatus(ScrnInfoPtr pScrn); -static Bool SavageScreenInit(SCREEN_INIT_ARGS_DECL); +static Bool SavageScreenInit(ScreenPtr pScreen, int argc, char **argv); static int SavageInternalScreenInit(ScreenPtr pScreen); -static ModeStatus SavageValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, +static ModeStatus SavageValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags); void SavageDGAInit(ScreenPtr); static Bool SavageMapMem(ScrnInfoPtr pScrn); static void SavageUnmapMem(ScrnInfoPtr pScrn, int All); static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); -static Bool SavageCloseScreen(CLOSE_SCREEN_ARGS_DECL); +static Bool SavageCloseScreen(ScreenPtr pScreen); static Bool SavageSaveScreen(ScreenPtr pScreen, int mode); static void SavageLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, @@ -900,10 +900,10 @@ static void SavageDoDDC(ScrnInfoPtr pScrn) if (SavageI2CInit(pScrn)) { unsigned char tmp; xf86MonPtr pMon; - + InI2CREG(tmp,psav->DDCPort); OutI2CREG(tmp | 0x13,psav->DDCPort); - pMon = xf86PrintEDID(xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn),psav->I2C)); + pMon = xf86PrintEDID(xf86DoEDID_DDC2(pScrn, psav->I2C)); if (!psav->IgnoreEDID) xf86SetDDCproperties(pScrn, pMon); OutI2CREG(tmp,psav->DDCPort); } @@ -2194,9 +2194,8 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) } -static Bool SavageEnterVT(VT_FUNC_ARGS_DECL) +static Bool SavageEnterVT(ScrnInfoPtr pScrn) { - SCRN_INFO_PTR(arg); #ifdef SAVAGEDRI SavagePtr psav = SAVPTR(pScrn); ScreenPtr pScreen; @@ -2226,9 +2225,8 @@ static Bool SavageEnterVT(VT_FUNC_ARGS_DECL) } -static void SavageLeaveVT(VT_FUNC_ARGS_DECL) +static void SavageLeaveVT(ScrnInfoPtr pScrn) { - SCRN_INFO_PTR(arg); vgaHWPtr hwp = VGAHWPTR(pScrn); SavagePtr psav = SAVPTR(pScrn); vgaRegPtr vgaSavePtr = &hwp->SavedReg; @@ -3209,7 +3207,7 @@ static void SavageInitShadowStatus(ScrnInfoPtr pScrn) psav->dwBCIWait2DIdle = 0xc0020000; } -static Bool SavageScreenInit(SCREEN_INIT_ARGS_DECL) +static Bool SavageScreenInit(ScreenPtr pScreen, int argc, char **argv) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); SavagePtr psav; @@ -3600,10 +3598,9 @@ static int SavageGetRefresh(DisplayModePtr mode) } -static ModeStatus SavageValidMode(SCRN_ARG_TYPE arg, DisplayModePtr pMode, +static ModeStatus SavageValidMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, Bool verbose, int flags) { - SCRN_INFO_PTR(arg); SavagePtr psav = SAVPTR(pScrn); int refresh; @@ -3699,7 +3696,7 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) SavageInitSecondaryStream(pScrn); } - SavageAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); + SavageAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0); return TRUE; } @@ -3965,13 +3962,13 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) SavageInitSecondaryStream(pScrn); } - SavageAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); + SavageAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0); return TRUE; } -static Bool SavageCloseScreen(CLOSE_SCREEN_ARGS_DECL) +static Bool SavageCloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); vgaHWPtr hwp = VGAHWPTR(pScrn); @@ -4018,7 +4015,7 @@ static Bool SavageCloseScreen(CLOSE_SCREEN_ARGS_DECL) pScrn->vtSema = FALSE; pScreen->CloseScreen = psav->CloseScreen; - return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS); + return (*pScreen->CloseScreen)(pScreen); } @@ -4040,9 +4037,8 @@ static Bool SavageSaveScreen(ScreenPtr pScreen, int mode) return vgaHWSaveScreen(pScreen, mode); } -void SavageAdjustFrame(ADJUST_FRAME_ARGS_DECL) +void SavageAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { - SCRN_INFO_PTR(arg); SavagePtr psav = SAVPTR(pScrn); if (psav->IsSecondary) { @@ -4117,9 +4113,8 @@ SavageDoAdjustFrame(ScrnInfoPtr pScrn, int x, int y, int crtc2) return; } -Bool SavageSwitchMode(SWITCH_MODE_ARGS_DECL) +Bool SavageSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { - SCRN_INFO_PTR(arg); SavagePtr psav = SAVPTR(pScrn); Bool success; @@ -4595,8 +4590,7 @@ SavageDDC1(ScrnInfoPtr pScrn) InI2CREG(byte,psav->I2CPort); OutI2CREG(byte | 0x12,psav->I2CPort); - pMon = xf86DoEDID_DDC1(XF86_SCRN_ARG(pScrn), SavageDDC1SetSpeed, - SavageDDC1Read); + pMon = xf86DoEDID_DDC1(pScrn, SavageDDC1SetSpeed, SavageDDC1Read); if (!pMon) return FALSE; diff --git a/src/savage_driver.h b/src/savage_driver.h index 9cd7a5a..d4ed859 100644 --- a/src/savage_driver.h +++ b/src/savage_driver.h @@ -406,7 +406,7 @@ typedef struct _Savage { /* Support for shadowFB and rotation */ unsigned char * ShadowPtr; int ShadowPitch; - void (*PointerMoved)(SCRN_ARG_TYPE arg, int x, int y); + void (*PointerMoved)(ScrnInfoPtr pScrn, int x, int y); /* support for EXA */ ExaDriverPtr EXADriverPtr; @@ -569,9 +569,9 @@ extern void SavageCommonCalcClock(long freq, int min_m, int min_n1, int max_n1, int min_n2, int max_n2, long freq_min, long freq_max, unsigned char *mdiv, unsigned char *ndiv); -void SavageAdjustFrame(ADJUST_FRAME_ARGS_DECL); +void SavageAdjustFrame(ScrnInfoPtr pScrn, int x, int y); void SavageDoAdjustFrame(ScrnInfoPtr pScrn, int y, int x, int crtc2); -Bool SavageSwitchMode(SWITCH_MODE_ARGS_DECL); +Bool SavageSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode); /* In savage_cursor.c. */ @@ -597,7 +597,7 @@ Bool SavageI2CInit(ScrnInfoPtr pScrn); /* In savage_shadow.c */ -void SavagePointerMoved(SCRN_ARG_TYPE arg, int x, int y); +void SavagePointerMoved(ScrnInfoPtr pScrn, int x, int y); void SavageRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox); void SavageRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox); void SavageRefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox); diff --git a/src/savage_shadow.c b/src/savage_shadow.c index a430a69..98b50e7 100644 --- a/src/savage_shadow.c +++ b/src/savage_shadow.c @@ -42,9 +42,8 @@ SavageRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) void -SavagePointerMoved(SCRN_ARG_TYPE arg, int x, int y) +SavagePointerMoved(ScrnInfoPtr pScrn, int x, int y) { - SCRN_INFO_PTR(arg); SavagePtr psav = SAVPTR(pScrn); int newX, newY; @@ -56,7 +55,7 @@ SavagePointerMoved(SCRN_ARG_TYPE arg, int x, int y) newY = pScrn->pScreen->width - x - 1; } - (*psav->PointerMoved)(arg, newX, newY); + (*psav->PointerMoved)(pScrn, newX, newY); } void -- cgit v1.2.3