VirtualBox

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

Last change on this file since 74334 was 71619, checked in by vboxsync, 7 years ago

DevVGA,VBoxC: Code cleanup in progress. bugref:9094

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