1 | /* $Id: VBoxGaDriver.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox Windows Guest Mesa3D - Gallium driver interface.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2016-2024 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef GA_INCLUDED_3D_WIN_VBoxGaDriver_h
|
---|
29 | #define GA_INCLUDED_3D_WIN_VBoxGaDriver_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include <VBoxGaHWInfo.h>
|
---|
35 | #include <VBoxGaTypes.h>
|
---|
36 |
|
---|
37 | #include <iprt/win/windows.h>
|
---|
38 |
|
---|
39 | #ifdef __cplusplus
|
---|
40 | extern "C" {
|
---|
41 | #endif
|
---|
42 |
|
---|
43 | typedef struct WDDMGalliumDriverEnv
|
---|
44 | {
|
---|
45 | /* Size of the structure. */
|
---|
46 | DWORD cb;
|
---|
47 | const VBOXGAHWINFO *pHWInfo;
|
---|
48 | /* The environment context pointer to use in the following callbacks. */
|
---|
49 | void *pvEnv;
|
---|
50 | /* The callbacks to use by the driver. */
|
---|
51 | DECLCALLBACKMEMBER(uint32_t, pfnContextCreate,(void *pvEnv,
|
---|
52 | boolean extended,
|
---|
53 | boolean vgpu10));
|
---|
54 | DECLCALLBACKMEMBER(void, pfnContextDestroy,(void *pvEnv,
|
---|
55 | uint32_t u32Cid));
|
---|
56 | DECLCALLBACKMEMBER(int, pfnSurfaceDefine,(void *pvEnv,
|
---|
57 | GASURFCREATE *pCreateParms,
|
---|
58 | GASURFSIZE *paSizes,
|
---|
59 | uint32_t cSizes,
|
---|
60 | uint32_t *pu32Sid));
|
---|
61 | DECLCALLBACKMEMBER(void, pfnSurfaceDestroy,(void *pvEnv,
|
---|
62 | uint32_t u32Sid));
|
---|
63 | DECLCALLBACKMEMBER(int, pfnRender,(void *pvEnv,
|
---|
64 | uint32_t u32Cid,
|
---|
65 | void *pvCommands,
|
---|
66 | uint32_t cbCommands,
|
---|
67 | GAFENCEQUERY *pFenceQuery));
|
---|
68 | DECLCALLBACKMEMBER(void, pfnFenceUnref,(void *pvEnv,
|
---|
69 | uint32_t u32FenceHandle));
|
---|
70 | DECLCALLBACKMEMBER(int, pfnFenceQuery,(void *pvEnv,
|
---|
71 | uint32_t u32FenceHandle,
|
---|
72 | GAFENCEQUERY *pFenceQuery));
|
---|
73 | DECLCALLBACKMEMBER(int, pfnFenceWait,(void *pvEnv,
|
---|
74 | uint32_t u32FenceHandle,
|
---|
75 | uint32_t u32TimeoutUS));
|
---|
76 | DECLCALLBACKMEMBER(int, pfnRegionCreate,(void *pvEnv,
|
---|
77 | uint32_t u32RegionSize,
|
---|
78 | uint32_t *pu32GmrId,
|
---|
79 | void **ppvMap));
|
---|
80 | DECLCALLBACKMEMBER(void, pfnRegionDestroy,(void *pvEnv,
|
---|
81 | uint32_t u32GmrId,
|
---|
82 | void *pvMap));
|
---|
83 | /* VGPU10 */
|
---|
84 | DECLCALLBACKMEMBER(int, pfnGBSurfaceDefine,(void *pvEnv,
|
---|
85 | SVGAGBSURFCREATE *pCreateParms));
|
---|
86 | } WDDMGalliumDriverEnv;
|
---|
87 |
|
---|
88 | struct pipe_context;
|
---|
89 | struct pipe_screen;
|
---|
90 | struct pipe_resource;
|
---|
91 |
|
---|
92 | typedef struct pipe_screen * WINAPI FNGaDrvScreenCreate(const WDDMGalliumDriverEnv *pEnv);
|
---|
93 | typedef FNGaDrvScreenCreate *PFNGaDrvScreenCreate;
|
---|
94 |
|
---|
95 | typedef void WINAPI FNGaDrvScreenDestroy(struct pipe_screen *s);
|
---|
96 | typedef FNGaDrvScreenDestroy *PFNGaDrvScreenDestroy;
|
---|
97 |
|
---|
98 | typedef const WDDMGalliumDriverEnv * WINAPI FNGaDrvGetWDDMEnv(struct pipe_screen *pScreen);
|
---|
99 | typedef FNGaDrvGetWDDMEnv *PFNGaDrvGetWDDMEnv;
|
---|
100 |
|
---|
101 | typedef uint32_t WINAPI FNGaDrvGetContextId(struct pipe_context *pPipeContext);
|
---|
102 | typedef FNGaDrvGetContextId *PFNGaDrvGetContextId;
|
---|
103 |
|
---|
104 | typedef uint32_t WINAPI FNGaDrvGetSurfaceId(struct pipe_screen *pScreen, struct pipe_resource *pResource);
|
---|
105 | typedef FNGaDrvGetSurfaceId *PFNGaDrvGetSurfaceId;
|
---|
106 |
|
---|
107 | typedef void WINAPI FNGaDrvContextFlush(struct pipe_context *pPipeContext);
|
---|
108 | typedef FNGaDrvContextFlush *PFNGaDrvContextFlush;
|
---|
109 |
|
---|
110 | #ifdef __cplusplus
|
---|
111 | }
|
---|
112 | #endif
|
---|
113 |
|
---|
114 | #endif /* !GA_INCLUDED_3D_WIN_VBoxGaDriver_h */
|
---|
115 |
|
---|