VirtualBox

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

Last change on this file since 1004 was 1, checked in by vboxsync, 55 years ago

import

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.3 KB
Line 
1/** @file
2 *
3 * Linux Additions X11 graphics driver
4 */
5
6/*
7 * Copyright (C) 2006 InnoTek Systemberatung 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#define VBOX_MAJOR_VERSION 1
134#define VBOX_MINOR_VERSION 0
135#ifdef XORG_7X
136#define VBOX_PATCHLEVEL 1
137#else
138#define VBOX_PATCHLEVEL 0
139#endif
140
141/*XXX*/
142
143typedef struct _VBOXRec
144{
145 vbeInfoPtr pVbe;
146 EntityInfoPtr pEnt;
147 VbeInfoBlock *vbeInfo;
148 pciVideoPtr pciInfo;
149 PCITAG pciTag;
150 CARD16 maxBytesPerScanline;
151#ifdef XORG_7X
152 unsigned long mapPhys, mapOff;
153 int mapSize; /* video memory */
154#else
155 int mapPhys, mapOff, mapSize; /* video memory */
156#endif
157 void *base, *VGAbase;
158 CARD8 *state, *pstate; /* SVGA state */
159 int statePage, stateSize, stateMode;
160 CARD32 *savedPal;
161 CARD8 *fonts;
162 /* DGA info */
163 DGAModePtr pDGAMode;
164 int nDGAMode;
165 CloseScreenProcPtr CloseScreen;
166 OptionInfoPtr Options;
167#ifdef XORG_7X
168 IOADDRESS ioBase;
169#endif /* XORG_7X defined */
170 int vbox_fd;
171 VMMDevReqMousePointer *reqp;
172 xf86CursorInfoPtr pCurs;
173 Bool use_hw_cursor;
174 size_t set_pointer_shape_size;
175 Bool pointer_offscreen;
176 Bool useVbva;
177 VMMDevVideoAccelFlush *reqf;
178 VMMDevVideoAccelEnable *reqe;
179 VMMDevMemory *pVMMDevMemory;
180 VBVAMEMORY *pVbvaMemory;
181} VBOXRec, *VBOXPtr;
182
183#ifndef XORG_7X
184typedef struct _ModeInfoData {
185 int mode;
186 VbeModeInfoBlock *data;
187 VbeCRTCInfoBlock *block;
188} ModeInfoData;
189#endif
190
191Bool vbox_cursor_init (ScreenPtr pScreen);
192Bool vbox_open (ScrnInfoPtr pScrn, ScreenPtr pScreen, VBOXPtr pVBOX);
193void vbox_close (ScrnInfoPtr pScrn, VBOXPtr pVBOX);
194
195/**
196 * Inform VBox that we will supply it with dirty rectangle information.
197 * This function is intended to be called when an X virtual terminal is
198 * re-enabled. The dirty rectangle handler should be installed.
199 *
200 * @returns TRUE for success, FALSE for failure
201 * @param pScreen Pointer to a structure describing the X screen in use
202 */
203extern Bool
204vboxEnableVbva(ScrnInfoPtr pScrn);
205
206/**
207 * Inform VBox that we will stop supplying it with dirty rectangle
208 * information. This function is intended to be called when an X
209 * virtual terminal is disabled, or the X server is terminated.
210 *
211 * @returns TRUE for success, FALSE for failure
212 * @param pScreen Pointer to a structure describing the X screen in use
213 */
214extern Bool
215vboxDisableVbva(ScrnInfoPtr pScrn);
216
217#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