VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_68.h@ 7595

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

Additions/x11: * fix for the case in which the video driver is loaded but the mouse driver not - in this case the mouse pointer will be drawn in software. * More logging clean-ups

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.2 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#include "xf86DDC.h"
78
79/* ShadowFB support */
80#include "shadow.h"
81
82#include "shadowfb.h"
83
84/* VBox video related defines */
85
86#define VBE_DISPI_IOPORT_INDEX 0x01CE
87#define VBE_DISPI_IOPORT_DATA 0x01CF
88#define VBE_DISPI_INDEX_ID 0x0
89#define VBE_DISPI_INDEX_XRES 0x1
90#define VBE_DISPI_INDEX_YRES 0x2
91#define VBE_DISPI_INDEX_BPP 0x3
92#define VBE_DISPI_INDEX_ENABLE 0x4
93#define VBE_DISPI_INDEX_VIRT_WIDTH 0x6
94#define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7
95#define VBE_DISPI_ID2 0xB0C2
96#define VBE_DISPI_DISABLED 0x00
97#define VBE_DISPI_ENABLED 0x01
98#define VBE_DISPI_LFB_ENABLED 0x40
99
100/* Int 10 support */
101#include "xf86int10.h"
102
103/* bank switching */
104#include "mibank.h"
105
106/* Dga definitions */
107#include "dgaproc.h"
108
109#include "xf86Resources.h"
110#include "xf86RAC.h"
111
112#include "xf1bpp.h"
113#include "xf4bpp.h"
114#include "fb.h"
115#include "afb.h"
116#include "mfb.h"
117
118#define VBOX_VERSION 4000
119#include "xf86Cursor.h"
120#define VBOX_NAME "VBoxVideo"
121#define VBOX_DRIVER_NAME "vboxvideo"
122
123/*XXX*/
124
125typedef struct _VBOXRec
126{
127 vbeInfoPtr pVbe;
128 EntityInfoPtr pEnt;
129 VbeInfoBlock *vbeInfo;
130 pciVideoPtr pciInfo;
131 PCITAG pciTag;
132 CARD16 maxBytesPerScanline;
133 int mapPhys, mapOff, mapSize; /* video memory */
134 void *base, *VGAbase;
135 CARD8 *state, *pstate; /* SVGA state */
136 int statePage, stateSize, stateMode;
137 CARD32 *savedPal;
138 CARD8 *fonts;
139 /* DGA info */
140 DGAModePtr pDGAMode;
141 int nDGAMode;
142 CloseScreenProcPtr CloseScreen;
143 OptionInfoPtr Options;
144 int vbox_fd;
145 VMMDevReqMousePointer *reqp;
146 xf86CursorInfoPtr pCurs;
147 size_t pointerHeaderSize;
148 size_t pointerSize;
149 Bool pointerOffscreen;
150 Bool useVbva;
151 VMMDevVideoAccelFlush *reqf;
152 VMMDevVideoAccelEnable *reqe;
153 VMMDevMemory *pVMMDevMemory;
154 VBVAMEMORY *pVbvaMemory;
155} VBOXRec, *VBOXPtr;
156
157typedef struct _ModeInfoData
158{
159 int mode;
160 VbeModeInfoBlock *data;
161 VbeCRTCInfoBlock *block;
162} ModeInfoData;
163
164Bool vbox_cursor_init (ScreenPtr pScreen);
165Bool vbox_open (ScrnInfoPtr pScrn, ScreenPtr pScreen, VBOXPtr pVBOX);
166void vbox_close (ScrnInfoPtr pScrn, VBOXPtr pVBOX);
167
168extern Bool vboxEnableVbva(ScrnInfoPtr pScrn);
169
170extern Bool vboxDisableVbva(ScrnInfoPtr pScrn);
171
172extern Bool vboxGetDisplayChangeRequest(ScrnInfoPtr pScrn, uint32_t *pcx,
173 uint32_t *pcy, uint32_t *pcBits,
174 uint32_t *piDisplay);
175
176#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