1/* 2 * Copyright 2012 Red Hat, Inc. 3 * Copyright 2012 Canonical Ltd. 4 * 5 * Permission is hereby granted, free of charge, to any person obtaining a 6 * copy of this software and associated documentation files (the "Software"), 7 * to deal in the Software without restriction, including without limitation 8 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * and/or sell copies of the Software, and to permit persons to whom the 10 * Software is furnished to do so, subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice (including the next 13 * paragraph) shall be included in all copies or substantial portions of the 14 * Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 * DEALINGS IN THE SOFTWARE. 23 * 24 * Authors: 25 * Dave Airlie <airlied@redhat.com> 26 * Maarten Lankhorst <maarten.lankhorst@canonical.com> 27 */ 28 29/* this file provides API compat between server post 1.13 and pre it, 30 it should be reused inside as many drivers as possible */ 31#ifndef COMPAT_API_H 32#define COMPAT_API_H 33 34#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR 35#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum] 36#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p 37#endif 38 39#ifndef XF86_HAS_SCRN_CONV 40#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum] 41#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex] 42#endif 43 44#ifndef XF86_SCRN_INTERFACE 45 46#define DDC_CALL(pScrni) (pScrni->scrnIndex) 47 48#define SCRN_ARG_TYPE int 49#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrni = xf86Screens[(arg1)] 50 51#define SCREEN_ARG_TYPE int 52#define SCREEN_PTR(arg1) ScreenPtr pScrn = screenInfo.screens[(arg1)] 53 54#define SCREEN_INIT_ARGS_DECL int index, ScreenPtr pScrn, int argc, char **argv 55 56#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask 57#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask 58 59#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScrn 60#define CLOSE_SCREEN_ARGS scrnIndex, pScrn 61 62#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags 63#define ADJUST_FRAME_ARGS(x, y) pScrni->scrnIndex, (x), (y), 0 64 65#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr pMode, int flags 66 67#define FREE_SCREEN_ARGS_DECL int arg, int flags 68#define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0 69 70#define VT_FUNC_ARGS_DECL int arg, int flags 71#define VT_FUNC_ARGS(flags) pScrni->scrnIndex, (flags) 72 73#define XF86_ENABLEDISABLEFB_ARG(pScrni, x) ((pScrni)->scrnIndex), (x) 74 75#define POINTER_MOVED_ARGS_DECL int arg, int x, int y 76#define POINTER_MOVED_ARGS(x, y) pScrni->scrnIndex, (x), (y) 77 78#define VALID_MODE_ARGS_DECL int arg, DisplayModePtr pMode, Bool Verbose, int flags 79 80#else /*XF86_SCRN_INTERFACE) */ 81 82#define DDC_CALL(pScrni) (pScrni) 83 84#define SCRN_ARG_TYPE ScrnInfoPtr 85#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrni = (arg1) 86 87#define SCREEN_ARG_TYPE ScreenPtr 88#define SCREEN_PTR(arg1) ScreenPtr pScrn = (arg1) 89 90#define SCREEN_INIT_ARGS_DECL ScreenPtr pScrn, int argc, char **argv 91 92#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0) 93#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout 94#define BLOCKHANDLER_ARGS arg, pTimeout 95#else 96#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask 97#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask 98#endif 99 100#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScrn 101#define CLOSE_SCREEN_ARGS pScrn 102 103#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y 104#define ADJUST_FRAME_ARGS(x, y) pScrni, (x), (y) 105 106#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr pMode 107 108#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg 109#define FREE_SCREEN_ARGS(x) (x) 110 111#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg 112#define VT_FUNC_ARGS(flags) pScrni 113 114#define XF86_ENABLEDISABLEFB_ARG(pScrni, x) (pScrni), (x) 115 116#define POINTER_MOVED_ARGS_DECL ScrnInfoPtr arg, int x, int y 117#define POINTER_MOVED_ARGS(x, y) pScrni, (x), (y) 118 119#define VALID_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr pMode, Bool Verbose, int flags 120 121#endif 122 123#endif 124