VirtualBox

source: vbox/trunk/src/VBox/Additions/linux/xgraphics/vboxvideo.h@ 2981

Last change on this file since 2981 was 2981, checked in by vboxsync, 18 years ago

InnoTek -> innotek: all the headers and comments.

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