From db56de34bdf70f1904dba50d98774aaa950a2ca5 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 23 May 2024 19:34:03 +0200 Subject: drop compat with ancient xservers We're relying on 1.18 now, so drop compat with older ones. Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- src/Makefile.am | 3 +- src/ast.h | 2 -- src/ast_driver.c | 45 +++++++++++--------------- src/compat-api.h | 99 -------------------------------------------------------- 4 files changed, 20 insertions(+), 129 deletions(-) delete mode 100644 src/compat-api.h diff --git a/src/Makefile.am b/src/Makefile.am index 5f1b4e6..fdc0b4b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -43,5 +43,4 @@ ast_drv_la_SOURCES = \ ast_tool.c \ ast_vgatool.c \ ast_vgatool.h \ - ast_dp501fw.h \ - compat-api.h + ast_dp501fw.h diff --git a/src/ast.h b/src/ast.h index 015f576..94f3eb0 100644 --- a/src/ast.h +++ b/src/ast.h @@ -36,8 +36,6 @@ #include "ast_pcirename.h" -#include "compat-api.h" - #ifdef Support_ShadowFB #include "shadow.h" #endif diff --git a/src/ast_driver.c b/src/ast_driver.c index 7c0cd0b..6db56c4 100644 --- a/src/ast_driver.c +++ b/src/ast_driver.c @@ -55,19 +55,19 @@ static void ASTIdentify(int flags); const OptionInfoRec *ASTAvailableOptions(int chipid, int busid); static Bool ASTProbe(DriverPtr drv, int flags); static Bool ASTPreInit(ScrnInfoPtr pScrn, int flags); -static Bool ASTScreenInit(SCREEN_INIT_ARGS_DECL); -Bool ASTSwitchMode(SWITCH_MODE_ARGS_DECL); -void ASTAdjustFrame(ADJUST_FRAME_ARGS_DECL); -static Bool ASTEnterVT(VT_FUNC_ARGS_DECL); -static void ASTLeaveVT(VT_FUNC_ARGS_DECL); -static void ASTFreeScreen(FREE_SCREEN_ARGS_DECL); -static ModeStatus ASTValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags); +static Bool ASTScreenInit(ScreenPtr pScreen, int argc, char **argv); +Bool ASTSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode); +void ASTAdjustFrame(ScrnInfoPtr pScrn, int x, int y); +static Bool ASTEnterVT(ScrnInfoPtr pScrn); +static void ASTLeaveVT(ScrnInfoPtr pScrn); +static void ASTFreeScreen(ScrnInfoPtr pScrn); +static ModeStatus ASTValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags); /* Internally used functions */ static Bool ASTGetRec(ScrnInfoPtr pScrn); static void ASTFreeRec(ScrnInfoPtr pScrn); static Bool ASTSaveScreen(ScreenPtr pScreen, Bool unblack); -static Bool ASTCloseScreen(CLOSE_SCREEN_ARGS_DECL); +static Bool ASTCloseScreen(ScreenPtr pScreen); static void ASTSave(ScrnInfoPtr pScrn); static void ASTRestore(ScrnInfoPtr pScrn); static void ASTProbeDDC(ScrnInfoPtr pScrn, int index); @@ -762,7 +762,7 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags) static Bool -ASTScreenInit(SCREEN_INIT_ARGS_DECL) +ASTScreenInit(ScreenPtr pScreen, int argc, char **argv) { ScrnInfoPtr pScrn; ASTRecPtr pAST; @@ -818,7 +818,7 @@ ASTScreenInit(SCREEN_INIT_ARGS_DECL) } ASTSaveScreen(pScreen, FALSE); - ASTAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); + ASTAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0); miClearVisualTypes(); @@ -953,9 +953,8 @@ ASTScreenInit(SCREEN_INIT_ARGS_DECL) Bool -ASTSwitchMode(SWITCH_MODE_ARGS_DECL) +ASTSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { - SCRN_INFO_PTR(arg); ASTRecPtr pAST = ASTPTR(pScrn); /* VideoMode validate */ @@ -993,9 +992,8 @@ ASTSwitchMode(SWITCH_MODE_ARGS_DECL) } void -ASTAdjustFrame(ADJUST_FRAME_ARGS_DECL) +ASTAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { - SCRN_INFO_PTR(arg); ASTRecPtr pAST = ASTPTR(pScrn); ULONG base; @@ -1008,9 +1006,8 @@ ASTAdjustFrame(ADJUST_FRAME_ARGS_DECL) /* enter into X Server */ static Bool -ASTEnterVT(VT_FUNC_ARGS_DECL) +ASTEnterVT(ScrnInfoPtr pScrn) { - SCRN_INFO_PTR(arg); ASTRecPtr pAST = ASTPTR(pScrn); /* Fixed suspend can't resume issue */ @@ -1028,7 +1025,7 @@ ASTEnterVT(VT_FUNC_ARGS_DECL) if (!ASTModeInit(pScrn, pScrn->currentMode)) return FALSE; - ASTAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); + ASTAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0); return TRUE; @@ -1036,10 +1033,8 @@ ASTEnterVT(VT_FUNC_ARGS_DECL) /* leave X server */ static void -ASTLeaveVT(VT_FUNC_ARGS_DECL) +ASTLeaveVT(ScrnInfoPtr pScrn) { - - SCRN_INFO_PTR(arg); ASTRecPtr pAST = ASTPTR(pScrn); #if !(defined(__sparc__)) && !(defined(__mips__)) vgaHWPtr hwp = VGAHWPTR(pScrn); @@ -1073,9 +1068,8 @@ ASTLeaveVT(VT_FUNC_ARGS_DECL) } static void -ASTFreeScreen(FREE_SCREEN_ARGS_DECL) +ASTFreeScreen(ScrnInfoPtr pScrn) { - SCRN_INFO_PTR(arg); ASTFreeRec(pScrn); #if !(defined(__sparc__)) && !(defined(__mips__)) if (xf86LoaderCheckSymbol("vgaHWFreeHWRec")) @@ -1084,9 +1078,8 @@ ASTFreeScreen(FREE_SCREEN_ARGS_DECL) } static ModeStatus -ASTValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags) +ASTValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags) { - SCRN_INFO_PTR(arg); ASTRecPtr pAST = ASTPTR(pScrn); ModeStatus Flags = MODE_NOMODE; UCHAR jReg; @@ -1219,7 +1212,7 @@ ASTSaveScreen(ScreenPtr pScreen, Bool unblack) } static Bool -ASTCloseScreen(CLOSE_SCREEN_ARGS_DECL) +ASTCloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ASTRecPtr pAST = ASTPTR(pScrn); @@ -1275,7 +1268,7 @@ ASTCloseScreen(CLOSE_SCREEN_ARGS_DECL) pScrn->vtSema = FALSE; pScreen->CloseScreen = pAST->CloseScreen; - return (*pScreen->CloseScreen) (CLOSE_SCREEN_ARGS); + return (*pScreen->CloseScreen) (pScreen); } static void diff --git a/src/compat-api.h b/src/compat-api.h deleted file mode 100644 index 6bc946f..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 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 -- cgit v1.2.3