VirtualBox

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

最後變更 在這個檔案從68672是 68672,由 vboxsync 提交於 7 年 前

include file build fixes (kmk -C include)

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette