12bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie/* 22bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * Copyright 2012 Red Hat, Inc. 32bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * 42bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * Permission is hereby granted, free of charge, to any person obtaining a 52bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * copy of this software and associated documentation files (the "Software"), 62bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * to deal in the Software without restriction, including without limitation 72bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * the rights to use, copy, modify, merge, publish, distribute, sublicense, 82bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * and/or sell copies of the Software, and to permit persons to whom the 92bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * Software is furnished to do so, subject to the following conditions: 102bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * 112bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * The above copyright notice and this permission notice (including the next 122bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * paragraph) shall be included in all copies or substantial portions of the 132bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * Software. 142bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * 152bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 162bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 172bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 182bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 192bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 202bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 212bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * DEALINGS IN THE SOFTWARE. 222bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * 232bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie * Author: Dave Airlie <airlied@redhat.com> 242bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie */ 252bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 262bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie/* this file provides API compat between server post 1.13 and pre it, 272bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie it should be reused inside as many drivers as possible */ 282bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#ifndef COMPAT_API_H 292bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define COMPAT_API_H 302bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 312bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR 322bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum] 332bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p 342bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#endif 352bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 362bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#ifndef XF86_HAS_SCRN_CONV 372bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum] 382bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex] 392bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#endif 402bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 412bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#ifndef XF86_SCRN_INTERFACE 422bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 432bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define SCRN_ARG_TYPE int 442bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)] 452bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 462bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define SCREEN_ARG_TYPE int 472bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)] 482bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 492bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define SCREEN_INIT_ARGS_DECL int i, ScreenPtr pScreen, int argc, char **argv 502bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 512bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask 522bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask 532bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 542bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen 552bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define CLOSE_SCREEN_ARGS scrnIndex, pScreen 562bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 572bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags 582bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define ADJUST_FRAME_ARGS(arg, x, y) (arg)->scrnIndex, x, y, 0 592bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 602bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags 612bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define SWITCH_MODE_ARGS(arg, m) (arg)->scrnIndex, m, 0 622bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 632bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define FREE_SCREEN_ARGS_DECL int arg, int flags 642bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 652bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define VT_FUNC_ARGS_DECL int arg, int flags 662bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define VT_FUNC_ARGS pScrn->scrnIndex, 0 672bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 682bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define XF86_SCRN_ARG(x) ((x)->scrnIndex) 692bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#else 702bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define SCRN_ARG_TYPE ScrnInfoPtr 712bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1) 722bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 732bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define SCREEN_ARG_TYPE ScreenPtr 742bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1) 752bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 762bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv 772bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 782bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask 792bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask 802bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 812bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen 822bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define CLOSE_SCREEN_ARGS pScreen 832bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 842bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y 852bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define ADJUST_FRAME_ARGS(arg, x, y) arg, x, y 862bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 872bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode 882bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define SWITCH_MODE_ARGS(arg, m) arg, m 892bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 902bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg 912bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 922bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg 932bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define VT_FUNC_ARGS pScrn 942bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 952bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#define XF86_SCRN_ARG(x) (x) 962bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 972bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#endif 982bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie 992bb2e6a6e3017d462be0ae9308955f37c5ee03c6Dave Airlie#endif 100