diff options
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/compat-api.h | 101 | ||||
-rw-r--r-- | src/dummy.h | 6 | ||||
-rw-r--r-- | src/dummy_driver.c | 31 |
4 files changed, 17 insertions, 122 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 38eef5f..8bf3491 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,7 +33,6 @@ dummy_drv_la_LIBADD = $(XORG_LIBS) dummy_drv_ladir = @moduledir@/drivers dummy_drv_la_SOURCES = \ - compat-api.h \ dummy_cursor.c \ dummy_driver.c \ dummy.h diff --git a/src/compat-api.h b/src/compat-api.h deleted file mode 100644 index b74a582..0000000 --- a/src/compat-api.h +++ /dev/null @@ -1,101 +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 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 FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0 - -#define VT_FUNC_ARGS_DECL int arg, int flags -#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags) - -#define XF86_ENABLEDISABLEFB_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 FREE_SCREEN_ARGS(x) (x) - -#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg -#define VT_FUNC_ARGS(flags) pScrn - -#define XF86_ENABLEDISABLEFB_ARG(x) (x) - -#endif - -#endif diff --git a/src/dummy.h b/src/dummy.h index b81c560..d4e2e5d 100644 --- a/src/dummy.h +++ b/src/dummy.h @@ -11,8 +11,6 @@ #endif #include <string.h> -#include "compat-api.h" - #define DUMMY_MAX_SCREENS 16 /* Supported chipsets */ @@ -22,8 +20,8 @@ typedef enum { /* function prototypes */ -extern Bool DUMMYSwitchMode(SWITCH_MODE_ARGS_DECL); -extern void DUMMYAdjustFrame(ADJUST_FRAME_ARGS_DECL); +extern Bool DUMMYSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode); +extern void DUMMYAdjustFrame(ScrnInfoPtr pScrn, int x, int y); /* in dummy_cursor.c */ extern Bool DUMMYCursorInit(ScreenPtr pScrn); diff --git a/src/dummy_driver.c b/src/dummy_driver.c index 07e49f2..0efcf8e 100644 --- a/src/dummy_driver.c +++ b/src/dummy_driver.c @@ -47,13 +47,13 @@ static const OptionInfoRec * DUMMYAvailableOptions(int chipid, int busid); static void DUMMYIdentify(int flags); static Bool DUMMYProbe(DriverPtr drv, int flags); static Bool DUMMYPreInit(ScrnInfoPtr pScrn, int flags); -static Bool DUMMYScreenInit(SCREEN_INIT_ARGS_DECL); -static Bool DUMMYEnterVT(VT_FUNC_ARGS_DECL); -static void DUMMYLeaveVT(VT_FUNC_ARGS_DECL); -static Bool DUMMYCloseScreen(CLOSE_SCREEN_ARGS_DECL); +static Bool DUMMYScreenInit(ScreenPtr pScreen, int argc, char **argv); +static Bool DUMMYEnterVT(ScrnInfoPtr pScrn); +static void DUMMYLeaveVT(ScrnInfoPtr pScrn); +static Bool DUMMYCloseScreen(ScreenPtr pScreen); static Bool DUMMYCreateWindow(WindowPtr pWin); -static void DUMMYFreeScreen(FREE_SCREEN_ARGS_DECL); -static ModeStatus DUMMYValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, +static void DUMMYFreeScreen(ScrnInfoPtr pScrn); +static ModeStatus DUMMYValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags); static Bool DUMMYSaveScreen(ScreenPtr pScreen, int mode); @@ -723,14 +723,14 @@ DUMMYPreInit(ScrnInfoPtr pScrn, int flags) /* Mandatory */ static Bool -DUMMYEnterVT(VT_FUNC_ARGS_DECL) +DUMMYEnterVT(ScrnInfoPtr pScrn) { return TRUE; } /* Mandatory */ static void -DUMMYLeaveVT(VT_FUNC_ARGS_DECL) +DUMMYLeaveVT(ScrnInfoPtr pScrn) { } @@ -771,7 +771,7 @@ static ScrnInfoPtr DUMMYScrn; /* static-globalize it */ /* Mandatory */ static Bool -DUMMYScreenInit(SCREEN_INIT_ARGS_DECL) +DUMMYScreenInit(ScreenPtr pScreen, int argc, char **argv) { ScrnInfoPtr pScrn; DUMMYPtr dPtr; @@ -958,20 +958,20 @@ DUMMYScreenInit(SCREEN_INIT_ARGS_DECL) /* Mandatory */ Bool -DUMMYSwitchMode(SWITCH_MODE_ARGS_DECL) +DUMMYSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { return TRUE; } /* Mandatory */ void -DUMMYAdjustFrame(ADJUST_FRAME_ARGS_DECL) +DUMMYAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { } /* Mandatory */ static Bool -DUMMYCloseScreen(CLOSE_SCREEN_ARGS_DECL) +DUMMYCloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); DUMMYPtr dPtr = DUMMYPTR(pScrn); @@ -983,14 +983,13 @@ DUMMYCloseScreen(CLOSE_SCREEN_ARGS_DECL) pScrn->vtSema = FALSE; pScreen->CloseScreen = dPtr->CloseScreen; - return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS); + return (*pScreen->CloseScreen)(pScreen); } /* Optional */ static void -DUMMYFreeScreen(FREE_SCREEN_ARGS_DECL) +DUMMYFreeScreen(ScrnInfoPtr pScrn) { - SCRN_INFO_PTR(arg); DUMMYFreeRec(pScrn); } @@ -1002,7 +1001,7 @@ DUMMYSaveScreen(ScreenPtr pScreen, int mode) /* Optional */ static ModeStatus -DUMMYValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags) +DUMMYValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags) { return(MODE_OK); } |