VirtualBox

Changeset 103999 in vbox for trunk/src/VBox/Additions/3D


Ignore:
Timestamp:
Mar 22, 2024 12:38:39 PM (8 months ago)
Author:
vboxsync
Message:

Addition/3D,Additions/WINNT/Graphics: Updates for mesa-24.0.2 (not enabled yet). bugref:10606

Location:
trunk/src/VBox/Additions/3D
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/3D/Config.kmk

    r99213 r103999  
    3333endif
    3434
    35 VBOX_MESA            := mesa-21.3.8
     35#NEW_MESA := 1
     36
     37ifdef NEW_MESA
     38 VBOX_MESA_VERSION    := 24.0.2
     39 VBOX_MESA_V_MAJOR    := 24
     40else
     41 VBOX_MESA_VERSION    := 21.3.8
     42 VBOX_MESA_V_MAJOR    := 21
     43endif
     44VBOX_MESA            := mesa-$(VBOX_MESA_VERSION)
    3645VBOX_PATH_3D         := $(PATH_ROOT)/src/VBox/Additions/3D
    3746VBOX_PATH_MESA       := $(PATH_ROOT)/src/VBox/Additions/3D/mesa/$(VBOX_MESA)
     
    4857TEMPLATE_VBoxMesa3DGuestR3Dll_SDKS.win = $(TEMPLATE_NewerVccVBoxGuestR3Dll_SDKS) $(VBOX_WINDDK_GST_W8)
    4958TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS     = $(TEMPLATE_NewerVccVBoxGuestR3Dll_DEFS) \
    50         VBOX_WITH_MESA3D
     59        VBOX_WITH_MESA3D \
     60        VBOX_MESA_V_MAJOR=$(VBOX_MESA_V_MAJOR)
    5161ifdef VBOX_WITH_VMSVGA
    5262 TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS   += VBOX_WITH_VMSVGA
    5363endif
    5464# 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
    5666#
    5767# Each define represents a group of related modifications.
     
    93103        WINAPI=__stdcall \
    94104        _WIN32
     105if $(VBOX_MESA_V_MAJOR) >= 24
     106 TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS.win += \
     107        WINDOWS_NO_FUTEX \
     108        HAVE_STRUCT_TIMESPEC
     109endif
     110TEMPLATE_VBoxMesa3DGuestR3Dll_CFLAGS.win = $(TEMPLATE_NewerVccVBoxGuestR3Dll_CFLAGS.win)
     111if $(VBOX_MESA_V_MAJOR) >= 24
     112 # Mesa 24+ needs -std:c11 for 'alignas', etc
     113 TEMPLATE_VBoxMesa3DGuestR3Dll_CFLAGS.win += -std:c11
     114endif
    95115ifdef VBOX_WITH_VMSVGA
    96116 # treat as error: warning C4013: 'close' undefined; assuming extern returning int
    97  TEMPLATE_VBoxMesa3DGuestR3Dll_CFLAGS  = $(TEMPLATE_NewerVccVBoxGuestR3Dll_CFLAGS) -we4013
     117 TEMPLATE_VBoxMesa3DGuestR3Dll_CFLAGS.win += -we4013
    98118endif
    99119TEMPLATE_VBoxMesa3DGuestR3Dll_INCS     = $(TEMPLATE_NewerVccVBoxGuestR3Dll_INCS) \
  • trunk/src/VBox/Additions/3D/win/VBoxGL/Makefile.kmk

    r98103 r103999  
    3434VBoxGL_TEMPLATE = VBoxMesa3DGuestR3DllMinVista
    3535VBoxGL_DEFS     = VBOXGL
     36if $(VBOX_MESA_V_MAJOR) >= 24
     37 VBoxGL_DEFS    += \
     38        VBOX_MESA_STATIC_DRIVER
     39endif
    3640# -wd4005: '__useHeader' : redefinition
    3741VBOXGL_DISABLED_WARNINGS := -wd4005
     42# -wd4100: 'api': unreferenced formal parameter
    3843# -wd4204: nonstandard extension used: non-constant aggregate initializer
     44# -wd4245: 'return': conversion from 'int' to 'unsigned int', signed/unsigned mismatch
    3945# -wd4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data
    4046# -wd4459: stw_device.h(102): warning C4459: declaration of 'stw_dev' hides global declaration
    4147# -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 += -wd4204 -wd4267 -wd4459 -wd4668
     48VBOXGL_DISABLED_WARNINGS += -wd4100 -wd4204 -wd4245 -wd4267 -wd4459 -wd4668
    4349VBoxGL_CFLAGS   = $(VBOXGL_DISABLED_WARNINGS)
    4450VBoxGL_CXXFLAGS = $(VBOXGL_DISABLED_WARNINGS)
     
    5359        $(VBOX_PATH_VMSVGA_INC) \
    5460        $(VBOX_GRAPHICS_INCS)
     61if $(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
     67endif
    5568VBoxGL_SOURCES  = \
    56         $(VBOX_PATH_MESA)/src/gallium/targets/libgl-gdi/opengl32.def \
     69        GaDrvEnvKMT.cpp \
     70        VBoxGL.c \
    5771        VBoxGL.rc
    58 VBoxGL_SOURCES += \
    59         GaDrvEnvKMT.cpp \
    60         VBoxGL.c
     72if $(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
     79else
     80 VBoxGL_SOURCES  += \
     81        $(VBOX_PATH_MESA)/src/gallium/targets/libgl-gdi/opengl32.def
     82endif
    6183VBoxGL_LIBS     = \
    6284        $(VBOX_PATH_ADDITIONS_LIB)/VBoxWddmUmHlp$(VBOX_SUFF_LIB) \
     
    6587        $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaUtilLib$(VBOX_SUFF_LIB) \
    6688        $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaLib$(VBOX_SUFF_LIB)
     89if $(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)
     93endif
     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 $@
    67100
    68101if defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS)
     
    82115        $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaUtilLib-x86$(VBOX_SUFF_LIB) \
    83116        $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaLib-x86$(VBOX_SUFF_LIB)
     117if $(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)
     121endif
    84122VBoxGL-x86_DEFS         = $(VBoxGL_DEFS) VBOX_WOW64
    85123
  • trunk/src/VBox/Additions/3D/win/VBoxGL/VBoxGL.c

    r98103 r103999  
    3333
    3434#include "pipe/p_state.h"
     35#if VBOX_MESA_V_MAJOR >= 24
     36#include "state_tracker/st_context.h"
     37#endif
    3538#include "svga3d_reg.h"
    3639
    3740#include <iprt/asm.h>
     41#include <iprt/initterm.h>
    3842
    3943#include <common/wddm/VBoxMPIf.h>
     
    4145#include <Psapi.h>
    4246
     47#if VBOX_MESA_V_MAJOR < 24
    4348static const char *g_pszSvgaDll =
    4449#ifdef VBOX_WOW64
     
    4853#endif
    4954;
     55#endif
    5056
    5157static struct GaDrvFunctions
     
    6066
    6167
     68#if VBOX_MESA_V_MAJOR < 24
    6269static HMODULE gaDrvLoadSVGA(struct GaDrvFunctions *pDrvFuncs)
    6370{
     
    8087    return hmod;
    8188}
     89#else
     90struct pipe_screen * WINAPI GaDrvScreenCreate(const WDDMGalliumDriverEnv *pEnv);
     91void WINAPI GaDrvScreenDestroy(struct pipe_screen *s);
     92uint32_t WINAPI GaDrvGetSurfaceId(struct pipe_screen *pScreen, struct pipe_resource *pResource);
     93const WDDMGalliumDriverEnv *WINAPI GaDrvGetWDDMEnv(struct pipe_screen *pScreen);
     94uint32_t WINAPI GaDrvGetContextId(struct pipe_context *pPipeContext);
     95void WINAPI GaDrvContextFlush(struct pipe_context *pPipeContext);
     96
     97static 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
    82107
    83108struct stw_shared_surface
     
    252277    struct pipe_screen *screen = NULL;
    253278
     279#if VBOX_MESA_V_MAJOR < 24
    254280    if (gaDrvLoadSVGA(&g_drvfuncs))
     281#else
     282    initDrvFuncs();
     283#endif
    255284    {
    256285        WDDMGalliumDriverEnv const *pEnv = GaDrvEnvKmtCreate();
     
    291320}
    292321
     322#if VBOX_MESA_V_MAJOR < 24
    293323static boolean
     324#else
     325static bool
     326#endif
    294327wddm_get_adapter_luid(struct pipe_screen *screen,
    295328                      HDC hDC,
     
    534567            vboxVDbgVEHandlerRegister();
    535568#endif
     569            RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE);
    536570            D3DKMTLoad();
    537571            stw_init(&stw_winsys);
  • trunk/src/VBox/Additions/3D/win/VBoxNine/Makefile.kmk

    r98103 r103999  
    3333
    3434VBoxNine_TEMPLATE = VBoxMesa3DGuestR3DllMinVista
     35if $(VBOX_MESA_V_MAJOR) >= 24
     36 VBoxNine_DEFS     = \
     37        VBOX_MESA_STATIC_DRIVER
     38endif
    3539#  -wd4100: unreferenced formal parameter
    3640#  -wd4200: nonstandard extension used : zero-sized array in struct/union
     
    4145VBoxNine_INCS     = \
    4246        $(VBOX_PATH_MESA)/src/gallium/frontends/nine
     47if $(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
     54endif
    4355VBoxNine_SOURCES  = \
    4456        nine/nine_memory_helper.c \
    4557        VBoxNine.c \
    46         VBoxNine.rc \
    47         VBoxNine.def
     58        VBoxNine.rc
     59if $(VBOX_MESA_V_MAJOR) < 24
     60 VBoxNine_SOURCES += \
     61        VBoxNine.def
     62else
     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
     69endif
    4870VBoxNine_LIBS     = \
    4971        $(VBOX_PATH_ADDITIONS_LIB)/VBoxWddmUmHlp$(VBOX_SUFF_LIB) \
     
    5274        $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaUtilLib$(VBOX_SUFF_LIB) \
    5375        $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaNineLib$(VBOX_SUFF_LIB)
     76if $(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)
     80endif
    5481
    5582if defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS)
     
    6996        $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaUtilLib-x86$(VBOX_SUFF_LIB) \
    7097        $(VBOX_PATH_ADDITIONS_LIB)/VBoxMesaNineLib-x86$(VBOX_SUFF_LIB)
     98if $(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)
     102endif
    71103VBoxNine-x86_DEFS         = $(VBoxNine_DEFS) VBOX_WOW64
    72104
  • trunk/src/VBox/Additions/3D/win/VBoxNine/VBoxNine.c

    r98103 r103999  
    3030//#include <d3dumddi.h>
    3131
     32#if VBOX_MESA_V_MAJOR >= 24
     33#include <VBoxGaDriver.h>
     34#endif
    3235#include <VBoxWddmUmHlp.h>
    3336
     
    4144
    4245//#include <iprt/alloc.h>
    43 //#include <iprt/initterm.h>
     46#include <iprt/initterm.h>
    4447//#include <iprt/string.h>
    4548//#include <iprt/log.h>
     
    5659
    5760// #include "VBoxNine.h"
     61
     62#if VBOX_MESA_V_MAJOR >= 24
     63struct pipe_screen * WINAPI GaDrvScreenCreate(const WDDMGalliumDriverEnv *pEnv);
     64void WINAPI GaDrvScreenDestroy(struct pipe_screen *s);
     65uint32_t WINAPI GaDrvGetSurfaceId(struct pipe_screen *pScreen, struct pipe_resource *pResource);
     66const WDDMGalliumDriverEnv *WINAPI GaDrvGetWDDMEnv(struct pipe_screen *pScreen);
     67uint32_t WINAPI GaDrvGetContextId(struct pipe_context *pPipeContext);
     68void WINAPI GaDrvContextFlush(struct pipe_context *pPipeContext);
     69#endif
    5870
    5971struct d3dadapter9_context_wddm
     
    111123}
    112124
     125#if VBOX_MESA_V_MAJOR < 24
    113126HRESULT WINAPI
    114127GaNineD3DAdapter9Create(struct pipe_screen *s, ID3DAdapter9 **ppOut)
     
    149162}
    150163
     164#else /* VBOX_MESA_V_MAJOR >= 24 */
     165
     166HRESULT WINAPI
     167GaNineD3DAdapter9Create(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
     195uint32_t WINAPI
     196GaNineGetSurfaceId(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
     212extern struct pipe_context *
     213NineDevice9_GetPipe( struct NineDevice9 *This );
     214
     215uint32_t WINAPI
     216GaNineGetContextId(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
     228void WINAPI
     229GaNineFlush(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
    151237BOOL WINAPI DllMain(HINSTANCE hDLLInst,
    152238                    DWORD fdwReason,
     
    160246    {
    161247        case DLL_PROCESS_ATTACH:
    162             //RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE);
     248            RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE);
    163249            D3DKMTLoad();
    164250            break;
  • trunk/src/VBox/Additions/3D/win/VBoxSVGA/VBoxSVGA.c

    r98103 r103999  
    2727
    2828#include <VBoxWddmUmHlp.h>
     29
     30#include <iprt/initterm.h>
    2931
    3032#include "svga_public.h"
     
    7072        if (pScreen->resource_get_handle(pScreen, NULL, pResource, &whandle, 0))
    7173        {
    72             u32Sid = (uint32_t)whandle.handle;
     74            u32Sid = (uint32_t)(uintptr_t)whandle.handle;
    7375        }
    7476    }
     
    114116}
    115117
     118#ifndef VBOX_MESA_STATIC_DRIVER
    116119BOOL WINAPI DllMain(HINSTANCE hDLLInst,
    117120                    DWORD fdwReason,
     
    125128    {
    126129        case DLL_PROCESS_ATTACH:
    127             //RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE);
     130            RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE);
    128131            D3DKMTLoad();
    129132            break;
     
    145148    return fReturn;
    146149}
     150#endif
  • trunk/src/VBox/Additions/3D/win/VBoxSVGA/winsys/vmw_screen.c

    r98103 r103999  
    5454#include "util/os_file.h"
    5555#include "util/u_memory.h"
     56#if VBOX_MESA_V_MAJOR < 24
    5657#include "pipe/p_compiler.h"
     58#else
     59#include "util/compiler.h"
     60#endif
    5761#include "util/u_hash_table.h"
    5862
     
    8690   vws->open_count = 1;
    8791   vws->ioctl.drm_fd = -1; /* not used */
    88    vws->force_coherent = FALSE;
     92   vws->force_coherent = false;
    8993   if (!vmw_ioctl_init(vws))
    9094      goto out_no_ioctl;
    9195
    9296   vws->base.have_gb_dma = !vws->force_coherent;
    93    vws->base.need_to_rebind_resources = FALSE;
     97   vws->base.need_to_rebind_resources = false;
    9498   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;
    97110   vws->fence_ops = vmw_fence_ops_create(vws);
    98111   if (!vws->fence_ops)
  • trunk/src/VBox/Additions/3D/win/VBoxSVGA/winsys/vmw_screen_ioctl.c

    r98103 r103999  
    110110uint32
    111111vmw_ioctl_extended_context_create(struct vmw_winsys_screen *vws,
     112#if VBOX_MESA_V_MAJOR < 24
    112113                                  boolean vgpu10)
     114#else
     115                                  bool vgpu10)
     116#endif
    113117{
    114118   struct vmw_winsys_screen_wddm *vws_wddm = (struct vmw_winsys_screen_wddm *)vws;
     
    265269                      const struct winsys_handle *whandle,
    266270                      struct drm_vmw_surface_arg *req,
     271#if VBOX_MESA_V_MAJOR < 24
    267272                      boolean *needs_unref)
     273#else
     274                      bool *needs_unref)
     275#endif
    268276{
    269277   ASMBreakpoint();
     
    444452int
    445453vmw_ioctl_syncforcpu(struct vmw_region *region,
     454#if VBOX_MESA_V_MAJOR < 24
    446455                     boolean dont_block,
    447456                     boolean readonly,
    448457                     boolean allow_cs)
     458#else
     459                     bool dont_block,
     460                     bool readonly,
     461                     bool allow_cs)
     462#endif
    449463{
    450464    ASMBreakpoint();
     
    462476void
    463477vmw_ioctl_releasefromcpu(struct vmw_region *region,
     478#if VBOX_MESA_V_MAJOR < 24
    464479                         boolean readonly,
    465480                         boolean allow_cs)
     481#else
     482                         bool readonly,
     483                         bool allow_cs)
     484#endif
    466485{
    467486   ASMBreakpoint();
     
    513532      return 0; /* Treat as signalled. */
    514533
    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);
    516536
    517537   return FenceQuery.u32FenceStatus == GA_FENCE_STATUS_SIGNALED ? 0 : -1;
     
    559579   if (vws->base.have_gb_objects) {
    560580      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;
    562582         vws->ioctl.cap_3d[i].result.u = cap_buffer[i];
    563583      }
     
    599619         index = capArray[i][0];
    600620         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;
    602622            vws->ioctl.cap_3d[index].result.u = capArray[i][1];
    603623         } else {
     
    727747            gp_arg->value = (vboxGetShaderModel(vws_wddm) >= SVGA_SM_5);
    728748            break;
     749#if VBOX_MESA_V_MAJOR >= 24
     750        case DRM_VMW_PARAM_GL43:
     751            gp_arg->value = false; /** @todo */
     752            break;
     753#endif
    729754        default: return -1;
    730755    }
     
    743768}
    744769
     770#if VBOX_MESA_V_MAJOR < 24
    745771boolean
     772#else
     773bool
     774#endif
    746775vmw_ioctl_init(struct vmw_winsys_screen *vws)
    747776{
     
    752781   int ret;
    753782   uint32_t *cap_buffer;
     783#if VBOX_MESA_V_MAJOR < 24
    754784   boolean drm_gb_capable;
    755785   boolean have_drm_2_5;
     786#else
     787   bool drm_gb_capable;
     788   bool have_drm_2_5;
     789#endif
    756790
    757791   VMW_FUNC;
     
    765799   vws->ioctl.have_drm_2_18 = 1;
    766800   vws->ioctl.have_drm_2_19 = 1;
     801#if VBOX_MESA_V_MAJOR >= 24
     802   vws->ioctl.have_drm_2_20 = 1;
     803#endif
    767804
    768805   vws->ioctl.drm_execbuf_version = vws->ioctl.have_drm_2_9 ? 2 : 1;
     
    792829   ret = vboxGetParam(vws_wddm, &gp_arg);
    793830   if (ret)
    794       vws->base.have_gb_objects = FALSE;
     831      vws->base.have_gb_objects = false;
    795832   else
    796833      vws->base.have_gb_objects =
     
    800837      goto out_no_3d;
    801838
    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
    805845
    806846   if (vws->base.have_gb_objects) {
     
    836876
    837877            debug_printf("Have VGPU10 interface and hardware.\n");
    838             vws->base.have_vgpu10 = TRUE;
     878            vws->base.have_vgpu10 = true;
    839879            vgpu10_val = getenv("SVGA_VGPU10");
    840880            if (vgpu10_val && strcmp(vgpu10_val, "0") == 0) {
    841881               debug_printf("Disabling VGPU10 interface.\n");
    842                vws->base.have_vgpu10 = FALSE;
     882               vws->base.have_vgpu10 = false;
    843883            } else {
    844884               debug_printf("Enabling VGPU10 interface.\n");
     
    852892         ret = vboxGetParam(vws_wddm, &gp_arg);
    853893         if (ret == 0 && gp_arg.value != 0) {
    854             vws->base.have_intra_surface_copy = TRUE;
     894            vws->base.have_intra_surface_copy = true;
    855895         }
    856896
     
    859899         ret = vboxGetParam(vws_wddm, &gp_arg);
    860900         if (ret == 0 && gp_arg.value != 0) {
    861             vws->base.have_sm4_1 = TRUE;
     901            vws->base.have_sm4_1 = true;
    862902         }
    863903      }
     
    868908         ret = vboxGetParam(vws_wddm, &gp_arg);
    869909         if (ret == 0 && gp_arg.value != 0) {
    870             vws->base.have_sm5 = TRUE;
     910            vws->base.have_sm5 = true;
    871911         }
    872912      }
     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
    873924
    874925      memset(&gp_arg, 0, sizeof(gp_arg));
     
    886937
    887938      if (vws->ioctl.have_drm_2_16) {
    888          vws->base.have_coherent = TRUE;
     939         vws->base.have_coherent = true;
    889940      }
    890941   } else {
     
    948999      * modules before 2.10.
    9491000      */
    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;
    9521003   }
    9531004
    9541005   if (vws->ioctl.have_drm_2_15) {
    955       vws->base.have_fence_fd = TRUE;
     1006      vws->base.have_fence_fd = true;
    9561007   }
    9571008
    9581009   free(cap_buffer);
    9591010   vmw_printf("%s OK\n", __FUNCTION__);
    960    return TRUE;
     1011   return true;
    9611012  out_no_caps:
    9621013   free(vws->ioctl.cap_3d);
     
    9661017   vws->ioctl.num_cap_3d = 0;
    9671018   debug_printf("%s Failed\n", __FUNCTION__);
    968    return FALSE;
     1019   return false;
    9691020}
    9701021
  • trunk/src/VBox/Additions/3D/win/VBoxSVGA/winsys/vmw_screen_wddm.c

    r98103 r103999  
    4747
    4848
     49#if VBOX_MESA_V_MAJOR < 24
    4950#include "pipe/p_compiler.h"
     51#else
     52#include "util/compiler.h"
     53#endif
    5054#include "util/u_inlines.h"
    5155#include "util/u_memory.h"
     
    7579                               struct winsys_handle *whandle,
    7680                               SVGA3dSurfaceFormat *format);
     81#if VBOX_MESA_V_MAJOR < 24
    7782static boolean
     83#else
     84static bool
     85#endif
    7886vmw_drm_surface_get_handle(struct svga_winsys_screen *sws,
    7987                           struct svga_winsys_surface *surface,
     
    116124{
    117125    RT_NOREF3(sws, whandle, format);
     126    AssertFailed();
    118127    return 0;
    119128}
     
    125134{
    126135    RT_NOREF3(sws, whandle, format);
     136    AssertFailed();
    127137    return 0;
    128138}
     
    134144 * which can be used to access the surface.
    135145 */
     146#if VBOX_MESA_V_MAJOR < 24
    136147static boolean
     148#else
     149static bool
     150#endif
    137151vmw_drm_surface_get_handle(struct svga_winsys_screen *sws,
    138152                           struct svga_winsys_surface *surface,
     
    146160
    147161    if (!surface)
    148         return FALSE;
     162        return false;
    149163
    150164    vsrf = vmw_svga_winsys_surface(surface);
     165#if VBOX_MESA_V_MAJOR < 24
    151166    whandle->handle = vsrf->sid;
     167#else
     168    whandle->handle = (HANDLE)(uintptr_t)vsrf->sid;
     169#endif
    152170    whandle->stride = stride;
    153171    whandle->offset = 0;
     
    156174    case WINSYS_HANDLE_TYPE_SHARED:
    157175    case WINSYS_HANDLE_TYPE_KMS:
    158        whandle->handle = vsrf->sid;
    159176       break;
    160177    case WINSYS_HANDLE_TYPE_FD:
    161        whandle->handle = vsrf->sid; /// @todo will this be enough for WDDM?
    162178       break;
    163179    default:
    164180       vmw_error("Attempt to export unsupported handle type %d.\n",
    165181                 whandle->type);
    166        return FALSE;
     182       return false;
    167183    }
    168184
    169     return TRUE;
     185    return true;
    170186}
    171187
  • trunk/src/VBox/Additions/3D/win/include/VBoxGaNine.h

    r98103 r103999  
    3838#endif
    3939
     40#if VBOX_MESA_V_MAJOR < 24
    4041struct pipe_screen;
    4142struct pipe_resource;
    4243struct pipe_context;
     44#endif
    4345typedef struct ID3DAdapter9 ID3DAdapter9;
    4446
     47#if VBOX_MESA_V_MAJOR < 24
    4548typedef HRESULT WINAPI FNGaNineD3DAdapter9Create(struct pipe_screen *s, ID3DAdapter9 **ppOut);
    4649typedef FNGaNineD3DAdapter9Create *PFNGaNineD3DAdapter9Create;
     
    5154typedef struct pipe_context * WINAPI FNGaNinePipeContextFromDevice(IDirect3DDevice9 *pDevice);
    5255typedef FNGaNinePipeContextFromDevice *PFNGaNinePipeContextFromDevice;
     56#else
     57typedef HRESULT WINAPI FNGaNineD3DAdapter9Create(const WDDMGalliumDriverEnv *pEnv, ID3DAdapter9 **ppOut);
     58typedef FNGaNineD3DAdapter9Create *PFNGaNineD3DAdapter9Create;
     59
     60typedef uint32_t WINAPI FNGaNineGetSurfaceId(IUnknown *pSurface);
     61typedef FNGaNineGetSurfaceId *PFNGaNineGetSurfaceId;
     62
     63typedef uint32_t WINAPI FNGaNineGetContextId(IDirect3DDevice9 *pDevice);
     64typedef FNGaNineGetContextId *PFNGaNineGetContextId;
     65
     66typedef void WINAPI FNGaNineFlush(IDirect3DDevice9 *pDevice);
     67typedef FNGaNineFlush *PFNGaNineFlush;
     68#endif
    5369
    5470#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette