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