compat-api.h revision a5560a61
1/*
2 * Copyright 2012 Red Hat, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 *
23 * Author: Dave Airlie <airlied@redhat.com>
24 */
25
26/* this file provides API compat between server post 1.13 and pre it,
27   it should be reused inside as many drivers as possible */
28#ifndef COMPAT_API_H
29#define COMPAT_API_H
30
31#define SCRN_ARG_TYPE ScrnInfoPtr
32#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
33
34#define SCREEN_ARG_TYPE ScreenPtr
35#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
36
37#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
38
39#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(22,0)
40#define HAVE_NOTIFY_FD	1
41#endif
42
43#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0)
44#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout
45#define BLOCKHANDLER_ARGS arg, pTimeout
46#else
47#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
48#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
49#endif
50
51#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
52#define CLOSE_SCREEN_ARGS pScreen
53
54#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
55#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
56
57#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
58#define FREE_SCREEN_ARGS(x) (x)
59
60#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
61#define VT_FUNC_ARGS(flags) pScrn
62
63#define XF86_ENABLEDISABLEFB_ARG(x) (x)
64
65#endif
66
67#if ABI_VIDEODRV_VERSION < SET_ABI_VERSION(25, 2)
68#define secondary_dst slave_dst
69#define secondary_list slave_list
70#define secondary_head slave_head
71#define is_output_secondary is_output_slave
72#endif
73