VirtualBox

source: vbox/trunk/include/VBox/Graphics/VBoxVideoHost3D.h@ 79304

Last change on this file since 79304 was 76585, checked in by vboxsync, 6 years ago

*: scm --fix-header-guard-endif

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.3 KB
Line 
1/* $Id: VBoxVideoHost3D.h 76585 2019-01-01 06:31:29Z vboxsync $ */
2/** @file
3 * VirtualBox 3D host inter-components interfaces
4 */
5
6/*
7 * Copyright (C) 2011-2019 Oracle Corporation
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 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27#ifndef VBOX_INCLUDED_Graphics_VBoxVideoHost3D_h
28#define VBOX_INCLUDED_Graphics_VBoxVideoHost3D_h
29#ifndef RT_WITHOUT_PRAGMA_ONCE
30# pragma once
31#endif
32
33#include <iprt/cdefs.h>
34#include "VBoxVideo.h"
35#include <VBox/hgcmsvc.h>
36#include <VBox/vmm/pdmifs.h>
37#include <iprt/list.h>
38
39/* screen update instance */
40typedef struct PDMIDISPLAYCONNECTOR *HVBOXCRCMDCLTSCR;
41struct VBVACMDHDR;
42
43typedef struct VBOXCMDVBVA_HDR *PVBOXCMDVBVA_HDR;
44
45typedef DECLCALLBACKPTR(void, PFNVBOXCRCMD_CLTSCR_UPDATE_BEGIN)(HVBOXCRCMDCLTSCR hClt, unsigned u32Screen);
46typedef DECLCALLBACKPTR(void, PFNVBOXCRCMD_CLTSCR_UPDATE_END)(HVBOXCRCMDCLTSCR hClt, unsigned uScreenId, int32_t x, int32_t y, uint32_t cx, uint32_t cy);
47typedef DECLCALLBACKPTR(void, PFNVBOXCRCMD_CLTSCR_UPDATE_PROCESS)(HVBOXCRCMDCLTSCR hClt, unsigned u32Screen,
48 struct VBVACMDHDR const RT_UNTRUSTED_VOLATILE_GUEST *pCmd,
49 size_t cbCmd);
50
51/*client callbacks to be used by the server
52 * when working in the CrCmd mode */
53typedef struct VBOXCRCMD_SVRENABLE_INFO
54{
55 HVBOXCRCMDCLTSCR hCltScr;
56 PFNVBOXCRCMD_CLTSCR_UPDATE_BEGIN pfnCltScrUpdateBegin;
57 PFNVBOXCRCMD_CLTSCR_UPDATE_PROCESS pfnCltScrUpdateProcess;
58 PFNVBOXCRCMD_CLTSCR_UPDATE_END pfnCltScrUpdateEnd;
59} VBOXCRCMD_SVRENABLE_INFO;
60
61typedef struct VBOXVDMAHOST * HVBOXCRCLIENT;
62struct VBOXCRCMDCTL_CALLOUT_LISTENTRY;
63typedef DECLCALLBACKPTR(void, PFNVBOXCRCMDCTL_CALLOUT_CB)(struct VBOXCRCMDCTL_CALLOUT_LISTENTRY *pEntry);
64
65#pragma pack(1)
66typedef struct VBOXCRCMDCTL_CALLOUT_LISTENTRY
67{
68 RTLISTNODE Node;
69 PFNVBOXCRCMDCTL_CALLOUT_CB pfnCb;
70} VBOXCRCMDCTL_CALLOUT_LISTENTRY;
71
72typedef struct VBOXCRCMDCTL_CALLOUT_LIST
73{
74 RTLISTANCHOR List;
75} VBOXCRCMDCTL_CALLOUT_LIST;
76#pragma pack()
77
78struct VBOXCRCMDCTL;
79
80typedef DECLCALLBACKPTR(int, PFNVBOXCRCLIENT_CALLOUT)(HVBOXCRCLIENT hClient, struct VBOXCRCMDCTL* pCmd, VBOXCRCMDCTL_CALLOUT_LISTENTRY *pEntry, PFNVBOXCRCMDCTL_CALLOUT_CB pfnCb);
81
82typedef struct VBOXCRCLIENT_INFO
83{
84 HVBOXCRCLIENT hClient;
85 PFNVBOXCRCLIENT_CALLOUT pfnCallout;
86} VBOXCRCLIENT_INFO;
87
88typedef void * HVBOXCRCMDSVR;
89
90/** enables the CrCmd interface, thus the hgcm interface gets disabled.
91 * all subsequent calls will be done in the thread Enable was done,
92 * until the Disable is called */
93typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_ENABLE)(HVBOXCRCMDSVR hSvr, VBOXCRCMD_SVRENABLE_INFO *pInfo);
94/** Opposite to Enable (see above) */
95typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_DISABLE)(HVBOXCRCMDSVR hSvr);
96/** process command */
97typedef DECLCALLBACKPTR(int8_t, PFNVBOXCRCMD_SVR_CMD)(HVBOXCRCMDSVR hSvr,
98 const VBOXCMDVBVA_HDR RT_UNTRUSTED_VOLATILE_GUEST *pCmd, uint32_t cbCmd);
99/** process host control */
100typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_HOSTCTL)(HVBOXCRCMDSVR hSvr, uint8_t *pCtl, uint32_t cbCmd);
101/** process guest control */
102typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_GUESTCTL)(HVBOXCRCMDSVR hSvr, uint8_t RT_UNTRUSTED_VOLATILE_GUEST *pCtl,
103 uint32_t cbCmd);
104/** screen resize */
105typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_RESIZE)(HVBOXCRCMDSVR hSvr, const struct VBVAINFOSCREEN *pScreen,
106 const uint32_t *pTargetMap);
107/** process SaveState */
108typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_SAVESTATE)(HVBOXCRCMDSVR hSvr, PSSMHANDLE pSSM);
109/** process LoadState */
110typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_LOADSTATE)(HVBOXCRCMDSVR hSvr, PSSMHANDLE pSSM, uint32_t u32Version);
111
112
113typedef struct VBOXCRCMD_SVRINFO
114{
115 HVBOXCRCMDSVR hSvr;
116 PFNVBOXCRCMD_SVR_ENABLE pfnEnable;
117 PFNVBOXCRCMD_SVR_DISABLE pfnDisable;
118 PFNVBOXCRCMD_SVR_CMD pfnCmd;
119 PFNVBOXCRCMD_SVR_HOSTCTL pfnHostCtl;
120 PFNVBOXCRCMD_SVR_GUESTCTL pfnGuestCtl;
121 PFNVBOXCRCMD_SVR_RESIZE pfnResize;
122 PFNVBOXCRCMD_SVR_SAVESTATE pfnSaveState;
123 PFNVBOXCRCMD_SVR_LOADSTATE pfnLoadState;
124} VBOXCRCMD_SVRINFO;
125
126
127typedef struct VBOXVDMACMD_CHROMIUM_CTL_CRHGSMI_SETUP
128{
129 VBOXVDMACMD_CHROMIUM_CTL Hdr;
130 union
131 {
132 void *pvVRamBase;
133 uint64_t uAlignment;
134 } RT_UNION_NM(u);
135 uint64_t cbVRam;
136 PPDMLED pLed;
137 VBOXCRCLIENT_INFO CrClientInfo;
138 /* out */
139 struct VBOXCRCMD_SVRINFO CrCmdServerInfo;
140} VBOXVDMACMD_CHROMIUM_CTL_CRHGSMI_SETUP, *PVBOXVDMACMD_CHROMIUM_CTL_CRHGSMI_SETUP;
141
142typedef enum
143{
144 VBOXCRCMDCTL_TYPE_HGCM = 1,
145 VBOXCRCMDCTL_TYPE_DISABLE,
146 VBOXCRCMDCTL_TYPE_ENABLE,
147 VBOXCRCMDCTL_TYPE_32bit = 0x7fffffff
148} VBOXCRCMDCTL_TYPE;
149
150#pragma pack(1)
151
152typedef struct VBOXCRCMDCTL
153{
154 VBOXCRCMDCTL_TYPE enmType;
155 uint32_t u32Function;
156 /* not to be used by clients */
157 VBOXCRCMDCTL_CALLOUT_LIST CalloutList;
158 union
159 {
160 PFNRT pfnInternal;
161 void *pvInternal;
162 } u;
163} VBOXCRCMDCTL;
164
165#define VBOXCRCMDCTL_IS_CALLOUT_AVAILABLE(_pCtl) (!!((_pCtl)->CalloutList.List.pNext))
166
167typedef struct VBOXCRCMDCTL_HGCM
168{
169 VBOXCRCMDCTL Hdr;
170 VBOXHGCMSVCPARM aParms[1];
171} VBOXCRCMDCTL_HGCM;
172#pragma pack()
173
174typedef struct VBOXVDMAHOST * HVBOXCRCMDCTL_REMAINING_HOST_COMMAND;
175
176typedef DECLCALLBACKPTR(uint8_t*, PFNVBOXCRCMDCTL_REMAINING_HOST_COMMAND)(HVBOXCRCMDCTL_REMAINING_HOST_COMMAND hClient, uint32_t *pcbCtl, int prevCmdRc);
177
178typedef struct VBOXCRCMDCTL_HGCMENABLE_DATA
179{
180 HVBOXCRCMDCTL_REMAINING_HOST_COMMAND hRHCmd;
181 PFNVBOXCRCMDCTL_REMAINING_HOST_COMMAND pfnRHCmd;
182} VBOXCRCMDCTL_HGCMENABLE_DATA;
183
184typedef struct VBOXVDMAHOST * HVBOXCRCMDCTL_NOTIFY_TERMINATING;
185
186typedef DECLCALLBACKPTR(int, PFNVBOXCRCMDCTL_NOTIFY_TERMINATING)(HVBOXCRCMDCTL_NOTIFY_TERMINATING hClient, VBOXCRCMDCTL_HGCMENABLE_DATA *pHgcmEnableData);
187
188typedef DECLCALLBACKPTR(void, PFNVBOXCRCMDCTL_NOTIFY_TERMINATING_DONE)(HVBOXCRCMDCTL_NOTIFY_TERMINATING hClient);
189
190typedef struct VBOXCRCMDCTL_HGCMDISABLE_DATA
191{
192 HVBOXCRCMDCTL_NOTIFY_TERMINATING hNotifyTerm;
193 PFNVBOXCRCMDCTL_NOTIFY_TERMINATING pfnNotifyTerm;
194 PFNVBOXCRCMDCTL_NOTIFY_TERMINATING_DONE pfnNotifyTermDone;
195} VBOXCRCMDCTL_HGCMDISABLE_DATA;
196
197#pragma pack(1)
198typedef struct VBOXCRCMDCTL_ENABLE
199{
200 VBOXCRCMDCTL Hdr;
201 VBOXCRCMDCTL_HGCMENABLE_DATA Data;
202} VBOXCRCMDCTL_ENABLE;
203
204typedef struct VBOXCRCMDCTL_DISABLE
205{
206 VBOXCRCMDCTL Hdr;
207 VBOXCRCMDCTL_HGCMDISABLE_DATA Data;
208} VBOXCRCMDCTL_DISABLE;
209#pragma pack()
210
211#endif /* !VBOX_INCLUDED_Graphics_VBoxVideoHost3D_h */
212
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