VirtualBox

source: vbox/trunk/include/VBox/VBoxVideo.h@ 3191

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

export to OSE

  • 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 * VirtualBox Video interface
3 */
4
5/*
6 * Copyright (C) 2006 InnoTek Systemberatung GmbH
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License as published by the Free Software Foundation,
12 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
13 * distribution. VirtualBox OSE is distributed in the hope that it will
14 * be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * If you received this file as part of a commercial VirtualBox
17 * distribution, then only the terms of your commercial VirtualBox
18 * license agreement apply instead of the previous paragraph.
19 */
20
21#ifndef __VBox_VBoxVideo_h__
22#define __VBox_VBoxVideo_h__
23
24#include <iprt/cdefs.h>
25#include <iprt/types.h>
26
27/*
28 * The last 4096 bytes of the guest VRAM contains the generic info for all
29 * DualView chunks: sizes and offsets of chunks. This is filled by miniport.
30 *
31 * Last 4096 bytes of each chunk contain chunk specific data: framebuffer info,
32 * etc. This is used exclusively by the corresponding instance of a display driver.
33 *
34 * The Virtual Graphics Adapter information in the guest VRAM is stored by the
35 * guest video driver using structures prepended by VBOXVIDEOINFOHDR.
36 *
37 * When the guest driver writes dword 0 to the VBE_DISPI_INDEX_CMONITORS,
38 * the host starts to process the info. The first element at the start of
39 * the 4096 bytes region should be normally be a LINK that points to
40 * actual information chain. That way the guest driver can have some
41 * fixed layout of the information memory block and just rewrite
42 * the link to point to relevant memory chain.
43 *
44 * The processing stops at the END element.
45 *
46 * The host can access the memory only when the port IO is processed.
47 * All data that will be needed later must be copied from these 4096 bytes.
48 * But other VRAM can be used by host until the mode is disabled.
49 *
50 * The guest driver writes dword 0xffffffff to the VBE_DISPI_INDEX_CMONITORS
51 * to disable the mode.
52 *
53 */
54
55#define VBOX_VIDEO_PRIMARY_SCREEN 0
56#define VBOX_VIDEO_NO_SCREEN ~0
57
58
59/* The size of the information. */
60#define VBOX_VIDEO_ADAPTER_INFORMATION_SIZE 4096
61#define VBOX_VIDEO_DISPLAY_INFORMATION_SIZE 4096
62
63
64/* The value for port IO to let the adapter to interpret the adapter memory. */
65#define VBOX_VIDEO_DISABLE_ADAPTER_MEMORY 0xFFFFFFFF
66
67/* The value for port IO to let the adapter to interpret the adapter memory. */
68#define VBOX_VIDEO_INTERPRET_ADAPTER_MEMORY 0x00000000
69
70/* The value for port IO to let the adapter to interpret the display memory.
71 * The display number is encoded in low 16 bits.
72 */
73#define VBOX_VIDEO_INTERPRET_DISPLAY_MEMORY_BASE 0x00010000
74
75/* The end of the information. */
76#define VBOX_VIDEO_INFO_TYPE_END 0
77/* Instructs the host to fetch the next VBOXVIDEOINFOHDR at the given offset of VRAM. */
78#define VBOX_VIDEO_INFO_TYPE_LINK 1
79/* Information about a display memory position. */
80#define VBOX_VIDEO_INFO_TYPE_DISPLAY 2
81/* Information about a screen. */
82#define VBOX_VIDEO_INFO_TYPE_SCREEN 3
83/* Information about host notifications for the driver. */
84#define VBOX_VIDEO_INFO_TYPE_HOST_EVENTS 4
85
86
87#pragma pack(1)
88typedef struct _VBOXVIDEOINFOHDR
89{
90 uint8_t u8Type;
91 uint8_t u8Reserved;
92 uint16_t u16Length;
93} VBOXVIDEOINFOHDR;
94
95
96typedef struct _VBOXVIDEOINFOLINK
97{
98 /* Relative offset in VRAM */
99 int32_t i32Offset;
100} VBOXVIDEOINFOLINK;
101
102
103/* Resides in adapter info memory. Describes a display VRAM chunk. */
104typedef struct _VBOXVIDEOINFODISPLAY
105{
106 /* Index of the framebuffer assigned by guest. */
107 uint32_t u32Index;
108
109 /* Absolute offset in VRAM of the framebuffer to be displayed on the monitor. */
110 uint32_t u32Offset;
111
112 /* The size of the memory that can be used for the screen. */
113 uint32_t u32FramebufferSize;
114
115 /* The size of the memory that is used for the Display information.
116 * The information is at u32Offset + u32FramebufferSize
117 */
118 uint32_t u32InformationSize;
119
120} VBOXVIDEOINFODISPLAY;
121
122
123/* Resides in display info area, describes the current video mode. */
124#define VBOX_VIDEO_INFO_SCREEN_F_NONE 0x00
125#define VBOX_VIDEO_INFO_SCREEN_F_ACTIVE 0x01
126
127typedef struct _VBOXVIDEOINFOSCREEN
128{
129 /* Physical X origin relative to the primary screen. */
130 int32_t xOrigin;
131
132 /* Physical Y origin relative to the primary screen. */
133 int32_t yOrigin;
134
135 /* The scan line size in bytes. */
136 uint32_t u32LineSize;
137
138 /* Width of the screen. */
139 uint16_t u16Width;
140
141 /* Height of the screen. */
142 uint16_t u16Height;
143
144 /* Color depth. */
145 uint8_t bitsPerPixel;
146
147 /* VBOX_VIDEO_INFO_SCREEN_F_* */
148 uint8_t u8Flags;
149} VBOXVIDEOINFOSCREEN;
150
151/* The guest initializes the structure to 0. The positions of the structure in the
152 * display info area must not be changed, host will update the structure. Guest checks
153 * the events and modifies the structure as a response to host.
154 */
155#define VBOX_VIDEO_INFO_HOST_EVENTS_F_NONE 0x00000000
156#define VBOX_VIDEO_INFO_HOST_EVENTS_F_VRDP_RESET 0x00000080
157
158typedef struct _VBOXVIDEOINFOHOSTEVENTS
159{
160 /* Host events. */
161 uint32_t fu32Events;
162} VBOXVIDEOINFOHOSTEVENTS;
163#pragma pack()
164
165#endif /* __VBox_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