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 */
|
---|
40 | typedef struct PDMIDISPLAYCONNECTOR *HVBOXCRCMDCLTSCR;
|
---|
41 | struct VBVACMDHDR;
|
---|
42 |
|
---|
43 | typedef struct VBOXCMDVBVA_HDR *PVBOXCMDVBVA_HDR;
|
---|
44 |
|
---|
45 | typedef DECLCALLBACKPTR(void, PFNVBOXCRCMD_CLTSCR_UPDATE_BEGIN)(HVBOXCRCMDCLTSCR hClt, unsigned u32Screen);
|
---|
46 | typedef DECLCALLBACKPTR(void, PFNVBOXCRCMD_CLTSCR_UPDATE_END)(HVBOXCRCMDCLTSCR hClt, unsigned uScreenId, int32_t x, int32_t y, uint32_t cx, uint32_t cy);
|
---|
47 | typedef 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 */
|
---|
53 | typedef 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 |
|
---|
61 | typedef struct VBOXVDMAHOST * HVBOXCRCLIENT;
|
---|
62 | struct VBOXCRCMDCTL_CALLOUT_LISTENTRY;
|
---|
63 | typedef DECLCALLBACKPTR(void, PFNVBOXCRCMDCTL_CALLOUT_CB)(struct VBOXCRCMDCTL_CALLOUT_LISTENTRY *pEntry);
|
---|
64 |
|
---|
65 | #pragma pack(1)
|
---|
66 | typedef struct VBOXCRCMDCTL_CALLOUT_LISTENTRY
|
---|
67 | {
|
---|
68 | RTLISTNODE Node;
|
---|
69 | PFNVBOXCRCMDCTL_CALLOUT_CB pfnCb;
|
---|
70 | } VBOXCRCMDCTL_CALLOUT_LISTENTRY;
|
---|
71 |
|
---|
72 | typedef struct VBOXCRCMDCTL_CALLOUT_LIST
|
---|
73 | {
|
---|
74 | RTLISTANCHOR List;
|
---|
75 | } VBOXCRCMDCTL_CALLOUT_LIST;
|
---|
76 | #pragma pack()
|
---|
77 |
|
---|
78 | struct VBOXCRCMDCTL;
|
---|
79 |
|
---|
80 | typedef DECLCALLBACKPTR(int, PFNVBOXCRCLIENT_CALLOUT)(HVBOXCRCLIENT hClient, struct VBOXCRCMDCTL* pCmd, VBOXCRCMDCTL_CALLOUT_LISTENTRY *pEntry, PFNVBOXCRCMDCTL_CALLOUT_CB pfnCb);
|
---|
81 |
|
---|
82 | typedef struct VBOXCRCLIENT_INFO
|
---|
83 | {
|
---|
84 | HVBOXCRCLIENT hClient;
|
---|
85 | PFNVBOXCRCLIENT_CALLOUT pfnCallout;
|
---|
86 | } VBOXCRCLIENT_INFO;
|
---|
87 |
|
---|
88 | typedef 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 */
|
---|
93 | typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_ENABLE)(HVBOXCRCMDSVR hSvr, VBOXCRCMD_SVRENABLE_INFO *pInfo);
|
---|
94 | /** Opposite to Enable (see above) */
|
---|
95 | typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_DISABLE)(HVBOXCRCMDSVR hSvr);
|
---|
96 | /** process command */
|
---|
97 | typedef DECLCALLBACKPTR(int8_t, PFNVBOXCRCMD_SVR_CMD)(HVBOXCRCMDSVR hSvr,
|
---|
98 | const VBOXCMDVBVA_HDR RT_UNTRUSTED_VOLATILE_GUEST *pCmd, uint32_t cbCmd);
|
---|
99 | /** process host control */
|
---|
100 | typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_HOSTCTL)(HVBOXCRCMDSVR hSvr, uint8_t *pCtl, uint32_t cbCmd);
|
---|
101 | /** process guest control */
|
---|
102 | typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_GUESTCTL)(HVBOXCRCMDSVR hSvr, uint8_t RT_UNTRUSTED_VOLATILE_GUEST *pCtl,
|
---|
103 | uint32_t cbCmd);
|
---|
104 | /** screen resize */
|
---|
105 | typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_RESIZE)(HVBOXCRCMDSVR hSvr, const struct VBVAINFOSCREEN *pScreen,
|
---|
106 | const uint32_t *pTargetMap);
|
---|
107 | /** process SaveState */
|
---|
108 | typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_SAVESTATE)(HVBOXCRCMDSVR hSvr, PSSMHANDLE pSSM);
|
---|
109 | /** process LoadState */
|
---|
110 | typedef DECLCALLBACKPTR(int, PFNVBOXCRCMD_SVR_LOADSTATE)(HVBOXCRCMDSVR hSvr, PSSMHANDLE pSSM, uint32_t u32Version);
|
---|
111 |
|
---|
112 |
|
---|
113 | typedef 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 |
|
---|
127 | typedef 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 |
|
---|
142 | typedef 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 |
|
---|
152 | typedef 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 |
|
---|
167 | typedef struct VBOXCRCMDCTL_HGCM
|
---|
168 | {
|
---|
169 | VBOXCRCMDCTL Hdr;
|
---|
170 | VBOXHGCMSVCPARM aParms[1];
|
---|
171 | } VBOXCRCMDCTL_HGCM;
|
---|
172 | #pragma pack()
|
---|
173 |
|
---|
174 | typedef struct VBOXVDMAHOST * HVBOXCRCMDCTL_REMAINING_HOST_COMMAND;
|
---|
175 |
|
---|
176 | typedef DECLCALLBACKPTR(uint8_t*, PFNVBOXCRCMDCTL_REMAINING_HOST_COMMAND)(HVBOXCRCMDCTL_REMAINING_HOST_COMMAND hClient, uint32_t *pcbCtl, int prevCmdRc);
|
---|
177 |
|
---|
178 | typedef struct VBOXCRCMDCTL_HGCMENABLE_DATA
|
---|
179 | {
|
---|
180 | HVBOXCRCMDCTL_REMAINING_HOST_COMMAND hRHCmd;
|
---|
181 | PFNVBOXCRCMDCTL_REMAINING_HOST_COMMAND pfnRHCmd;
|
---|
182 | } VBOXCRCMDCTL_HGCMENABLE_DATA;
|
---|
183 |
|
---|
184 | typedef struct VBOXVDMAHOST * HVBOXCRCMDCTL_NOTIFY_TERMINATING;
|
---|
185 |
|
---|
186 | typedef DECLCALLBACKPTR(int, PFNVBOXCRCMDCTL_NOTIFY_TERMINATING)(HVBOXCRCMDCTL_NOTIFY_TERMINATING hClient, VBOXCRCMDCTL_HGCMENABLE_DATA *pHgcmEnableData);
|
---|
187 |
|
---|
188 | typedef DECLCALLBACKPTR(void, PFNVBOXCRCMDCTL_NOTIFY_TERMINATING_DONE)(HVBOXCRCMDCTL_NOTIFY_TERMINATING hClient);
|
---|
189 |
|
---|
190 | typedef 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)
|
---|
198 | typedef struct VBOXCRCMDCTL_ENABLE
|
---|
199 | {
|
---|
200 | VBOXCRCMDCTL Hdr;
|
---|
201 | VBOXCRCMDCTL_HGCMENABLE_DATA Data;
|
---|
202 | } VBOXCRCMDCTL_ENABLE;
|
---|
203 |
|
---|
204 | typedef 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 |
|
---|