VirtualBox

Changeset 71511 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Mar 26, 2018 1:14:10 PM (7 years ago)
Author:
vboxsync
Message:

WDDM: use VGA configuration interface

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h

    r71196 r71511  
    3333extern DWORD g_VBoxDisplayOnly;
    3434# include "wddm/VBoxMPTypes.h"
     35#endif
     36
     37typedef enum VBOX_HWTYPE
     38{
     39    VBOX_HWTYPE_CROGL = 0,
     40    VBOX_HWTYPE_VMSVGA = 1
     41} VBOX_HWTYPE;
     42
     43#ifdef VBOX_WDDM_MINIPORT
     44typedef struct VBOXWDDM_HWRESOURCES
     45{
     46    PHYSICAL_ADDRESS phVRAM;
     47    ULONG cbVRAM;
     48    ULONG ulApertureSize;
     49} VBOXWDDM_HWRESOURCES, *PVBOXWDDM_HWRESOURCES;
    3550#endif
    3651
     
    202217
    203218   HGSMIAREA areaDisplay;                      /* Entire VRAM chunk for this display device. */
     219
     220   VBOX_HWTYPE enmHwType;
     221#ifdef VBOX_WDDM_MINIPORT
     222   VBOXWDDM_HWRESOURCES HwResources;
     223#endif
     224
    204225} VBOXMP_DEVEXT, *PVBOXMP_DEVEXT;
    205226
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r71196 r71511  
    725725    return VBOXWDDM_HGSMICMD_TYPE_UNDEFINED;
    726726}
    727 
    728 typedef struct VBOXWDDM_HWRESOURCES
    729 {
    730     PHYSICAL_ADDRESS phVRAM;
    731     ULONG cbVRAM;
    732     ULONG ulApertureSize;
    733 } VBOXWDDM_HWRESOURCES, *PVBOXWDDM_HWRESOURCES;
    734727
    735728NTSTATUS vboxWddmPickResources(PVBOXMP_DEVEXT pDevExt, PDXGK_DEVICE_INFO pDeviceInfo, PVBOXWDDM_HWRESOURCES pHwResources)
     
    820813
    821814    VBoxVidPnTargetsInit(pDevExt->aTargets, RT_ELEMENTS(pDevExt->aTargets), 0);
     815
     816    uint32_t u32 = 0;
     817    if (VBoxVGACfgAvailable())
     818    {
     819        VBoxVGACfgQuery(VBE_DISPI_CFG_ID_VMSVGA, &u32, 0);
     820    }
     821    pDevExt->enmHwType = u32 ? VBOX_HWTYPE_VMSVGA : VBOX_HWTYPE_CROGL;
    822822}
    823823
     
    11391139        if (Status == STATUS_SUCCESS)
    11401140        {
    1141             VBOXWDDM_HWRESOURCES HwRc;
    1142             Status = vboxWddmPickResources(pDevExt, &DeviceInfo, &HwRc);
     1141            Status = vboxWddmPickResources(pDevExt, &DeviceInfo, &pDevExt->HwResources);
    11431142            if (Status == STATUS_SUCCESS)
    11441143            {
     
    11691168                 */
    11701169                VBoxSetupDisplaysHGSMI(VBoxCommonFromDeviceExt(pDevExt),
    1171                                        HwRc.phVRAM, HwRc.ulApertureSize, HwRc.cbVRAM,
     1170                                       pDevExt->HwResources.phVRAM, pDevExt->HwResources.ulApertureSize, pDevExt->HwResources.cbVRAM,
    11721171                                       VBVACAPS_COMPLETEGCMD_BY_IOREAD | VBVACAPS_IRQ);
    11731172                if (VBoxCommonFromDeviceExt(pDevExt)->bHGSMI)
     
    75957594    if (RT_SUCCESS(rc))
    75967595    {
     7596        /* Check whether 3D is required by the guest. */
    75977597        if (major > 6)
    75987598        {
     
    76207620        LOG(("3D is %srequired!", f3DRequired? "": "NOT "));
    76217621
    7622         Status = STATUS_SUCCESS;
     7622        /* Check whether 3D is provided by the host. */
     7623        VBOX_HWTYPE enmHwType = VBOX_HWTYPE_CROGL;
     7624        BOOL f3DSupported = FALSE;
     7625
     7626        if (VBoxVGACfgAvailable())
     7627        {
     7628            /* New configuration query interface is available. */
     7629            uint32_t u32;
     7630            if (VBoxVGACfgQuery(VBE_DISPI_CFG_ID_VERSION, &u32, 0))
     7631            {
     7632                LOGREL(("VGA configuration version %d", u32));
     7633            }
     7634
     7635            VBoxVGACfgQuery(VBE_DISPI_CFG_ID_3D, &u32, 0);
     7636            f3DSupported = RT_BOOL(u32);
     7637
     7638            VBoxVGACfgQuery(VBE_DISPI_CFG_ID_VMSVGA, &u32, 0);
     7639            if (u32)
     7640            {
     7641                enmHwType = VBOX_HWTYPE_VMSVGA;
     7642            }
     7643        }
     7644
     7645        BOOL fCmdVbva = FALSE;
     7646        if (enmHwType == VBOX_HWTYPE_CROGL)
     7647        {
     7648            /* Try to establish connection to the host 3D service. */
    76237649#ifdef VBOX_WITH_CROGL
    7624         VBoxMpCrCtlConInit();
    7625 
    7626         /* always need to do the check to request host caps */
    7627         LOG(("Doing the 3D check.."));
    7628         if (!VBoxMpCrCtlConIs3DSupported())
    7629 #endif
    7630         {
    7631             /* No 3D support by the host. */
    7632             if (VBoxQueryWinVersion() >= WINVERSION_8)
    7633             {
    7634                 /* Use display only driver for Win8+. */
    7635                 g_VBoxDisplayOnly = 1;
    7636 
    7637                 /* Black list some builds. */
    7638                 if (major == 6 && minor == 4 && build == 9841)
    7639                 {
    7640                     /* W10 Technical preview crashes with display-only driver. */
    7641                     LOGREL(("3D is NOT supported by the host, fallback to the system video driver."));
    7642                     Status = STATUS_UNSUCCESSFUL;
     7650            VBoxMpCrCtlConInit();
     7651
     7652            /* always need to do the check to request host caps */
     7653            LOG(("Doing the 3D check.."));
     7654            f3DSupported = VBoxMpCrCtlConIs3DSupported();
     7655
     7656            fCmdVbva = RT_BOOL(VBoxMpCrGetHostCaps() & CR_VBOX_CAP_CMDVBVA);
     7657#endif
     7658        }
     7659        else if (enmHwType == VBOX_HWTYPE_VMSVGA)
     7660        {
     7661            fCmdVbva = TRUE;
     7662        }
     7663        else
     7664        {
     7665            Status = STATUS_UNSUCCESSFUL;
     7666        }
     7667
     7668        LOGREL(("WDDM: 3D is %ssupported, hardware type %d", f3DSupported? "": "not ", enmHwType));
     7669
     7670        if (NT_SUCCESS(Status))
     7671        {
     7672            if (!f3DSupported)
     7673            {
     7674                /* No 3D support by the host. */
     7675                if (VBoxQueryWinVersion() >= WINVERSION_8)
     7676                {
     7677                    /* Use display only driver for Win8+. */
     7678                    g_VBoxDisplayOnly = 1;
     7679
     7680                    /* Black list some builds. */
     7681                    if (major == 6 && minor == 4 && build == 9841)
     7682                    {
     7683                        /* W10 Technical preview crashes with display-only driver. */
     7684                        LOGREL(("3D is NOT supported by the host, fallback to the system video driver."));
     7685                        Status = STATUS_UNSUCCESSFUL;
     7686                    }
     7687                    else
     7688                    {
     7689                        LOGREL(("3D is NOT supported by the host, falling back to display-only mode.."));
     7690                    }
    76437691                }
    76447692                else
    76457693                {
    7646                     LOGREL(("3D is NOT supported by the host, falling back to display-only mode.."));
    7647                 }
    7648             }
    7649             else
    7650             {
    7651                 if (f3DRequired)
    7652                 {
    7653                     LOGREL(("3D is NOT supported by the host, but is required for the current guest version using this driver.."));
    7654                     Status = STATUS_UNSUCCESSFUL;
    7655                 }
    7656                 else
    7657                     LOGREL(("3D is NOT supported by the host, but is NOT required for the current guest version using this driver, continuing with Disabled 3D.."));
     7694                    if (f3DRequired)
     7695                    {
     7696                        LOGREL(("3D is NOT supported by the host, but is required for the current guest version using this driver.."));
     7697                        Status = STATUS_UNSUCCESSFUL;
     7698                    }
     7699                    else
     7700                        LOGREL(("3D is NOT supported by the host, but is NOT required for the current guest version using this driver, continuing with Disabled 3D.."));
     7701                }
    76587702            }
    76597703        }
     
    76727716                else
    76737717                {
    7674                     Status = vboxWddmInitFullGraphicsDriver(DriverObject, RegistryPath,
    7675 #ifdef VBOX_WITH_CROGL
    7676                             !!(VBoxMpCrGetHostCaps() & CR_VBOX_CAP_CMDVBVA)
    7677 #else
    7678                             FALSE
    7679 #endif
    7680                             );
     7718                    Status = vboxWddmInitFullGraphicsDriver(DriverObject, RegistryPath, fCmdVbva);
    76817719                }
    76827720
    76837721                if (NT_SUCCESS(Status))
     7722                {
     7723                    /*
     7724                     * Successfully initialized the driver.
     7725                     */
    76847726                    return Status;
     7727                }
     7728
     7729                /*
     7730                 * Cleanup on failure.
     7731                 */
    76857732
    76867733#ifdef VBOX_WITH_CROGL
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