summaryrefslogtreecommitdiff
path: root/vmwgfx/vmwgfx_driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'vmwgfx/vmwgfx_driver.h')
-rw-r--r--vmwgfx/vmwgfx_driver.h186
1 files changed, 186 insertions, 0 deletions
diff --git a/vmwgfx/vmwgfx_driver.h b/vmwgfx/vmwgfx_driver.h
new file mode 100644
index 0000000..3290f0e
--- /dev/null
+++ b/vmwgfx/vmwgfx_driver.h
@@ -0,0 +1,186 @@
1/*
2 * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
3 * Copyright 2011 VMWare, Inc.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright n<otice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 *
27 * Author: Alan Hourihane <alanh@tungstengraphics.com>
28 * Author: Jakob Bornecrantz <wallbraker@gmail.com>
29 * Author: Thomas Hellstrom <thellstrom@vmware.com>
30 */
31
32#ifndef _VMWGFX_DRIVER_H_
33#define _VMWGFX_DRIVER_H_
34
35
36#include <stddef.h>
37#include <stdint.h>
38#include <errno.h>
39#include <drm.h>
40#include <xf86drm.h>
41#include <xf86drmMode.h>
42#include <xorg-server.h>
43#include <xf86.h>
44#include <xf86Crtc.h>
45#include <xf86xv.h>
46#include <xa_tracker.h>
47
48#ifdef DRI2
49#include <dri2.h>
50#if (!defined(DRI2INFOREC_VERSION) || (DRI2INFOREC_VERSION < 3))
51#undef DRI2
52#endif
53#endif
54
55#define DRV_ERROR(msg) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, msg);
56#define debug_printf(...)
57
58#define VMWGFX_DRI_DEVICE_LEN 80
59
60typedef struct
61{
62 int lastInstance;
63 int refCount;
64 ScrnInfoPtr pScrn_1;
65 ScrnInfoPtr pScrn_2;
66} EntRec, *EntPtr;
67
68#define XORG_NR_FENCES 3
69
70enum xorg_throttling_reason {
71 THROTTLE_RENDER,
72 THROTTLE_SWAP
73};
74
75typedef struct _modesettingRec
76{
77 /* drm */
78 int fd;
79 int drm_major;
80 int drm_minor;
81 int drm_patch;
82
83 /* X */
84 EntPtr entityPrivate;
85
86 int Chipset;
87 EntityInfoPtr pEnt;
88 struct pci_device *PciInfo;
89
90 /* Accel */
91 Bool accelerate_render;
92 MessageType from_render;
93 Bool rendercheck;
94 MessageType from_rendercheck;
95 Bool SWCursor;
96 CursorPtr cursor;
97 Bool enable_dri;
98 MessageType from_dri;
99 Bool direct_presents;
100 MessageType from_dp;
101 Bool only_hw_presents;
102 MessageType from_hwp;
103 Bool isMaster;
104
105
106 /* Broken-out options. */
107 OptionInfoPtr Options;
108
109 ScreenBlockHandlerProcPtr saved_BlockHandler;
110 CreateScreenResourcesProcPtr saved_CreateScreenResources;
111 CloseScreenProcPtr saved_CloseScreen;
112 Bool (*saved_EnterVT)(int, int);
113 void (*saved_LeaveVT)(int, int);
114 void (*saved_AdjustFrame)(int, int, int, int);
115 Bool (*saved_UseHWCursor)(ScreenPtr, CursorPtr);
116 Bool (*saved_UseHWCursorARGB)(ScreenPtr, CursorPtr);
117
118 uint16_t lut_r[256], lut_g[256], lut_b[256];
119
120 Bool check_fb_size;
121 size_t max_fb_size;
122
123 struct xa_tracker *xat;
124#ifdef DRI2
125 Bool dri2_available;
126 char dri2_device_name[VMWGFX_DRI_DEVICE_LEN];
127#endif
128} modesettingRec, *modesettingPtr;
129
130#define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate))
131
132void xorg_flush(ScreenPtr pScreen);
133/***********************************************************************
134 * xorg_dri2.c
135 */
136Bool
137xorg_dri2_init(ScreenPtr pScreen);
138
139void
140xorg_dri2_close(ScreenPtr pScreen);
141
142
143/***********************************************************************
144 * xorg_crtc.c
145 */
146void
147xorg_crtc_init(ScrnInfoPtr pScrn);
148
149void
150xorg_crtc_cursor_destroy(xf86CrtcPtr crtc);
151
152void
153vmwgfx_disable_scanout(ScrnInfoPtr pScrn);
154
155PixmapPtr
156crtc_get_scanout(xf86CrtcPtr crtc);
157
158
159/***********************************************************************
160 * xorg_output.c
161 */
162void
163xorg_output_init(ScrnInfoPtr pScrn);
164
165unsigned
166xorg_output_get_id(xf86OutputPtr output);
167
168Bool
169vmwgfx_output_explicit_overlap(ScrnInfoPtr pScrn);
170
171
172/***********************************************************************
173 * xorg_xv.c
174 */
175void
176xorg_xv_init(ScreenPtr pScreen);
177
178XF86VideoAdaptorPtr
179vmw_video_init_adaptor(ScrnInfoPtr pScrn);
180void
181vmw_video_free_adaptor(XF86VideoAdaptorPtr adaptor, Bool free_ports);
182
183void
184vmw_ctrl_ext_init(ScrnInfoPtr pScrn);
185
186#endif /* _XORG_TRACKER_H_ */