From 196784e691b8f8739792439434ffa002e9f5cdfa Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 23 May 2024 19:31:49 +0200 Subject: drop compat with ancient xserver versions We're relying on at least 1.18, so compat with older ones isn't needed anymore. Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- src/Makefile.am | 1 - src/apm.h | 5 ++- src/apm_dga.c | 8 ++--- src/apm_driver.c | 43 +++++++++++------------- src/compat-api.h | 99 -------------------------------------------------------- 5 files changed, 25 insertions(+), 131 deletions(-) delete mode 100644 src/compat-api.h (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index e71ba6c..6155fcf 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,7 +32,6 @@ apm_drv_la_LDFLAGS = -module -avoid-version apm_drv_ladir = @moduledir@/drivers apm_drv_la_SOURCES = \ - compat-api.h \ apm_cursor.c \ apm_dga.c \ apm_driver.c \ diff --git a/src/apm.h b/src/apm.h index 7600c0c..c94d26b 100644 --- a/src/apm.h +++ b/src/apm.h @@ -37,7 +37,6 @@ #include "xf86xv.h" #include -#include "compat-api.h" #ifdef TRUE #undef TRUE #endif @@ -206,8 +205,8 @@ extern Bool ApmI2CInit(ScrnInfoPtr pScrn); extern void XFree86RushExtensionInit(ScreenPtr pScreen); extern void ApmInitVideo(ScreenPtr pScreen); extern void ApmInitVideo_IOP(ScreenPtr pScreen); -extern Bool ApmSwitchMode(SWITCH_MODE_ARGS_DECL); -extern void ApmAdjustFrame(ADJUST_FRAME_ARGS_DECL); +extern Bool ApmSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode); +extern void ApmAdjustFrame(ScrnInfoPtr pScrn, int x, int y); extern void ApmHWCursorReserveSpace(ApmPtr pApm); extern void ApmAccelReserveSpace(ApmPtr pApm); diff --git a/src/apm_dga.c b/src/apm_dga.c index 1a3cf6e..4a4fa96 100644 --- a/src/apm_dga.c +++ b/src/apm_dga.c @@ -234,8 +234,8 @@ ApmSetMode(ScrnInfoPtr pScrn, DGAModePtr pMode) } pScrn->currentMode = pApm->CurrentLayout.pMode; - ApmSwitchMode(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode)); - ApmAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); + ApmSwitchMode(pScrn, pScrn->currentMode); + ApmAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0); #if 0 if (pApm->AccelInfoRec) XAAInit(pScrn->pScreen, pApm->AccelInfoRec); @@ -260,7 +260,7 @@ ApmSetMode(ScrnInfoPtr pScrn, DGAModePtr pMode) else pApm->CurrentLayout.mask32 = 32 / pMode->bitsPerPixel - 1; - ApmSwitchMode(SWITCH_MODE_ARGS(pScrn, pMode->mode)); + ApmSwitchMode(pScrn, pMode->mode); #if 0 if (pApm->DGAXAAInfo) @@ -311,7 +311,7 @@ ApmSetViewport( ApmWriteSeq(0x1C, 0x2F); pApm->apmLock = FALSE; } - pScrn->AdjustFrame(ADJUST_FRAME_ARGS(pScrn, x, y)); + pScrn->AdjustFrame(pScrn, x, y); if (pApm->VGAMap) { /* Wait until vertical retrace is in progress. */ while (APMVGAB(0x3DA) & 0x08); diff --git a/src/apm_driver.c b/src/apm_driver.c index aeaba94..1de80fc 100644 --- a/src/apm_driver.c +++ b/src/apm_driver.c @@ -38,12 +38,12 @@ static const OptionInfoRec * ApmAvailableOptions(int chipid, int busid); static void ApmIdentify(int flags); static Bool ApmProbe(DriverPtr drv, int flags); static Bool ApmPreInit(ScrnInfoPtr pScrn, int flags); -static Bool ApmScreenInit(SCREEN_INIT_ARGS_DECL); -static Bool ApmEnterVT(VT_FUNC_ARGS_DECL); -static void ApmLeaveVT(VT_FUNC_ARGS_DECL); -static Bool ApmCloseScreen(CLOSE_SCREEN_ARGS_DECL); -static void ApmFreeScreen(FREE_SCREEN_ARGS_DECL); -static ModeStatus ApmValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, +static Bool ApmScreenInit(ScreenPtr pScreen, int argc, char **argv); +static Bool ApmEnterVT(ScrnInfoPtr pScrn); +static void ApmLeaveVT(ScrnInfoPtr pScrn); +static Bool ApmCloseScreen(ScreenPtr pScreen); +static void ApmFreeScreen(ScrnInfoPtr pScrn); +static ModeStatus ApmValidMode(ScrnInfoPtr arg, DisplayModePtr mode, Bool verbose, int flags); static Bool ApmSaveScreen(ScreenPtr pScreen, int mode); static void ApmUnlock(ApmPtr pApm); @@ -781,11 +781,11 @@ ApmPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"I2C initialization failed\n"); } else { - MonInfo = xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn),pApm->I2CPtr); + MonInfo = xf86DoEDID_DDC2(pScrn, pApm->I2CPtr); } } if (0 && !MonInfo) - MonInfo = xf86DoEDID_DDC1(XF86_SCRN_ARG(pScrn),vgaHWddc1SetSpeed,ddc1Read); + MonInfo = xf86DoEDID_DDC1(pScrn, vgaHWddc1SetSpeed, ddc1Read); if (MonInfo) { xf86PrintEDID(MonInfo); xf86SetDDCproperties(pScrn, MonInfo); @@ -1643,7 +1643,7 @@ ApmRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) /* This gets called at the start of each server generation */ static Bool -ApmScreenInit(SCREEN_INIT_ARGS_DECL) +ApmScreenInit(ScreenPtr pScreen, int argc, char **argv) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); APMDECL(pScrn); @@ -1668,7 +1668,7 @@ ApmScreenInit(SCREEN_INIT_ARGS_DECL) /* Darken the screen for aesthetic reasons and set the viewport */ ApmSaveScreen(pScreen, SCREEN_SAVER_ON); - ApmAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); + ApmAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0); /* * Reset fb's visual list. @@ -1860,9 +1860,8 @@ ApmLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, /* Usually mandatory */ Bool -ApmSwitchMode(SWITCH_MODE_ARGS_DECL) +ApmSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { - SCRN_INFO_PTR(arg); return ApmModeInit(pScrn, mode); } @@ -1872,9 +1871,8 @@ ApmSwitchMode(SWITCH_MODE_ARGS_DECL) */ /* Usually mandatory */ void -ApmAdjustFrame(ADJUST_FRAME_ARGS_DECL) +ApmAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { - SCRN_INFO_PTR(arg); APMDECL(pScrn); int Base; @@ -1915,9 +1913,8 @@ ApmAdjustFrame(ADJUST_FRAME_ARGS_DECL) /* Mandatory */ static Bool -ApmEnterVT(VT_FUNC_ARGS_DECL) +ApmEnterVT(ScrnInfoPtr pScrn) { - SCRN_INFO_PTR(arg); APMDECL(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); @@ -1937,16 +1934,15 @@ ApmEnterVT(VT_FUNC_ARGS_DECL) if (!ApmModeInit(pScrn, pScrn->currentMode)) return FALSE; - ApmAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); + ApmAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0); return TRUE; } /* Mandatory */ static void -ApmLeaveVT(VT_FUNC_ARGS_DECL) +ApmLeaveVT(ScrnInfoPtr pScrn) { - SCRN_INFO_PTR(arg); APMDECL(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); @@ -1971,7 +1967,7 @@ ApmLeaveVT(VT_FUNC_ARGS_DECL) /* Mandatory */ static Bool -ApmCloseScreen(CLOSE_SCREEN_ARGS_DECL) +ApmCloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); vgaHWPtr hwp = VGAHWPTR(pScrn); @@ -1991,16 +1987,15 @@ ApmCloseScreen(CLOSE_SCREEN_ARGS_DECL) pScrn->vtSema = FALSE; pScreen->CloseScreen = pApm->CloseScreen; - return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS); + return (*pScreen->CloseScreen)(pScreen); } /* Free up any per-generation data structures */ /* Optional */ static void -ApmFreeScreen(FREE_SCREEN_ARGS_DECL) +ApmFreeScreen(ScrnInfoPtr pScrn) { - SCRN_INFO_PTR(arg); vgaHWFreeHWRec(pScrn); ApmFreeRec(pScrn); } @@ -2009,7 +2004,7 @@ ApmFreeScreen(FREE_SCREEN_ARGS_DECL) /* Optional */ static ModeStatus -ApmValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags) +ApmValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags) { if (mode->Flags & V_INTERLACE) return(MODE_BAD); 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 - */ - -/* 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 -- cgit v1.2.3