Changeset 103999 in vbox for trunk/src/VBox/Additions/3D
- Timestamp:
- Mar 22, 2024 12:38:39 PM (8 months ago)
- Location:
- trunk/src/VBox/Additions/3D
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/3D/Config.kmk
r99213 r103999 33 33 endif 34 34 35 VBOX_MESA := mesa-21.3.8 35 #NEW_MESA := 1 36 37 ifdef NEW_MESA 38 VBOX_MESA_VERSION := 24.0.2 39 VBOX_MESA_V_MAJOR := 24 40 else 41 VBOX_MESA_VERSION := 21.3.8 42 VBOX_MESA_V_MAJOR := 21 43 endif 44 VBOX_MESA := mesa-$(VBOX_MESA_VERSION) 36 45 VBOX_PATH_3D := $(PATH_ROOT)/src/VBox/Additions/3D 37 46 VBOX_PATH_MESA := $(PATH_ROOT)/src/VBox/Additions/3D/mesa/$(VBOX_MESA) … … 48 57 TEMPLATE_VBoxMesa3DGuestR3Dll_SDKS.win = $(TEMPLATE_NewerVccVBoxGuestR3Dll_SDKS) $(VBOX_WINDDK_GST_W8) 49 58 TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS = $(TEMPLATE_NewerVccVBoxGuestR3Dll_DEFS) \ 50 VBOX_WITH_MESA3D 59 VBOX_WITH_MESA3D \ 60 VBOX_MESA_V_MAJOR=$(VBOX_MESA_V_MAJOR) 51 61 ifdef VBOX_WITH_VMSVGA 52 62 TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS += VBOX_WITH_VMSVGA 53 63 endif 54 64 # VirtualBox specific modifications of the Mesa3D code. 55 # All modified places can be found by searching for VBOX 65 # All modified places can be found by searching for VBOX or IPRT_NO_CRT 56 66 # 57 67 # Each define represents a group of related modifications. … … 93 103 WINAPI=__stdcall \ 94 104 _WIN32 105 if $(VBOX_MESA_V_MAJOR) >= 24 106 TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS.win += \ 107 WINDOWS_NO_FUTEX \ 108 HAVE_STRUCT_TIMESPEC 109 endif 110 TEMPLATE_VBoxMesa3DGuestR3Dll_CFLAGS.win = $(TEMPLATE_NewerVccVBoxGuestR3Dll_CFLAGS.win) 111 if $(VBOX_MESA_V_MAJOR) >= 24 112 # Mesa 24+ needs -std:c11 for 'alignas', etc 113 TEMPLATE_VBoxMesa3DGuestR3Dll_CFLAGS.win += -std:c11 114 endif 95 115 ifdef VBOX_WITH_VMSVGA 96 116 # treat as error: warning C4013: 'close' undefined; assuming extern returning int 97 TEMPLATE_VBoxMesa3DGuestR3Dll_CFLAGS = $(TEMPLATE_NewerVccVBoxGuestR3Dll_CFLAGS)-we4013117 TEMPLATE_VBoxMesa3DGuestR3Dll_CFLAGS.win += -we4013 98 118 endif 99 119 TEMPLATE_VBoxMesa3DGuestR3Dll_INCS = $(TEMPLATE_NewerVccVBoxGuestR3Dll_INCS) \ -
trunk/src/VBox/Additions/3D/win/VBoxGL/Makefile.kmk
r98103 r103999 34 34 VBoxGL_TEMPLATE = VBoxMesa3DGuestR3DllMinVista 35 35 VBoxGL_DEFS = VBOXGL 36 if $(VBOX_MESA_V_MAJOR) >= 24 37 VBoxGL_DEFS += \ 38 VBOX_MESA_STATIC_DRIVER 39 endif 36 40 # -wd4005: '__useHeader' : redefinition 37 41 VBOXGL_DISABLED_WARNINGS := -wd4005 42 # -wd4100: 'api': unreferenced formal parameter 38 43 # -wd4204: nonstandard extension used: non-constant aggregate initializer 44 # -wd4245: 'return': conversion from 'int' to 'unsigned int', signed/unsigned mismatch 39 45 # -wd4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data 40 46 # -wd4459: stw_device.h(102): warning C4459: declaration of 'stw_dev' hides global declaration 41 47 # -wd4668: c99_compat.h(99): warning C4668: '__STDC_VERSION__' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' 42 VBOXGL_DISABLED_WARNINGS += -wd4 204-wd4267 -wd4459 -wd466848 VBOXGL_DISABLED_WARNINGS += -wd4100 -wd4204 -wd4245 -wd4267 -wd4459 -wd4668 43 49 VBoxGL_CFLAGS = $(VBOXGL_DISABLED_WARNINGS) 44 50 VBoxGL_CXXFLAGS = $(VBOXGL_DISABLED_WARNINGS) … … 53 59 $(VBOX_PATH_VMSVGA_INC) \ 54 60 $(VBOX_GRAPHICS_INCS) 61 if $(VBOX_MESA_V_MAJOR) >= 24 62 VBoxGL_INCS += \ 63 $(VBOX_PATH_3D)/win/VBoxSVGA \ 64 $(VBOX_PATH_MESA)/src/mapi \ 65 $(VBOX_PATH_MESA)/src/gallium/drivers/svga \ 66 $(VBOX_PATH_MESA)/src/gallium/winsys/svga/drm 67 endif 55 68 VBoxGL_SOURCES = \ 56 $(VBOX_PATH_MESA)/src/gallium/targets/libgl-gdi/opengl32.def \ 69 GaDrvEnvKMT.cpp \ 70 VBoxGL.c \ 57 71 VBoxGL.rc 58 VBoxGL_SOURCES += \ 59 GaDrvEnvKMT.cpp \ 60 VBoxGL.c 72 if $(VBOX_MESA_V_MAJOR) >= 24 73 VBoxGL_SOURCES += \ 74 ../VBoxSVGA/VBoxSVGA.c \ 75 ../VBoxSVGA/winsys/vmw_screen.c \ 76 ../VBoxSVGA/winsys/vmw_screen_wddm.c \ 77 ../VBoxSVGA/winsys/vmw_screen_ioctl.c \ 78 $(VBoxGL_0_OUTDIR)/opengl32.def 79 else 80 VBoxGL_SOURCES += \ 81 $(VBOX_PATH_MESA)/src/gallium/targets/libgl-gdi/opengl32.def 82 endif 61 83 VBoxGL_LIBS = \ 62 84 $(VBOX_PATH_ADDITIONS_LIB)/VBoxWddmUmHlp$(VBOX_SUFF_LIB) \ … … 65 87 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaUtilLib$(VBOX_SUFF_LIB) \ 66 88 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaLib$(VBOX_SUFF_LIB) 89 if $(VBOX_MESA_V_MAJOR) >= 24 90 VBoxGL_LIBS += \ 91 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaSVGAWinsysLib$(VBOX_SUFF_LIB) \ 92 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaSVGALib$(VBOX_SUFF_LIB) 93 endif 94 95 $$(VBoxGL_0_OUTDIR)/opengl32.def: \ 96 $(PATH_SUB_CURRENT)/opengl32_defs.py \ 97 $(VBOX_PATH_MESA)/src/gallium/targets/libgl-gdi/opengl32.def.in | $$(dir $$@) 98 $(call MSG_GENERATE,python,$@,$$@) 99 $(QUIET)$(VBOX_BLD_PYTHON) $< $(VBOX_PATH_MESA)/src/gallium/targets/libgl-gdi/opengl32.def.in $@ 67 100 68 101 if defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS) … … 82 115 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaUtilLib-x86$(VBOX_SUFF_LIB) \ 83 116 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaLib-x86$(VBOX_SUFF_LIB) 117 if $(VBOX_MESA_V_MAJOR) >= 24 118 VBoxGL-x86_LIBS += \ 119 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaSVGAWinsysLib-x86$(VBOX_SUFF_LIB) \ 120 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaSVGALib-x86$(VBOX_SUFF_LIB) 121 endif 84 122 VBoxGL-x86_DEFS = $(VBoxGL_DEFS) VBOX_WOW64 85 123 -
trunk/src/VBox/Additions/3D/win/VBoxGL/VBoxGL.c
r98103 r103999 33 33 34 34 #include "pipe/p_state.h" 35 #if VBOX_MESA_V_MAJOR >= 24 36 #include "state_tracker/st_context.h" 37 #endif 35 38 #include "svga3d_reg.h" 36 39 37 40 #include <iprt/asm.h> 41 #include <iprt/initterm.h> 38 42 39 43 #include <common/wddm/VBoxMPIf.h> … … 41 45 #include <Psapi.h> 42 46 47 #if VBOX_MESA_V_MAJOR < 24 43 48 static const char *g_pszSvgaDll = 44 49 #ifdef VBOX_WOW64 … … 48 53 #endif 49 54 ; 55 #endif 50 56 51 57 static struct GaDrvFunctions … … 60 66 61 67 68 #if VBOX_MESA_V_MAJOR < 24 62 69 static HMODULE gaDrvLoadSVGA(struct GaDrvFunctions *pDrvFuncs) 63 70 { … … 80 87 return hmod; 81 88 } 89 #else 90 struct pipe_screen * WINAPI GaDrvScreenCreate(const WDDMGalliumDriverEnv *pEnv); 91 void WINAPI GaDrvScreenDestroy(struct pipe_screen *s); 92 uint32_t WINAPI GaDrvGetSurfaceId(struct pipe_screen *pScreen, struct pipe_resource *pResource); 93 const WDDMGalliumDriverEnv *WINAPI GaDrvGetWDDMEnv(struct pipe_screen *pScreen); 94 uint32_t WINAPI GaDrvGetContextId(struct pipe_context *pPipeContext); 95 void WINAPI GaDrvContextFlush(struct pipe_context *pPipeContext); 96 97 static void initDrvFuncs(void) 98 { 99 g_drvfuncs.pfnGaDrvScreenCreate = GaDrvScreenCreate; 100 g_drvfuncs.pfnGaDrvScreenDestroy = GaDrvScreenDestroy; 101 g_drvfuncs.pfnGaDrvGetWDDMEnv = GaDrvGetWDDMEnv; 102 g_drvfuncs.pfnGaDrvGetContextId = GaDrvGetContextId; 103 g_drvfuncs.pfnGaDrvGetSurfaceId = GaDrvGetSurfaceId; 104 g_drvfuncs.pfnGaDrvContextFlush = GaDrvContextFlush; 105 } 106 #endif 82 107 83 108 struct stw_shared_surface … … 252 277 struct pipe_screen *screen = NULL; 253 278 279 #if VBOX_MESA_V_MAJOR < 24 254 280 if (gaDrvLoadSVGA(&g_drvfuncs)) 281 #else 282 initDrvFuncs(); 283 #endif 255 284 { 256 285 WDDMGalliumDriverEnv const *pEnv = GaDrvEnvKmtCreate(); … … 291 320 } 292 321 322 #if VBOX_MESA_V_MAJOR < 24 293 323 static boolean 324 #else 325 static bool 326 #endif 294 327 wddm_get_adapter_luid(struct pipe_screen *screen, 295 328 HDC hDC, … … 534 567 vboxVDbgVEHandlerRegister(); 535 568 #endif 569 RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE); 536 570 D3DKMTLoad(); 537 571 stw_init(&stw_winsys); -
trunk/src/VBox/Additions/3D/win/VBoxNine/Makefile.kmk
r98103 r103999 33 33 34 34 VBoxNine_TEMPLATE = VBoxMesa3DGuestR3DllMinVista 35 if $(VBOX_MESA_V_MAJOR) >= 24 36 VBoxNine_DEFS = \ 37 VBOX_MESA_STATIC_DRIVER 38 endif 35 39 # -wd4100: unreferenced formal parameter 36 40 # -wd4200: nonstandard extension used : zero-sized array in struct/union … … 41 45 VBoxNine_INCS = \ 42 46 $(VBOX_PATH_MESA)/src/gallium/frontends/nine 47 if $(VBOX_MESA_V_MAJOR) >= 24 48 VBoxNine_INCS += \ 49 $(VBOX_PATH_3D)/win/include \ 50 $(VBOX_PATH_3D)/win/VBoxSVGA \ 51 $(VBOX_PATH_MESA)/src/gallium/drivers/svga \ 52 $(VBOX_PATH_MESA)/src/gallium/drivers/svga/include \ 53 $(VBOX_PATH_MESA)/src/gallium/winsys/svga/drm 54 endif 43 55 VBoxNine_SOURCES = \ 44 56 nine/nine_memory_helper.c \ 45 57 VBoxNine.c \ 46 VBoxNine.rc \ 47 VBoxNine.def 58 VBoxNine.rc 59 if $(VBOX_MESA_V_MAJOR) < 24 60 VBoxNine_SOURCES += \ 61 VBoxNine.def 62 else 63 VBoxNine_SOURCES += \ 64 VBoxNine_static_drv.def \ 65 ../VBoxSVGA/VBoxSVGA.c \ 66 ../VBoxSVGA/winsys/vmw_screen.c \ 67 ../VBoxSVGA/winsys/vmw_screen_wddm.c \ 68 ../VBoxSVGA/winsys/vmw_screen_ioctl.c 69 endif 48 70 VBoxNine_LIBS = \ 49 71 $(VBOX_PATH_ADDITIONS_LIB)/VBoxWddmUmHlp$(VBOX_SUFF_LIB) \ … … 52 74 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaUtilLib$(VBOX_SUFF_LIB) \ 53 75 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaNineLib$(VBOX_SUFF_LIB) 76 if $(VBOX_MESA_V_MAJOR) >= 24 77 VBoxNine_LIBS += \ 78 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaSVGAWinsysLib$(VBOX_SUFF_LIB) \ 79 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaSVGALib$(VBOX_SUFF_LIB) 80 endif 54 81 55 82 if defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS) … … 69 96 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaUtilLib-x86$(VBOX_SUFF_LIB) \ 70 97 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaNineLib-x86$(VBOX_SUFF_LIB) 98 if $(VBOX_MESA_V_MAJOR) >= 24 99 VBoxNine-x86_LIBS += \ 100 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaSVGAWinsysLib-x86$(VBOX_SUFF_LIB) \ 101 $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaSVGALib-x86$(VBOX_SUFF_LIB) 102 endif 71 103 VBoxNine-x86_DEFS = $(VBoxNine_DEFS) VBOX_WOW64 72 104 -
trunk/src/VBox/Additions/3D/win/VBoxNine/VBoxNine.c
r98103 r103999 30 30 //#include <d3dumddi.h> 31 31 32 #if VBOX_MESA_V_MAJOR >= 24 33 #include <VBoxGaDriver.h> 34 #endif 32 35 #include <VBoxWddmUmHlp.h> 33 36 … … 41 44 42 45 //#include <iprt/alloc.h> 43 //#include <iprt/initterm.h>46 #include <iprt/initterm.h> 44 47 //#include <iprt/string.h> 45 48 //#include <iprt/log.h> … … 56 59 57 60 // #include "VBoxNine.h" 61 62 #if VBOX_MESA_V_MAJOR >= 24 63 struct pipe_screen * WINAPI GaDrvScreenCreate(const WDDMGalliumDriverEnv *pEnv); 64 void WINAPI GaDrvScreenDestroy(struct pipe_screen *s); 65 uint32_t WINAPI GaDrvGetSurfaceId(struct pipe_screen *pScreen, struct pipe_resource *pResource); 66 const WDDMGalliumDriverEnv *WINAPI GaDrvGetWDDMEnv(struct pipe_screen *pScreen); 67 uint32_t WINAPI GaDrvGetContextId(struct pipe_context *pPipeContext); 68 void WINAPI GaDrvContextFlush(struct pipe_context *pPipeContext); 69 #endif 58 70 59 71 struct d3dadapter9_context_wddm … … 111 123 } 112 124 125 #if VBOX_MESA_V_MAJOR < 24 113 126 HRESULT WINAPI 114 127 GaNineD3DAdapter9Create(struct pipe_screen *s, ID3DAdapter9 **ppOut) … … 149 162 } 150 163 164 #else /* VBOX_MESA_V_MAJOR >= 24 */ 165 166 HRESULT WINAPI 167 GaNineD3DAdapter9Create(const WDDMGalliumDriverEnv *pEnv, ID3DAdapter9 **ppOut) 168 { 169 HRESULT hr; 170 struct pipe_screen *s = GaDrvScreenCreate(pEnv); 171 if (s) 172 { 173 struct d3dadapter9_context_wddm *ctx = NULL; 174 hr = d3dadapter9_context_wddm_create(&ctx, s); 175 if (SUCCEEDED(hr)) 176 { 177 hr = NineAdapter9_new(&ctx->base, (struct NineAdapter9 **)ppOut); 178 if (FAILED(hr)) 179 { 180 /// @todo NineAdapter9_new calls this as ctx->base.destroy, 181 // and will not call if memory allocation fails. 182 // wddm_destroy(&pCtx->base); 183 } 184 } 185 Assert(SUCCEEDED(hr)); 186 } 187 else 188 { 189 hr = E_FAIL; 190 AssertFailed(); 191 } 192 return hr; 193 } 194 195 uint32_t WINAPI 196 GaNineGetSurfaceId(IUnknown *pSurface) 197 { 198 uint32_t sid = SVGA_ID_INVALID; 199 200 /// @todo QueryInterface? 201 struct NineResource9 *pNineResource = (struct NineResource9 *)pSurface; 202 struct pipe_resource *r = pNineResource->resource; 203 if (r) 204 { 205 struct pipe_screen *s = r->screen; 206 sid = GaDrvGetSurfaceId(s, r); 207 } 208 209 return sid; 210 } 211 212 extern struct pipe_context * 213 NineDevice9_GetPipe( struct NineDevice9 *This ); 214 215 uint32_t WINAPI 216 GaNineGetContextId(IDirect3DDevice9 *pDevice) 217 { 218 uint32_t cid = SVGA_ID_INVALID; 219 220 /// @todo Verify that this is a NineDevice? 221 struct pipe_context *pipe = NineDevice9_GetPipe((struct NineDevice9 *)pDevice); 222 if (pipe) 223 cid = GaDrvGetContextId(pipe); 224 225 return cid; 226 } 227 228 void WINAPI 229 GaNineFlush(IDirect3DDevice9 *pDevice) 230 { 231 struct pipe_context *pipe = NineDevice9_GetPipe((struct NineDevice9 *)pDevice); 232 if (pipe) 233 GaDrvContextFlush(pipe); 234 } 235 #endif /* VBOX_MESA_V_MAJOR >= 24 */ 236 151 237 BOOL WINAPI DllMain(HINSTANCE hDLLInst, 152 238 DWORD fdwReason, … … 160 246 { 161 247 case DLL_PROCESS_ATTACH: 162 //RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE);248 RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE); 163 249 D3DKMTLoad(); 164 250 break; -
trunk/src/VBox/Additions/3D/win/VBoxSVGA/VBoxSVGA.c
r98103 r103999 27 27 28 28 #include <VBoxWddmUmHlp.h> 29 30 #include <iprt/initterm.h> 29 31 30 32 #include "svga_public.h" … … 70 72 if (pScreen->resource_get_handle(pScreen, NULL, pResource, &whandle, 0)) 71 73 { 72 u32Sid = (uint32_t) whandle.handle;74 u32Sid = (uint32_t)(uintptr_t)whandle.handle; 73 75 } 74 76 } … … 114 116 } 115 117 118 #ifndef VBOX_MESA_STATIC_DRIVER 116 119 BOOL WINAPI DllMain(HINSTANCE hDLLInst, 117 120 DWORD fdwReason, … … 125 128 { 126 129 case DLL_PROCESS_ATTACH: 127 //RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE);130 RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE); 128 131 D3DKMTLoad(); 129 132 break; … … 145 148 return fReturn; 146 149 } 150 #endif -
trunk/src/VBox/Additions/3D/win/VBoxSVGA/winsys/vmw_screen.c
r98103 r103999 54 54 #include "util/os_file.h" 55 55 #include "util/u_memory.h" 56 #if VBOX_MESA_V_MAJOR < 24 56 57 #include "pipe/p_compiler.h" 58 #else 59 #include "util/compiler.h" 60 #endif 57 61 #include "util/u_hash_table.h" 58 62 … … 86 90 vws->open_count = 1; 87 91 vws->ioctl.drm_fd = -1; /* not used */ 88 vws->force_coherent = FALSE;92 vws->force_coherent = false; 89 93 if (!vmw_ioctl_init(vws)) 90 94 goto out_no_ioctl; 91 95 92 96 vws->base.have_gb_dma = !vws->force_coherent; 93 vws->base.need_to_rebind_resources = FALSE;97 vws->base.need_to_rebind_resources = false; 94 98 vws->base.have_transfer_from_buffer_cmd = vws->base.have_vgpu10; 95 vws->base.have_constant_buffer_offset_cmd = FALSE; 96 vws->cache_maps = FALSE; 99 #if VBOX_MESA_V_MAJOR < 24 100 vws->base.have_constant_buffer_offset_cmd = false; 101 #else 102 vws->base.have_constant_buffer_offset_cmd = 103 vws->ioctl.have_drm_2_20 && vws->base.have_sm5; 104 vws->base.have_index_vertex_buffer_offset_cmd = false; 105 vws->base.have_rasterizer_state_v2_cmd = 106 vws->ioctl.have_drm_2_20 && vws->base.have_sm5; 107 #endif 108 109 vws->cache_maps = false; 97 110 vws->fence_ops = vmw_fence_ops_create(vws); 98 111 if (!vws->fence_ops) -
trunk/src/VBox/Additions/3D/win/VBoxSVGA/winsys/vmw_screen_ioctl.c
r98103 r103999 110 110 uint32 111 111 vmw_ioctl_extended_context_create(struct vmw_winsys_screen *vws, 112 #if VBOX_MESA_V_MAJOR < 24 112 113 boolean vgpu10) 114 #else 115 bool vgpu10) 116 #endif 113 117 { 114 118 struct vmw_winsys_screen_wddm *vws_wddm = (struct vmw_winsys_screen_wddm *)vws; … … 265 269 const struct winsys_handle *whandle, 266 270 struct drm_vmw_surface_arg *req, 271 #if VBOX_MESA_V_MAJOR < 24 267 272 boolean *needs_unref) 273 #else 274 bool *needs_unref) 275 #endif 268 276 { 269 277 ASMBreakpoint(); … … 444 452 int 445 453 vmw_ioctl_syncforcpu(struct vmw_region *region, 454 #if VBOX_MESA_V_MAJOR < 24 446 455 boolean dont_block, 447 456 boolean readonly, 448 457 boolean allow_cs) 458 #else 459 bool dont_block, 460 bool readonly, 461 bool allow_cs) 462 #endif 449 463 { 450 464 ASMBreakpoint(); … … 462 476 void 463 477 vmw_ioctl_releasefromcpu(struct vmw_region *region, 478 #if VBOX_MESA_V_MAJOR < 24 464 479 boolean readonly, 465 480 boolean allow_cs) 481 #else 482 bool readonly, 483 bool allow_cs) 484 #endif 466 485 { 467 486 ASMBreakpoint(); … … 513 532 return 0; /* Treat as signalled. */ 514 533 515 vmw_fences_signal(vws->fence_ops, FenceQuery.u32ProcessedSeqNo, FenceQuery.u32SubmittedSeqNo, TRUE); 534 /** @todo last 3 params in mesa: arg.passed_seqno, 0, false */ 535 vmw_fences_signal(vws->fence_ops, FenceQuery.u32ProcessedSeqNo, FenceQuery.u32SubmittedSeqNo, true); 516 536 517 537 return FenceQuery.u32FenceStatus == GA_FENCE_STATUS_SIGNALED ? 0 : -1; … … 559 579 if (vws->base.have_gb_objects) { 560 580 for (i = 0; i < vws->ioctl.num_cap_3d; ++i) { 561 vws->ioctl.cap_3d[i].has_cap = TRUE;581 vws->ioctl.cap_3d[i].has_cap = true; 562 582 vws->ioctl.cap_3d[i].result.u = cap_buffer[i]; 563 583 } … … 599 619 index = capArray[i][0]; 600 620 if (index < vws->ioctl.num_cap_3d) { 601 vws->ioctl.cap_3d[index].has_cap = TRUE;621 vws->ioctl.cap_3d[index].has_cap = true; 602 622 vws->ioctl.cap_3d[index].result.u = capArray[i][1]; 603 623 } else { … … 727 747 gp_arg->value = (vboxGetShaderModel(vws_wddm) >= SVGA_SM_5); 728 748 break; 749 #if VBOX_MESA_V_MAJOR >= 24 750 case DRM_VMW_PARAM_GL43: 751 gp_arg->value = false; /** @todo */ 752 break; 753 #endif 729 754 default: return -1; 730 755 } … … 743 768 } 744 769 770 #if VBOX_MESA_V_MAJOR < 24 745 771 boolean 772 #else 773 bool 774 #endif 746 775 vmw_ioctl_init(struct vmw_winsys_screen *vws) 747 776 { … … 752 781 int ret; 753 782 uint32_t *cap_buffer; 783 #if VBOX_MESA_V_MAJOR < 24 754 784 boolean drm_gb_capable; 755 785 boolean have_drm_2_5; 786 #else 787 bool drm_gb_capable; 788 bool have_drm_2_5; 789 #endif 756 790 757 791 VMW_FUNC; … … 765 799 vws->ioctl.have_drm_2_18 = 1; 766 800 vws->ioctl.have_drm_2_19 = 1; 801 #if VBOX_MESA_V_MAJOR >= 24 802 vws->ioctl.have_drm_2_20 = 1; 803 #endif 767 804 768 805 vws->ioctl.drm_execbuf_version = vws->ioctl.have_drm_2_9 ? 2 : 1; … … 792 829 ret = vboxGetParam(vws_wddm, &gp_arg); 793 830 if (ret) 794 vws->base.have_gb_objects = FALSE;831 vws->base.have_gb_objects = false; 795 832 else 796 833 vws->base.have_gb_objects = … … 800 837 goto out_no_3d; 801 838 802 vws->base.have_vgpu10 = FALSE; 803 vws->base.have_sm4_1 = FALSE; 804 vws->base.have_intra_surface_copy = FALSE; 839 vws->base.have_vgpu10 = false; 840 vws->base.have_sm4_1 = false; 841 vws->base.have_intra_surface_copy = false; 842 #if VBOX_MESA_V_MAJOR >= 24 843 vws->base.device_id = 0x0405; /* assume SVGA II */ 844 #endif 805 845 806 846 if (vws->base.have_gb_objects) { … … 836 876 837 877 debug_printf("Have VGPU10 interface and hardware.\n"); 838 vws->base.have_vgpu10 = TRUE;878 vws->base.have_vgpu10 = true; 839 879 vgpu10_val = getenv("SVGA_VGPU10"); 840 880 if (vgpu10_val && strcmp(vgpu10_val, "0") == 0) { 841 881 debug_printf("Disabling VGPU10 interface.\n"); 842 vws->base.have_vgpu10 = FALSE;882 vws->base.have_vgpu10 = false; 843 883 } else { 844 884 debug_printf("Enabling VGPU10 interface.\n"); … … 852 892 ret = vboxGetParam(vws_wddm, &gp_arg); 853 893 if (ret == 0 && gp_arg.value != 0) { 854 vws->base.have_intra_surface_copy = TRUE;894 vws->base.have_intra_surface_copy = true; 855 895 } 856 896 … … 859 899 ret = vboxGetParam(vws_wddm, &gp_arg); 860 900 if (ret == 0 && gp_arg.value != 0) { 861 vws->base.have_sm4_1 = TRUE;901 vws->base.have_sm4_1 = true; 862 902 } 863 903 } … … 868 908 ret = vboxGetParam(vws_wddm, &gp_arg); 869 909 if (ret == 0 && gp_arg.value != 0) { 870 vws->base.have_sm5 = TRUE;910 vws->base.have_sm5 = true; 871 911 } 872 912 } 913 914 #if VBOX_MESA_V_MAJOR >= 24 915 if (vws->ioctl.have_drm_2_20 && vws->base.have_sm5) { 916 memset(&gp_arg, 0, sizeof(gp_arg)); 917 gp_arg.param = DRM_VMW_PARAM_GL43; 918 ret = vboxGetParam(vws_wddm, &gp_arg); 919 if (ret == 0 && gp_arg.value != 0) { 920 vws->base.have_gl43 = true; 921 } 922 } 923 #endif 873 924 874 925 memset(&gp_arg, 0, sizeof(gp_arg)); … … 886 937 887 938 if (vws->ioctl.have_drm_2_16) { 888 vws->base.have_coherent = TRUE;939 vws->base.have_coherent = true; 889 940 } 890 941 } else { … … 948 999 * modules before 2.10. 949 1000 */ 950 vws->base.have_generate_mipmap_cmd = TRUE;951 vws->base.have_set_predication_cmd = TRUE;1001 vws->base.have_generate_mipmap_cmd = true; 1002 vws->base.have_set_predication_cmd = true; 952 1003 } 953 1004 954 1005 if (vws->ioctl.have_drm_2_15) { 955 vws->base.have_fence_fd = TRUE;1006 vws->base.have_fence_fd = true; 956 1007 } 957 1008 958 1009 free(cap_buffer); 959 1010 vmw_printf("%s OK\n", __FUNCTION__); 960 return TRUE;1011 return true; 961 1012 out_no_caps: 962 1013 free(vws->ioctl.cap_3d); … … 966 1017 vws->ioctl.num_cap_3d = 0; 967 1018 debug_printf("%s Failed\n", __FUNCTION__); 968 return FALSE;1019 return false; 969 1020 } 970 1021 -
trunk/src/VBox/Additions/3D/win/VBoxSVGA/winsys/vmw_screen_wddm.c
r98103 r103999 47 47 48 48 49 #if VBOX_MESA_V_MAJOR < 24 49 50 #include "pipe/p_compiler.h" 51 #else 52 #include "util/compiler.h" 53 #endif 50 54 #include "util/u_inlines.h" 51 55 #include "util/u_memory.h" … … 75 79 struct winsys_handle *whandle, 76 80 SVGA3dSurfaceFormat *format); 81 #if VBOX_MESA_V_MAJOR < 24 77 82 static boolean 83 #else 84 static bool 85 #endif 78 86 vmw_drm_surface_get_handle(struct svga_winsys_screen *sws, 79 87 struct svga_winsys_surface *surface, … … 116 124 { 117 125 RT_NOREF3(sws, whandle, format); 126 AssertFailed(); 118 127 return 0; 119 128 } … … 125 134 { 126 135 RT_NOREF3(sws, whandle, format); 136 AssertFailed(); 127 137 return 0; 128 138 } … … 134 144 * which can be used to access the surface. 135 145 */ 146 #if VBOX_MESA_V_MAJOR < 24 136 147 static boolean 148 #else 149 static bool 150 #endif 137 151 vmw_drm_surface_get_handle(struct svga_winsys_screen *sws, 138 152 struct svga_winsys_surface *surface, … … 146 160 147 161 if (!surface) 148 return FALSE;162 return false; 149 163 150 164 vsrf = vmw_svga_winsys_surface(surface); 165 #if VBOX_MESA_V_MAJOR < 24 151 166 whandle->handle = vsrf->sid; 167 #else 168 whandle->handle = (HANDLE)(uintptr_t)vsrf->sid; 169 #endif 152 170 whandle->stride = stride; 153 171 whandle->offset = 0; … … 156 174 case WINSYS_HANDLE_TYPE_SHARED: 157 175 case WINSYS_HANDLE_TYPE_KMS: 158 whandle->handle = vsrf->sid;159 176 break; 160 177 case WINSYS_HANDLE_TYPE_FD: 161 whandle->handle = vsrf->sid; /// @todo will this be enough for WDDM?162 178 break; 163 179 default: 164 180 vmw_error("Attempt to export unsupported handle type %d.\n", 165 181 whandle->type); 166 return FALSE;182 return false; 167 183 } 168 184 169 return TRUE;185 return true; 170 186 } 171 187 -
trunk/src/VBox/Additions/3D/win/include/VBoxGaNine.h
r98103 r103999 38 38 #endif 39 39 40 #if VBOX_MESA_V_MAJOR < 24 40 41 struct pipe_screen; 41 42 struct pipe_resource; 42 43 struct pipe_context; 44 #endif 43 45 typedef struct ID3DAdapter9 ID3DAdapter9; 44 46 47 #if VBOX_MESA_V_MAJOR < 24 45 48 typedef HRESULT WINAPI FNGaNineD3DAdapter9Create(struct pipe_screen *s, ID3DAdapter9 **ppOut); 46 49 typedef FNGaNineD3DAdapter9Create *PFNGaNineD3DAdapter9Create; … … 51 54 typedef struct pipe_context * WINAPI FNGaNinePipeContextFromDevice(IDirect3DDevice9 *pDevice); 52 55 typedef FNGaNinePipeContextFromDevice *PFNGaNinePipeContextFromDevice; 56 #else 57 typedef HRESULT WINAPI FNGaNineD3DAdapter9Create(const WDDMGalliumDriverEnv *pEnv, ID3DAdapter9 **ppOut); 58 typedef FNGaNineD3DAdapter9Create *PFNGaNineD3DAdapter9Create; 59 60 typedef uint32_t WINAPI FNGaNineGetSurfaceId(IUnknown *pSurface); 61 typedef FNGaNineGetSurfaceId *PFNGaNineGetSurfaceId; 62 63 typedef uint32_t WINAPI FNGaNineGetContextId(IDirect3DDevice9 *pDevice); 64 typedef FNGaNineGetContextId *PFNGaNineGetContextId; 65 66 typedef void WINAPI FNGaNineFlush(IDirect3DDevice9 *pDevice); 67 typedef FNGaNineFlush *PFNGaNineFlush; 68 #endif 53 69 54 70 #ifdef __cplusplus
Note:
See TracChangeset
for help on using the changeset viewer.