1351N/A/*
1351N/A * Copyright 2012 Red Hat, Inc.
1351N/A *
1351N/A * Permission is hereby granted, free of charge, to any person obtaining a
1351N/A * copy of this software and associated documentation files (the "Software"),
1351N/A * to deal in the Software without restriction, including without limitation
1351N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1351N/A * and/or sell copies of the Software, and to permit persons to whom the
1351N/A * Software is furnished to do so, subject to the following conditions:
1351N/A *
1351N/A * The above copyright notice and this permission notice (including the next
1351N/A * paragraph) shall be included in all copies or substantial portions of the
1351N/A * Software.
1351N/A *
1351N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1351N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1351N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1351N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1351N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1351N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1351N/A * DEALINGS IN THE SOFTWARE.
1351N/A *
1351N/A * Author: Dave Airlie <airlied@redhat.com>
1351N/A */
1351N/A
1351N/A/* this file provides API compat between server post 1.13 and pre it,
1351N/A it should be reused inside as many drivers as possible */
1351N/A#ifndef COMPAT_API_H
1351N/A#define COMPAT_API_H
1351N/A
1351N/A#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
1351N/A#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
1351N/A#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
1351N/A#endif
1351N/A
1351N/A#ifndef XF86_HAS_SCRN_CONV
1351N/A#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
1351N/A#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
1351N/A#endif
1351N/A
1351N/A#ifndef XF86_SCRN_INTERFACE
1351N/A
1351N/A#define SCRN_ARG_TYPE int
1351N/A#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]
1351N/A
1351N/A#define SCREEN_ARG_TYPE int
1351N/A#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
1351N/A
1351N/A#define SCREEN_INIT_ARGS_DECL int i, ScreenPtr pScreen, int argc, char **argv
1351N/A
1351N/A#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
1351N/A#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
1351N/A
1351N/A#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
1351N/A#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
1351N/A
1351N/A#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
1351N/A
1351N/A#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
1351N/A
1351N/A#define FREE_SCREEN_ARGS_DECL int arg, int flags
1351N/A
1351N/A#define VT_FUNC_ARGS_DECL int arg, int flags
1351N/A#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags)
1351N/A
1351N/A#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
1351N/A#else
1351N/A#define SCRN_ARG_TYPE ScrnInfoPtr
1351N/A#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
1351N/A
1351N/A#define SCREEN_ARG_TYPE ScreenPtr
1351N/A#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
1351N/A
1351N/A#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
1351N/A
1351N/A#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
1351N/A#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
1351N/A
1351N/A#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
1351N/A#define CLOSE_SCREEN_ARGS pScreen
1351N/A
1351N/A#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
1351N/A#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
1351N/A
1351N/A#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
1351N/A
1351N/A#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
1351N/A#define VT_FUNC_ARGS(flags) pScrn
1351N/A
1351N/A#define XF86_ENABLEDISABLEFB_ARG(x) (x)
1351N/A
1351N/A#endif
1351N/A
1351N/A#endif