VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h@ 17252

Last change on this file since 17252 was 17252, checked in by vboxsync, 16 years ago

Additions/x11/vboxvideo: hack around a typo in a header when building on Solaris

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.0 KB
Line 
1/** @file
2 *
3 * VirtualBox X11 Additions graphics driver
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 * --------------------------------------------------------------------
21 *
22 * This code is based on:
23 *
24 * X11 VESA driver
25 *
26 * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
27 *
28 * Permission is hereby granted, free of charge, to any person obtaining a
29 * copy of this software and associated documentation files (the "Software"),
30 * to deal in the Software without restriction, including without limitation
31 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
32 * and/or sell copies of the Software, and to permit persons to whom the
33 * Software is furnished to do so, subject to the following conditions:
34 *
35 * The above copyright notice and this permission notice shall be included in
36 * all copies or substantial portions of the Software.
37 *
38 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
41 * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
42 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
43 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
44 * SOFTWARE.
45 *
46 * Except as contained in this notice, the name of Conectiva Linux shall
47 * not be used in advertising or otherwise to promote the sale, use or other
48 * dealings in this Software without prior written authorization from
49 * Conectiva Linux.
50 *
51 * Authors: Paulo C�ar Pereira de Andrade <pcpa@conectiva.com.br>
52 *
53 * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.9 2001/05/04 19:05:49 dawes Exp $
54 */
55
56#ifndef _VBOXVIDEO_H_
57#define _VBOXVIDEO_H_
58
59#include <VBox/VBoxGuest.h>
60
61/* All drivers should typically include these */
62#include "xf86.h"
63#include "xf86_OSproc.h"
64#include "xf86Resources.h"
65
66#ifndef NO_ANSIC
67/* All drivers need this */
68# include "xf86_ansic.h"
69#endif
70
71#include "compiler.h"
72
73#ifndef PCIACCESS
74/* Drivers for PCI hardware need this */
75# include "xf86PciInfo.h"
76/* Drivers that need to access the PCI config space directly need this */
77# include "xf86Pci.h"
78#endif
79
80#include "vgaHW.h"
81
82/* VBE/DDC support */
83#include "vbe.h"
84
85/* ShadowFB support */
86#include "shadowfb.h"
87
88/* VBox video related defines */
89
90#define VBE_DISPI_IOPORT_INDEX 0x01CE
91#define VBE_DISPI_IOPORT_DATA 0x01CF
92#define VBE_DISPI_INDEX_ID 0x0
93#define VBE_DISPI_INDEX_XRES 0x1
94#define VBE_DISPI_INDEX_YRES 0x2
95#define VBE_DISPI_INDEX_BPP 0x3
96#define VBE_DISPI_INDEX_ENABLE 0x4
97#define VBE_DISPI_INDEX_VIRT_WIDTH 0x6
98#define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7
99#define VBE_DISPI_ID2 0xB0C2
100#define VBE_DISPI_DISABLED 0x00
101#define VBE_DISPI_ENABLED 0x01
102#define VBE_DISPI_LFB_ENABLED 0x40
103
104/* Dga definitions */
105#include "dgaproc.h"
106
107#include "xf86RAC.h"
108
109#include "fb.h"
110
111#define VBOX_VERSION 4000 /* Why? */
112#include "xf86Cursor.h"
113#define VBOX_NAME "VBoxVideo"
114#define VBOX_DRIVER_NAME "vboxvideo"
115
116/* DRI support */
117#define _XF86DRI_SERVER_
118/* Hack to work around a libdrm header which is broken on Solaris */
119#define u_int64_t uint64_t
120#include "dri.h"
121#undef u_int64_t
122#include "GL/glxint.h"
123#include "GL/glxtokens.h"
124
125/* For some reason this is not in the header files. */
126extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
127 void **configprivs);
128#define VBOX_VIDEO_MAJOR 1
129#define VBOX_VIDEO_MINOR 0
130#define VBOX_DRM_DRIVER_NAME "tdfx" /* For now, as this driver is basically a stub. */
131#define VBOX_DRI_DRIVER_NAME "swrast" /* For starters. */
132#define VBOX_MAX_DRAWABLES 256 /* At random. */
133
134#define VBOXPTR(p) ((VBOXPtr)((p)->driverPrivate))
135
136/*XXX*/
137
138typedef struct _VBOXRec
139{
140 vbeInfoPtr pVbe;
141 EntityInfoPtr pEnt;
142 VbeInfoBlock *vbeInfo;
143#ifdef PCIACCESS
144 struct pci_device *pciInfo;
145 struct pci_device *vmmDevInfo;
146#else
147 pciVideoPtr pciInfo;
148 PCITAG pciTag;
149#endif
150 CARD16 maxBytesPerScanline;
151 unsigned long mapPhys, mapOff;
152 int mapSize; /* video memory */
153 void *base, *VGAbase;
154 CARD8 *state, *pstate; /* SVGA state */
155 int statePage, stateSize, stateMode;
156 CARD32 *savedPal;
157 CARD8 *fonts;
158 /* DGA info */
159 DGAModePtr pDGAMode;
160 int nDGAMode;
161 CloseScreenProcPtr CloseScreen;
162 /** Default X server procedure for enabling and disabling framebuffer access */
163 xf86EnableDisableFBAccessProc *EnableDisableFBAccess;
164 /** Is access to the framebuffer currently allowed? */
165 Bool accessEnabled;
166 OptionInfoPtr Options;
167 IOADDRESS ioBase;
168 VMMDevReqMousePointer *reqp;
169 xf86CursorInfoPtr pCurs;
170 size_t pointerHeaderSize;
171 size_t pointerSize;
172 Bool useDevice;
173 Bool forceSWCursor;
174 /** Are we currently switched to a virtual terminal? If so, it is not
175 * safe to touch the hardware. */
176 Bool vtSwitch;
177 Bool useVbva;
178 int viewportX, viewportY;
179 VMMDevMemory *pVMMDevMemory;
180 VBVAMEMORY *pVbvaMemory;
181 Bool useDRI;
182 int cVisualConfigs;
183 __GLXvisualConfig *pVisualConfigs;
184 DRIInfoRec *pDRIInfo;
185 int drmFD;
186} VBOXRec, *VBOXPtr;
187
188typedef struct {
189 int dummy;
190} VBOXDRIContextRec, *VBOXDRIContextPtr;
191
192extern Bool vbox_init(int scrnIndex, VBOXPtr pVBox);
193extern Bool vbox_cursor_init (ScreenPtr pScreen);
194extern Bool vbox_open (ScrnInfoPtr pScrn, ScreenPtr pScreen, VBOXPtr pVBox);
195extern void vbox_close (ScrnInfoPtr pScrn, VBOXPtr pVBox);
196extern Bool vbox_device_available(VBOXPtr pVBox);
197
198extern Bool vboxEnableVbva(ScrnInfoPtr pScrn);
199extern Bool vboxDisableVbva(ScrnInfoPtr pScrn);
200
201extern Bool vboxEnableGraphicsCap(VBOXPtr pVBox);
202extern Bool vboxDisableGraphicsCap(VBOXPtr pVBox);
203
204extern Bool vboxGetDisplayChangeRequest(ScrnInfoPtr pScrn, uint32_t *pcx,
205 uint32_t *pcy, uint32_t *pcBits,
206 uint32_t *piDisplay);
207
208extern Bool vboxHostLikesVideoMode(ScrnInfoPtr pScrn, uint32_t cx, uint32_t cy, uint32_t cBits);
209extern Bool vboxSaveVideoMode(ScrnInfoPtr pScrn, uint32_t cx, uint32_t cy, uint32_t cBits);
210extern Bool vboxRetrieveVideoMode(ScrnInfoPtr pScrn, uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits);
211
212/* DRI stuff */
213extern Bool VBOXDRIScreenInit(ScrnInfoPtr pScrn, VBOXPtr pVBox);
214
215#endif /* _VBOXVIDEO_H_ */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette