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