VirtualBox

source: vbox/trunk/include/VBox/Graphics/VBoxVideoGuest.h@ 74948

Last change on this file since 74948 was 71651, checked in by vboxsync, 7 years ago

DevVGA,VBoxC,++: Code cleanup in progress. bugref:9094

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 9.0 KB
Line 
1/* $Id: VBoxVideoGuest.h 71651 2018-04-04 12:20:08Z vboxsync $ */
2/** @file
3 * VBox Host Guest Shared Memory Interface (HGSMI) - OS-independent guest structures.
4 */
5
6/*
7 * Copyright (C) 2006-2017 Oracle Corporation
8 *
9 * Permission is hereby granted, free of charge, to any person
10 * obtaining a copy of this software and associated documentation
11 * files (the "Software"), to deal in the Software without
12 * restriction, including without limitation the rights to use,
13 * copy, modify, merge, publish, distribute, sublicense, and/or sell
14 * copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following
16 * conditions:
17 *
18 * The above copyright notice and this permission notice shall be
19 * included in all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28 * OTHER DEALINGS IN THE SOFTWARE.
29 */
30
31
32#ifndef ___VBox_Graphics_VBoxVideoGuest_h___
33#define ___VBox_Graphics_VBoxVideoGuest_h___
34
35#include "VBoxVideoIPRT.h"
36#include "HGSMIBase.h"
37#include "VBoxVideo.h"
38
39RT_C_DECLS_BEGIN
40
41/**
42 * Structure grouping the context needed for sending graphics acceleration
43 * information to the host via VBVA. Each screen has its own VBVA buffer.
44 */
45typedef struct VBVABUFFERCONTEXT
46{
47 /** Offset of the buffer in the VRAM section for the screen */
48 uint32_t offVRAMBuffer;
49 /** Length of the buffer in bytes */
50 uint32_t cbBuffer;
51 /** This flag is set if we wrote to the buffer faster than the host could
52 * read it. */
53 bool fHwBufferOverflow;
54 /** The VBVA record that we are currently preparing for the host, NULL if
55 * none. */
56 struct VBVARECORD *pRecord;
57 /** Pointer to the VBVA buffer mapped into the current address space. Will
58 * be NULL if VBVA is not enabled. */
59 struct VBVABUFFER *pVBVA;
60} VBVABUFFERCONTEXT, *PVBVABUFFERCONTEXT;
61
62/** @name Base HGSMI APIs
63 * @{ */
64
65DECLHIDDEN(bool) VBoxHGSMIIsSupported(void);
66DECLHIDDEN(void) VBoxHGSMIGetBaseMappingInfo(uint32_t cbVRAM,
67 uint32_t *poffVRAMBaseMapping,
68 uint32_t *pcbMapping,
69 uint32_t *poffGuestHeapMemory,
70 uint32_t *pcbGuestHeapMemory,
71 uint32_t *poffHostFlags);
72DECLHIDDEN(int) VBoxHGSMIReportFlagsLocation(PHGSMIGUESTCOMMANDCONTEXT pCtx,
73 HGSMIOFFSET offLocation);
74DECLHIDDEN(int) VBoxHGSMISendCapsInfo(PHGSMIGUESTCOMMANDCONTEXT pCtx,
75 uint32_t fCaps);
76DECLHIDDEN(void) VBoxHGSMIGetHostAreaMapping(PHGSMIGUESTCOMMANDCONTEXT pCtx,
77 uint32_t cbVRAM,
78 uint32_t offVRAMBaseMapping,
79 uint32_t *poffVRAMHostArea,
80 uint32_t *pcbHostArea);
81DECLHIDDEN(int) VBoxHGSMISendHostCtxInfo(PHGSMIGUESTCOMMANDCONTEXT pCtx,
82 HGSMIOFFSET offVRAMFlagsLocation,
83 uint32_t fCaps,
84 uint32_t offVRAMHostArea,
85 uint32_t cbHostArea);
86DECLHIDDEN(int) VBoxQueryConfHGSMI(PHGSMIGUESTCOMMANDCONTEXT pCtx,
87 uint32_t u32Index, uint32_t *pulValue);
88DECLHIDDEN(int) VBoxQueryConfHGSMIDef(PHGSMIGUESTCOMMANDCONTEXT pCtx,
89 uint32_t u32Index, uint32_t u32DefValue, uint32_t *pulValue);
90DECLHIDDEN(int) VBoxHGSMIUpdatePointerShape(PHGSMIGUESTCOMMANDCONTEXT pCtx,
91 uint32_t fFlags,
92 uint32_t cHotX,
93 uint32_t cHotY,
94 uint32_t cWidth,
95 uint32_t cHeight,
96 uint8_t *pPixels,
97 uint32_t cbLength);
98DECLHIDDEN(int) VBoxHGSMICursorPosition(PHGSMIGUESTCOMMANDCONTEXT pCtx, bool fReportPosition, uint32_t x, uint32_t y,
99 uint32_t *pxHost, uint32_t *pyHost);
100
101/** @} */
102
103/** @name VBVA APIs
104 * @{ */
105DECLHIDDEN(bool) VBoxVBVAEnable(PVBVABUFFERCONTEXT pCtx,
106 PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx,
107 struct VBVABUFFER *pVBVA, int32_t cScreen);
108DECLHIDDEN(void) VBoxVBVADisable(PVBVABUFFERCONTEXT pCtx,
109 PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx,
110 int32_t cScreen);
111DECLHIDDEN(bool) VBoxVBVABufferBeginUpdate(PVBVABUFFERCONTEXT pCtx,
112 PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx);
113DECLHIDDEN(void) VBoxVBVABufferEndUpdate(PVBVABUFFERCONTEXT pCtx);
114DECLHIDDEN(bool) VBoxVBVAWrite(PVBVABUFFERCONTEXT pCtx,
115 PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx,
116 const void *pv, uint32_t cb);
117DECLHIDDEN(bool) VBoxVBVAOrderSupported(PVBVABUFFERCONTEXT pCtx, unsigned code);
118DECLHIDDEN(void) VBoxVBVASetupBufferContext(PVBVABUFFERCONTEXT pCtx,
119 uint32_t offVRAMBuffer,
120 uint32_t cbBuffer);
121
122/** @} */
123
124/** @name Modesetting APIs
125 * @{ */
126
127DECLHIDDEN(uint32_t) VBoxHGSMIGetMonitorCount(PHGSMIGUESTCOMMANDCONTEXT pCtx);
128DECLHIDDEN(bool) VBoxVGACfgAvailable(void);
129DECLHIDDEN(bool) VBoxVGACfgQuery(uint16_t u16Id, uint32_t *pu32Value, uint32_t u32DefValue);
130DECLHIDDEN(uint32_t) VBoxVideoGetVRAMSize(void);
131DECLHIDDEN(bool) VBoxVideoAnyWidthAllowed(void);
132DECLHIDDEN(uint16_t) VBoxHGSMIGetScreenFlags(PHGSMIGUESTCOMMANDCONTEXT pCtx);
133
134struct VBVAINFOVIEW;
135/**
136 * Callback funtion called from @a VBoxHGSMISendViewInfo to initialise
137 * the @a VBVAINFOVIEW structure for each screen.
138 *
139 * @returns iprt status code
140 * @param pvData context data for the callback, passed to @a
141 * VBoxHGSMISendViewInfo along with the callback
142 * @param pInfo array of @a VBVAINFOVIEW structures to be filled in
143 * @todo explicitly pass the array size
144 */
145typedef DECLCALLBACK(int) FNHGSMIFILLVIEWINFO(void *pvData,
146 struct VBVAINFOVIEW *pInfo,
147 uint32_t cViews);
148/** Pointer to a FNHGSMIFILLVIEWINFO callback */
149typedef FNHGSMIFILLVIEWINFO *PFNHGSMIFILLVIEWINFO;
150
151DECLHIDDEN(int) VBoxHGSMISendViewInfo(PHGSMIGUESTCOMMANDCONTEXT pCtx,
152 uint32_t u32Count,
153 PFNHGSMIFILLVIEWINFO pfnFill,
154 void *pvData);
155DECLHIDDEN(void) VBoxVideoSetModeRegisters(uint16_t cWidth, uint16_t cHeight,
156 uint16_t cVirtWidth, uint16_t cBPP,
157 uint16_t fFlags,
158 uint16_t cx, uint16_t cy);
159DECLHIDDEN(bool) VBoxVideoGetModeRegisters(uint16_t *pcWidth,
160 uint16_t *pcHeight,
161 uint16_t *pcVirtWidth,
162 uint16_t *pcBPP,
163 uint16_t *pfFlags);
164DECLHIDDEN(void) VBoxVideoDisableVBE(void);
165DECLHIDDEN(void) VBoxHGSMIProcessDisplayInfo(PHGSMIGUESTCOMMANDCONTEXT pCtx,
166 uint32_t cDisplay,
167 int32_t cOriginX,
168 int32_t cOriginY,
169 uint32_t offStart,
170 uint32_t cbPitch,
171 uint32_t cWidth,
172 uint32_t cHeight,
173 uint16_t cBPP,
174 uint16_t fFlags);
175DECLHIDDEN(int) VBoxHGSMIUpdateInputMapping(PHGSMIGUESTCOMMANDCONTEXT pCtx, int32_t cOriginX, int32_t cOriginY,
176 uint32_t cWidth, uint32_t cHeight);
177DECLHIDDEN(int) VBoxHGSMIGetModeHints(PHGSMIGUESTCOMMANDCONTEXT pCtx,
178 unsigned cScreens, VBVAMODEHINT *paHints);
179
180/** @} */
181
182RT_C_DECLS_END
183
184#endif
185
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