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