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