VirtualBox

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

Last change on this file since 7168 was 7168, checked in by vboxsync, 17 years ago

Additions/X11: updated mode setting in the X11 additions

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.6 KB
Line 
1/** @file
2 *
3 * VirtualBox X11 Additions graphics driver
4 */
5
6/*
7 * Copyright (C) 2006-2007 innotek GmbH
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 *
18 * This code is based on:
19 *
20 * X11 VESA driver
21 *
22 * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
23 *
24 * Permission is hereby granted, free of charge, to any person obtaining a
25 * copy of this software and associated documentation files (the "Software"),
26 * to deal in the Software without restriction, including without limitation
27 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
28 * and/or sell copies of the Software, and to permit persons to whom the
29 * Software is furnished to do so, subject to the following conditions:
30 *
31 * The above copyright notice and this permission notice shall be included in
32 * all copies or substantial portions of the Software.
33 *
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
37 * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
39 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40 * SOFTWARE.
41 *
42 * Except as contained in this notice, the name of Conectiva Linux shall
43 * not be used in advertising or otherwise to promote the sale, use or other
44 * dealings in this Software without prior written authorization from
45 * Conectiva Linux.
46 *
47 * Authors: Paulo C�ar Pereira de Andrade <[email protected]>
48 *
49 * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.9 2001/05/04 19:05:49 dawes Exp $
50 */
51
52#ifndef _VBOXVIDEO_H_
53#define _VBOXVIDEO_H_
54
55#include <VBox/VBoxGuest.h>
56
57/* All drivers should typically include these */
58#include "xf86.h"
59#include "xf86_OSproc.h"
60#include "xf86Resources.h"
61
62/* All drivers need this */
63#include "xf86_ansic.h"
64
65#include "compiler.h"
66
67/* Drivers for PCI hardware need this */
68#include "xf86PciInfo.h"
69
70#include "vgaHW.h"
71
72/* Drivers that need to access the PCI config space directly need this */
73#include "xf86Pci.h"
74
75/* VBE/DDC support */
76#include "vbe.h"
77#ifdef XORG_7X
78#include "vbeModes.h"
79#endif
80#include "xf86DDC.h"
81
82/* ShadowFB support */
83#include "shadow.h"
84
85#include "shadowfb.h"
86
87/* VBox video related defines */
88
89#define VBE_DISPI_IOPORT_INDEX 0x01CE
90#define VBE_DISPI_IOPORT_DATA 0x01CF
91#define VBE_DISPI_INDEX_ID 0x0
92#define VBE_DISPI_INDEX_XRES 0x1
93#define VBE_DISPI_INDEX_YRES 0x2
94#define VBE_DISPI_INDEX_BPP 0x3
95#define VBE_DISPI_INDEX_ENABLE 0x4
96#define VBE_DISPI_INDEX_VIRT_WIDTH 0x6
97#define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7
98#define VBE_DISPI_ID2 0xB0C2
99#define VBE_DISPI_DISABLED 0x00
100#define VBE_DISPI_ENABLED 0x01
101#define VBE_DISPI_LFB_ENABLED 0x40
102
103/* Int 10 support */
104#include "xf86int10.h"
105
106/* bank switching */
107#include "mibank.h"
108
109/* Dga definitions */
110#include "dgaproc.h"
111
112#include "xf86Resources.h"
113#include "xf86RAC.h"
114
115#include "xf1bpp.h"
116#include "xf4bpp.h"
117#include "fb.h"
118#include "afb.h"
119#include "mfb.h"
120#ifndef XORG_7X
121#include "cfb24_32.h"
122#endif
123
124#define VBOX_VERSION 4000
125#include "xf86Cursor.h"
126#define VBOX_NAME "VBoxVideo"
127#define VBOX_DRIVER_NAME "vboxvideo"
128
129/*XXX*/
130
131typedef struct _VBOXRec
132{
133 vbeInfoPtr pVbe;
134 EntityInfoPtr pEnt;
135 VbeInfoBlock *vbeInfo;
136 pciVideoPtr pciInfo;
137 PCITAG pciTag;
138 CARD16 maxBytesPerScanline;
139#ifdef XORG_7X
140 unsigned long mapPhys, mapOff;
141 int mapSize; /* video memory */
142#else
143 int mapPhys, mapOff, mapSize; /* video memory */
144#endif
145 void *base, *VGAbase;
146 CARD8 *state, *pstate; /* SVGA state */
147 int statePage, stateSize, stateMode;
148 CARD32 *savedPal;
149 CARD8 *fonts;
150 /* DGA info */
151 DGAModePtr pDGAMode;
152 int nDGAMode;
153 CloseScreenProcPtr CloseScreen;
154 OptionInfoPtr Options;
155#ifdef XORG_7X
156 IOADDRESS ioBase;
157#endif /* XORG_7X defined */
158#if 0
159 int vbox_fd;
160#endif
161 VMMDevReqMousePointer *reqp;
162 xf86CursorInfoPtr pCurs;
163 Bool useHwCursor;
164 size_t pointerHeaderSize;
165 size_t pointerSize;
166 Bool pointerOffscreen;
167 Bool useVbva;
168#if 0
169 VMMDevVideoAccelFlush *reqf;
170 VMMDevVideoAccelEnable *reqe;
171#endif
172 VMMDevMemory *pVMMDevMemory;
173 VBVAMEMORY *pVbvaMemory;
174} VBOXRec, *VBOXPtr;
175
176#ifndef XORG_7X
177typedef struct _ModeInfoData
178{
179 int mode;
180 VbeModeInfoBlock *data;
181 VbeCRTCInfoBlock *block;
182} ModeInfoData;
183#endif
184
185extern Bool vbox_init(int scrnIndex);
186extern Bool vbox_cursor_init (ScreenPtr pScreen);
187extern Bool vbox_open (ScrnInfoPtr pScrn, ScreenPtr pScreen, VBOXPtr pVBOX);
188extern void vbox_close (ScrnInfoPtr pScrn, VBOXPtr pVBOX);
189
190extern Bool vboxEnableVbva(ScrnInfoPtr pScrn);
191
192extern Bool vboxDisableVbva(ScrnInfoPtr pScrn);
193
194extern Bool vboxGetDisplayChangeRequest(ScrnInfoPtr pScrn, uint32_t *pcx,
195 uint32_t *pcy, uint32_t *pcBits,
196 uint32_t *piDisplay);
197
198#endif /* _VBOXVIDEO_H_ */
Note: See TracBrowser for help on using the repository browser.

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