VirtualBox

Ignore:
Timestamp:
Nov 4, 2019 12:52:17 PM (5 years ago)
Author:
vboxsync
Message:

WDDM: support for the legacy VBoxVGA adapter

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/Makefile.kmk

    r80876 r81651  
    102102 VBoxWddm_SOURCES          = \
    103103        wddm/VBoxMPWddm.cpp \
     104        wddm/VBoxMPLegacy.cpp \
    104105        wddm/VBoxMPVidPn.cpp \
    105106        wddm/VBoxMPVdma.cpp \
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h

    r80876 r81651  
    133133   VBOXVIDEOCM_ALLOC_MGR AllocMgr;
    134134   /* mutex for context list operations */
     135   VBOXVDMADDI_NODE aNodes[VBOXWDDM_NUM_NODES];
     136   LIST_ENTRY DpcCmdQueue;
    135137   KSPIN_LOCK ContextLock;
    136138   KSPIN_LOCK SynchLock;
     
    195197#ifdef VBOX_WDDM_MINIPORT
    196198           VBOXVDMAINFO Vdma;
     199           UINT uLastCompletedPagingBufferCmdFenceId; /* Legacy */
    197200# ifdef VBOXVDMA_WITH_VBVA
    198201           VBOXVBVAINFO Vbva;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h

    r81594 r81651  
    5959#define VBOXWDDM_C_POINTER_MAX_HEIGHT_LEGACY 64
    6060#endif
     61
     62#define VBOXWDDM_DUMMY_DMABUFFER_SIZE 4
    6163
    6264#define VBOXWDDM_POINTER_ATTRIBUTES_SIZE VBOXWDDM_ROUNDBOUND( \
     
    274276} VBOXWDDM_VMODES;
    275277
     278typedef struct VBOXVDMADDI_CMD_QUEUE
     279{
     280    volatile uint32_t cQueuedCmds;
     281    LIST_ENTRY CmdQueue;
     282} VBOXVDMADDI_CMD_QUEUE, *PVBOXVDMADDI_CMD_QUEUE;
     283
     284typedef struct VBOXVDMADDI_NODE
     285{
     286    VBOXVDMADDI_CMD_QUEUE CmdQueue;
     287    UINT uLastCompletedFenceId;
     288} VBOXVDMADDI_NODE, *PVBOXVDMADDI_NODE;
     289
    276290#endif /* !GA_INCLUDED_SRC_WINNT_Graphics_Video_mp_wddm_VBoxMPTypes_h */
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp

    r80876 r81651  
    2424#include <iprt/asm.h>
    2525#include <iprt/mem.h>
    26 
    27 NTSTATUS vboxVdmaGgDmaBltPerform(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_ALLOC_DATA pSrcAlloc, RECT* pSrcRect,
    28         PVBOXWDDM_ALLOC_DATA pDstAlloc, RECT* pDstRect)
    29 {
    30     uint8_t* pvVramBase = pDevExt->pvVisibleVram;
    31     /* we do not support stretching */
    32     uint32_t srcWidth = pSrcRect->right - pSrcRect->left;
    33     uint32_t srcHeight = pSrcRect->bottom - pSrcRect->top;
    34     uint32_t dstWidth = pDstRect->right - pDstRect->left;
    35     uint32_t dstHeight = pDstRect->bottom - pDstRect->top;
    36     Assert(srcHeight == dstHeight);
    37     Assert(dstWidth == srcWidth);
    38     Assert(pDstAlloc->Addr.offVram != VBOXVIDEOOFFSET_VOID);
    39     Assert(pSrcAlloc->Addr.offVram != VBOXVIDEOOFFSET_VOID);
    40     D3DDDIFORMAT enmSrcFormat, enmDstFormat;
    41 
    42     enmSrcFormat = pSrcAlloc->SurfDesc.format;
    43     enmDstFormat = pDstAlloc->SurfDesc.format;
    44 
    45     if (pDstAlloc->Addr.SegmentId && pDstAlloc->Addr.SegmentId != 1)
    46     {
    47         WARN(("request to collor blit invalid allocation"));
    48         return STATUS_INVALID_PARAMETER;
    49     }
    50 
    51     if (pSrcAlloc->Addr.SegmentId && pSrcAlloc->Addr.SegmentId != 1)
    52     {
    53         WARN(("request to collor blit invalid allocation"));
    54         return STATUS_INVALID_PARAMETER;
    55     }
    56 
    57     if (enmSrcFormat != enmDstFormat)
    58     {
    59         /* just ignore the alpha component
    60          * this is ok since our software-based stuff can not handle alpha channel in any way */
    61         enmSrcFormat = vboxWddmFmtNoAlphaFormat(enmSrcFormat);
    62         enmDstFormat = vboxWddmFmtNoAlphaFormat(enmDstFormat);
    63         if (enmSrcFormat != enmDstFormat)
    64         {
    65             WARN(("color conversion src(%d), dst(%d) not supported!", pSrcAlloc->SurfDesc.format, pDstAlloc->SurfDesc.format));
    66             return STATUS_INVALID_PARAMETER;
    67         }
    68     }
    69     if (srcHeight != dstHeight)
    70             return STATUS_INVALID_PARAMETER;
    71     if (srcWidth != dstWidth)
    72             return STATUS_INVALID_PARAMETER;
    73     if (pDstAlloc->Addr.offVram == VBOXVIDEOOFFSET_VOID)
    74         return STATUS_INVALID_PARAMETER;
    75     if (pSrcAlloc->Addr.offVram == VBOXVIDEOOFFSET_VOID)
    76         return STATUS_INVALID_PARAMETER;
    77 
    78     uint8_t *pvDstSurf = pDstAlloc->Addr.SegmentId ? pvVramBase + pDstAlloc->Addr.offVram : (uint8_t*)pDstAlloc->Addr.pvMem;
    79     uint8_t *pvSrcSurf = pSrcAlloc->Addr.SegmentId ? pvVramBase + pSrcAlloc->Addr.offVram : (uint8_t*)pSrcAlloc->Addr.pvMem;
    80 
    81     if (pDstAlloc->SurfDesc.width == dstWidth
    82             && pSrcAlloc->SurfDesc.width == srcWidth
    83             && pSrcAlloc->SurfDesc.width == pDstAlloc->SurfDesc.width)
    84     {
    85         Assert(!pDstRect->left);
    86         Assert(!pSrcRect->left);
    87         uint32_t cbDstOff = vboxWddmCalcOffXYrd(0 /* x */, pDstRect->top, pDstAlloc->SurfDesc.pitch, pDstAlloc->SurfDesc.format);
    88         uint32_t cbSrcOff = vboxWddmCalcOffXYrd(0 /* x */, pSrcRect->top, pSrcAlloc->SurfDesc.pitch, pSrcAlloc->SurfDesc.format);
    89         uint32_t cbSize = vboxWddmCalcSize(pDstAlloc->SurfDesc.pitch, dstHeight, pDstAlloc->SurfDesc.format);
    90         memcpy(pvDstSurf + cbDstOff, pvSrcSurf + cbSrcOff, cbSize);
    91     }
    92     else
    93     {
    94         uint32_t cbDstLine =  vboxWddmCalcRowSize(pDstRect->left, pDstRect->right, pDstAlloc->SurfDesc.format);
    95         uint32_t offDstStart = vboxWddmCalcOffXYrd(pDstRect->left, pDstRect->top, pDstAlloc->SurfDesc.pitch, pDstAlloc->SurfDesc.format);
    96         Assert(cbDstLine <= pDstAlloc->SurfDesc.pitch);
    97         uint32_t cbDstSkip = pDstAlloc->SurfDesc.pitch;
    98         uint8_t * pvDstStart = pvDstSurf + offDstStart;
    99 
    100         uint32_t cbSrcLine = vboxWddmCalcRowSize(pSrcRect->left, pSrcRect->right, pSrcAlloc->SurfDesc.format);
    101         uint32_t offSrcStart = vboxWddmCalcOffXYrd(pSrcRect->left, pSrcRect->top, pSrcAlloc->SurfDesc.pitch, pSrcAlloc->SurfDesc.format);
    102         Assert(cbSrcLine <= pSrcAlloc->SurfDesc.pitch); NOREF(cbSrcLine);
    103         uint32_t cbSrcSkip = pSrcAlloc->SurfDesc.pitch;
    104         const uint8_t * pvSrcStart = pvSrcSurf + offSrcStart;
    105 
    106         uint32_t cRows = vboxWddmCalcNumRows(pDstRect->top, pDstRect->bottom, pDstAlloc->SurfDesc.format);
    107 
    108         Assert(cbDstLine == cbSrcLine);
    109 
    110         for (uint32_t i = 0; i < cRows; ++i)
    111         {
    112             memcpy(pvDstStart, pvSrcStart, cbDstLine);
    113             pvDstStart += cbDstSkip;
    114             pvSrcStart += cbSrcSkip;
    115         }
    116     }
    117     return STATUS_SUCCESS;
    118 }
    11926
    12027
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.h

    r80876 r81651  
    4141int vboxVdmaDestroy(PVBOXMP_DEVEXT pDevExt, PVBOXVDMAINFO pInfo);
    4242
    43 NTSTATUS vboxVdmaGgDmaBltPerform(PVBOXMP_DEVEXT pDevExt, struct VBOXWDDM_ALLOC_DATA * pSrcAlloc, RECT* pSrcRect,
    44         struct VBOXWDDM_ALLOC_DATA *pDstAlloc, RECT* pDstRect);
    45 
    4643#endif /* !GA_INCLUDED_SRC_WINNT_Graphics_Video_mp_wddm_VBoxMPVdma_h */
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r81632 r81651  
    2323#endif
    2424#include "VBoxMPVidPn.h"
     25#include "VBoxMPLegacy.h"
    2526
    2627#include <iprt/alloc.h>
     
    4243
    4344#include <stdio.h>
    44 
    45 #define VBOXWDDM_DUMMY_DMABUFFER_SIZE (sizeof(VBOXCMDVBVA_HDR) / 2)
    4645
    4746#ifdef DEBUG
     
    186185}
    187186
    188 DECLINLINE(PVBOXWDDM_ALLOCATION) vboxWddmGetAllocationFromAllocList(DXGK_ALLOCATIONLIST *pAllocList)
    189 {
    190     PVBOXWDDM_OPENALLOCATION pOa = (PVBOXWDDM_OPENALLOCATION)pAllocList->hDeviceSpecificAllocation;
    191     return pOa->pAllocation;
    192 }
    193 
    194187int vboxWddmGhDisplayPostInfoScreen(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData, const POINT * pVScreenPos, uint16_t fFlags)
    195188{
     
    630623        return &VBoxCommonFromDeviceExt(pDevExt)->guestCtx.heapCtx;
    631624    return NULL;
    632 }
    633 
    634 typedef enum
    635 {
    636     VBOXWDDM_HGSMICMD_TYPE_UNDEFINED = 0,
    637     VBOXWDDM_HGSMICMD_TYPE_CTL       = 1,
    638 } VBOXWDDM_HGSMICMD_TYPE;
    639 
    640 VBOXWDDM_HGSMICMD_TYPE vboxWddmHgsmiGetCmdTypeFromOffset(PVBOXMP_DEVEXT pDevExt, HGSMIOFFSET offCmd)
    641 {
    642     if (HGSMIAreaContainsOffset(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx.heapCtx.Heap.area, offCmd))
    643         return VBOXWDDM_HGSMICMD_TYPE_CTL;
    644     return VBOXWDDM_HGSMICMD_TYPE_UNDEFINED;
    645625}
    646626
     
    10841064                    LOG(("sources(%d), children(%d)", *NumberOfVideoPresentSources, *NumberOfChildren));
    10851065
     1066                    vboxVdmaDdiNodesInit(pDevExt);
    10861067                    vboxVideoCmInit(&pDevExt->CmMgr);
    10871068                    vboxVideoCmInit(&pDevExt->SeamlessCtxMgr);
     
    14031384}
    14041385
    1405 static BOOLEAN DxgkDdiInterruptRoutineLegacy(
    1406     IN CONST PVOID MiniportDeviceContext,
    1407     IN ULONG MessageNumber
    1408     )
    1409 {
    1410     RT_NOREF(MessageNumber);
    1411 //    LOGF(("ENTER, context(0x%p), msg(0x%x)", MiniportDeviceContext, MessageNumber));
    1412 
    1413     vboxVDbgBreakFv();
    1414 
    1415     PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)MiniportDeviceContext;
    1416     BOOLEAN bOur = FALSE;
    1417     BOOLEAN bNeedDpc = FALSE;
    1418     if (VBoxCommonFromDeviceExt(pDevExt)->hostCtx.pfHostFlags) /* If HGSMI is enabled at all. */
    1419     {
    1420         VBOXVTLIST CtlList;
    1421         vboxVtListInit(&CtlList);
    1422 
    1423 #ifdef VBOX_WITH_VIDEOHWACCEL
    1424         VBOXVTLIST VhwaCmdList;
    1425         vboxVtListInit(&VhwaCmdList);
    1426 #endif
    1427 
    1428         uint32_t flags = VBoxCommonFromDeviceExt(pDevExt)->hostCtx.pfHostFlags->u32HostFlags;
    1429         bOur = (flags & HGSMIHOSTFLAGS_IRQ);
    1430 
    1431         if (bOur)
    1432             VBoxHGSMIClearIrq(&VBoxCommonFromDeviceExt(pDevExt)->hostCtx);
    1433 
    1434         do
    1435         {
    1436             if (flags & HGSMIHOSTFLAGS_GCOMMAND_COMPLETED)
    1437             {
    1438                 /* read the command offset */
    1439                 HGSMIOFFSET offCmd = VBVO_PORT_READ_U32(VBoxCommonFromDeviceExt(pDevExt)->guestCtx.port);
    1440                 Assert(offCmd != HGSMIOFFSET_VOID);
    1441                 if (offCmd != HGSMIOFFSET_VOID)
    1442                 {
    1443                     VBOXWDDM_HGSMICMD_TYPE enmType = vboxWddmHgsmiGetCmdTypeFromOffset(pDevExt, offCmd);
    1444                     PVBOXVTLIST pList;
    1445                     PVBOXSHGSMI pHeap;
    1446                     switch (enmType)
    1447                     {
    1448                         case VBOXWDDM_HGSMICMD_TYPE_CTL:
    1449                             pList = &CtlList;
    1450                             pHeap = &VBoxCommonFromDeviceExt(pDevExt)->guestCtx.heapCtx;
    1451                             break;
    1452                         default:
    1453                             AssertBreakpoint();
    1454                             pList = NULL;
    1455                             pHeap = NULL;
    1456                             break;
    1457                     }
    1458 
    1459                     if (pHeap)
    1460                     {
    1461                         uint16_t chInfo;
    1462                         uint8_t RT_UNTRUSTED_VOLATILE_GUEST *pvCmd =
    1463                             HGSMIBufferDataAndChInfoFromOffset(&pHeap->Heap.area, offCmd, &chInfo);
    1464                         Assert(pvCmd);
    1465                         if (pvCmd)
    1466                         {
    1467                             switch (chInfo)
    1468                             {
    1469 #ifdef VBOX_WITH_VIDEOHWACCEL
    1470                                 case VBVA_VHWA_CMD:
    1471                                 {
    1472                                     vboxVhwaPutList(&VhwaCmdList, (VBOXVHWACMD*)pvCmd);
    1473                                     break;
    1474                                 }
    1475 #endif /* # ifdef VBOX_WITH_VIDEOHWACCEL */
    1476                                 default:
    1477                                     AssertBreakpoint();
    1478                             }
    1479                         }
    1480                     }
    1481                 }
    1482             }
    1483             else if (flags & HGSMIHOSTFLAGS_COMMANDS_PENDING)
    1484             {
    1485                 AssertBreakpoint();
    1486                 /** @todo FIXME: implement !!! */
    1487             }
    1488             else
    1489                 break;
    1490 
    1491             flags = VBoxCommonFromDeviceExt(pDevExt)->hostCtx.pfHostFlags->u32HostFlags;
    1492         } while (1);
    1493 
    1494         if (!vboxVtListIsEmpty(&CtlList))
    1495         {
    1496             vboxVtListCat(&pDevExt->CtlList, &CtlList);
    1497             bNeedDpc = TRUE;
    1498         }
    1499 #ifdef VBOX_WITH_VIDEOHWACCEL
    1500         if (!vboxVtListIsEmpty(&VhwaCmdList))
    1501         {
    1502             vboxVtListCat(&pDevExt->VhwaCmdList, &VhwaCmdList);
    1503             bNeedDpc = TRUE;
    1504         }
    1505 #endif
    1506 
    1507         if (pDevExt->bNotifyDxDpc)
    1508         {
    1509             bNeedDpc = TRUE;
    1510         }
    1511 
    1512         if (bOur)
    1513         {
    1514             if (flags & HGSMIHOSTFLAGS_VSYNC)
    1515             {
    1516                 Assert(0);
    1517                 DXGKARGCB_NOTIFY_INTERRUPT_DATA notify;
    1518                 for (UINT i = 0; i < (UINT)VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i)
    1519                 {
    1520                     PVBOXWDDM_TARGET pTarget = &pDevExt->aTargets[i];
    1521                     if (pTarget->fConnected)
    1522                     {
    1523                         memset(&notify, 0, sizeof(DXGKARGCB_NOTIFY_INTERRUPT_DATA));
    1524                         notify.InterruptType = DXGK_INTERRUPT_CRTC_VSYNC;
    1525                         notify.CrtcVsync.VidPnTargetId = i;
    1526                         pDevExt->u.primary.DxgkInterface.DxgkCbNotifyInterrupt(pDevExt->u.primary.DxgkInterface.DeviceHandle, &notify);
    1527                         bNeedDpc = TRUE;
    1528                     }
    1529                 }
    1530             }
    1531 
    1532             if (pDevExt->bNotifyDxDpc)
    1533             {
    1534                 bNeedDpc = TRUE;
    1535             }
    1536 
    1537 #if 0 //def DEBUG_misha
    1538             /* this is not entirely correct since host may concurrently complete some commands and raise a new IRQ while we are here,
    1539              * still this allows to check that the host flags are correctly cleared after the ISR */
    1540             Assert(VBoxCommonFromDeviceExt(pDevExt)->hostCtx.pfHostFlags);
    1541             uint32_t flags = VBoxCommonFromDeviceExt(pDevExt)->hostCtx.pfHostFlags->u32HostFlags;
    1542             Assert(flags == 0);
    1543 #endif
    1544         }
    1545 
    1546         if (bNeedDpc)
    1547         {
    1548             pDevExt->u.primary.DxgkInterface.DxgkCbQueueDpc(pDevExt->u.primary.DxgkInterface.DeviceHandle);
    1549         }
    1550     }
    1551 
    1552 //    LOGF(("LEAVE, context(0x%p), bOur(0x%x)", MiniportDeviceContext, (ULONG)bOur));
    1553 
    1554     return bOur;
    1555 }
    1556 
    1557 
    1558 typedef struct VBOXWDDM_DPCDATA
    1559 {
    1560     VBOXVTLIST CtlList;
    1561 #ifdef VBOX_WITH_VIDEOHWACCEL
    1562     VBOXVTLIST VhwaCmdList;
    1563 #endif
    1564     LIST_ENTRY CompletedDdiCmdQueue;
    1565     BOOL bNotifyDpc;
    1566 } VBOXWDDM_DPCDATA, *PVBOXWDDM_DPCDATA;
    1567 
    1568 typedef struct VBOXWDDM_GETDPCDATA_CONTEXT
    1569 {
    1570     PVBOXMP_DEVEXT pDevExt;
    1571     VBOXWDDM_DPCDATA data;
    1572 } VBOXWDDM_GETDPCDATA_CONTEXT, *PVBOXWDDM_GETDPCDATA_CONTEXT;
    1573 
    1574 BOOLEAN vboxWddmGetDPCDataCallback(PVOID Context)
    1575 {
    1576     PVBOXWDDM_GETDPCDATA_CONTEXT pdc = (PVBOXWDDM_GETDPCDATA_CONTEXT)Context;
    1577     PVBOXMP_DEVEXT pDevExt = pdc->pDevExt;
    1578     vboxVtListDetach2List(&pDevExt->CtlList, &pdc->data.CtlList);
    1579 #ifdef VBOX_WITH_VIDEOHWACCEL
    1580     vboxVtListDetach2List(&pDevExt->VhwaCmdList, &pdc->data.VhwaCmdList);
    1581 #endif
    1582 
    1583     pdc->data.bNotifyDpc = pDevExt->bNotifyDxDpc;
    1584     pDevExt->bNotifyDxDpc = FALSE;
    1585 
    1586     ASMAtomicWriteU32(&pDevExt->fCompletingCommands, 0);
    1587 
    1588     return TRUE;
    1589 }
    1590 
    1591 static VOID DxgkDdiDpcRoutineLegacy(
    1592     IN CONST PVOID  MiniportDeviceContext
    1593     )
    1594 {
    1595 //    LOGF(("ENTER, context(0x%p)", MiniportDeviceContext));
    1596 
    1597     vboxVDbgBreakFv();
    1598 
    1599     PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)MiniportDeviceContext;
    1600 
    1601     VBOXWDDM_GETDPCDATA_CONTEXT context = {0};
    1602     BOOLEAN bRet;
    1603 
    1604     context.pDevExt = pDevExt;
    1605 
    1606     /* get DPC data at IRQL */
    1607     NTSTATUS Status = pDevExt->u.primary.DxgkInterface.DxgkCbSynchronizeExecution(
    1608             pDevExt->u.primary.DxgkInterface.DeviceHandle,
    1609             vboxWddmGetDPCDataCallback,
    1610             &context,
    1611             0, /* IN ULONG MessageNumber */
    1612             &bRet);
    1613     AssertNtStatusSuccess(Status); NOREF(Status);
    1614 
    1615 //    if (context.data.bNotifyDpc)
    1616     pDevExt->u.primary.DxgkInterface.DxgkCbNotifyDpc(pDevExt->u.primary.DxgkInterface.DeviceHandle);
    1617 
    1618     if (!vboxVtListIsEmpty(&context.data.CtlList))
    1619     {
    1620         int rc = VBoxSHGSMICommandPostprocessCompletion (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx.heapCtx, &context.data.CtlList);
    1621         AssertRC(rc);
    1622     }
    1623 #ifdef VBOX_WITH_VIDEOHWACCEL
    1624     if (!vboxVtListIsEmpty(&context.data.VhwaCmdList))
    1625     {
    1626         vboxVhwaCompletionListProcess(pDevExt, &context.data.VhwaCmdList);
    1627     }
    1628 #endif
    1629 
    1630 //    LOGF(("LEAVE, context(0x%p)", MiniportDeviceContext));
    1631 }
    1632 
    16331386NTSTATUS DxgkDdiQueryChildRelations(
    16341387    IN CONST PVOID MiniportDeviceContext,
     
    48584611}
    48594612
    4860 static NTSTATUS vboxWddmInitDisplayOnlyDriver(IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING pRegistryPath)
     4613static NTSTATUS vboxWddmInitDisplayOnlyDriver(IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING pRegistryPath, VBOXVIDEO_HWTYPE enmHwType)
    48614614{
    48624615    KMDDOD_INITIALIZATION_DATA DriverInitializationData = {'\0'};
     
    48694622    DriverInitializationData.DxgkDdiRemoveDevice = DxgkDdiRemoveDevice;
    48704623    DriverInitializationData.DxgkDdiDispatchIoRequest = DxgkDdiDispatchIoRequest;
    4871     DriverInitializationData.DxgkDdiInterruptRoutine = DxgkDdiInterruptRoutineLegacy;
    4872     DriverInitializationData.DxgkDdiDpcRoutine = DxgkDdiDpcRoutineLegacy;
     4624#ifdef VBOX_WITH_MESA3D
     4625    if (enmHwType == VBOXVIDEO_HWTYPE_VMSVGA)
     4626    {
     4627        DriverInitializationData.DxgkDdiInterruptRoutine = GaDxgkDdiInterruptRoutine;
     4628        DriverInitializationData.DxgkDdiDpcRoutine = GaDxgkDdiDpcRoutine;
     4629    }
     4630    else
     4631#endif
     4632    {
     4633        DriverInitializationData.DxgkDdiInterruptRoutine = DxgkDdiInterruptRoutineLegacy;
     4634        DriverInitializationData.DxgkDdiDpcRoutine = DxgkDdiDpcRoutineLegacy;
     4635    }
    48734636    DriverInitializationData.DxgkDdiQueryChildRelations = DxgkDdiQueryChildRelations;
    48744637    DriverInitializationData.DxgkDdiQueryChildStatus = DxgkDdiQueryChildStatus;
     
    49204683}
    49214684
    4922 static NTSTATUS vboxWddmInitFullGraphicsDriver(IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING pRegistryPath)
     4685static NTSTATUS vboxWddmInitFullGraphicsDriver(IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING pRegistryPath, VBOXVIDEO_HWTYPE enmHwType)
    49234686{
    49244687    DRIVER_INITIALIZATION_DATA DriverInitializationData = {'\0'};
     
    49374700
    49384701#ifdef VBOX_WITH_MESA3D
    4939     DriverInitializationData.DxgkDdiInterruptRoutine  = GaDxgkDdiInterruptRoutine;
    4940     DriverInitializationData.DxgkDdiDpcRoutine        = GaDxgkDdiDpcRoutine;
    4941     DriverInitializationData.DxgkDdiPatch             = GaDxgkDdiPatch;
    4942     DriverInitializationData.DxgkDdiSubmitCommand     = GaDxgkDdiSubmitCommand;
    4943     DriverInitializationData.DxgkDdiPreemptCommand    = GaDxgkDdiPreemptCommand;
    4944     DriverInitializationData.DxgkDdiBuildPagingBuffer = GaDxgkDdiBuildPagingBuffer;
    4945     DriverInitializationData.DxgkDdiQueryCurrentFence = GaDxgkDdiQueryCurrentFence;
    4946     DriverInitializationData.DxgkDdiRender            = GaDxgkDdiRender;
    4947     DriverInitializationData.DxgkDdiPresent           = GaDxgkDdiPresent;
    4948 #endif
     4702    if (enmHwType == VBOXVIDEO_HWTYPE_VMSVGA)
     4703    {
     4704        DriverInitializationData.DxgkDdiInterruptRoutine  = GaDxgkDdiInterruptRoutine;
     4705        DriverInitializationData.DxgkDdiDpcRoutine        = GaDxgkDdiDpcRoutine;
     4706        DriverInitializationData.DxgkDdiPatch             = GaDxgkDdiPatch;
     4707        DriverInitializationData.DxgkDdiSubmitCommand     = GaDxgkDdiSubmitCommand;
     4708        DriverInitializationData.DxgkDdiPreemptCommand    = GaDxgkDdiPreemptCommand;
     4709        DriverInitializationData.DxgkDdiBuildPagingBuffer = GaDxgkDdiBuildPagingBuffer;
     4710        DriverInitializationData.DxgkDdiQueryCurrentFence = GaDxgkDdiQueryCurrentFence;
     4711        DriverInitializationData.DxgkDdiRender            = GaDxgkDdiRender;
     4712        DriverInitializationData.DxgkDdiPresent           = GaDxgkDdiPresent;
     4713    }
     4714    else
     4715#endif
     4716    {
     4717        DriverInitializationData.DxgkDdiInterruptRoutine  = DxgkDdiInterruptRoutineLegacy;
     4718        DriverInitializationData.DxgkDdiDpcRoutine        = DxgkDdiDpcRoutineLegacy;
     4719        DriverInitializationData.DxgkDdiPatch             = DxgkDdiPatchLegacy;
     4720        DriverInitializationData.DxgkDdiSubmitCommand     = DxgkDdiSubmitCommandLegacy;
     4721        DriverInitializationData.DxgkDdiPreemptCommand    = DxgkDdiPreemptCommandLegacy;
     4722        DriverInitializationData.DxgkDdiBuildPagingBuffer = DxgkDdiBuildPagingBufferLegacy;
     4723        DriverInitializationData.DxgkDdiQueryCurrentFence = DxgkDdiQueryCurrentFenceLegacy;
     4724        DriverInitializationData.DxgkDdiRender            = DxgkDdiRenderLegacy;
     4725        DriverInitializationData.DxgkDdiPresent           = DxgkDdiPresentLegacy;
     4726    }
    49494727
    49504728    DriverInitializationData.DxgkDdiQueryChildRelations = DxgkDdiQueryChildRelations;
     
    51704948            if (g_VBoxDisplayOnly)
    51714949            {
    5172                 Status = vboxWddmInitDisplayOnlyDriver(DriverObject, RegistryPath);
     4950                Status = vboxWddmInitDisplayOnlyDriver(DriverObject, RegistryPath, enmHwType);
    51734951            }
    51744952            else
    51754953            {
    5176                 Assert(enmHwType == VBOXVIDEO_HWTYPE_VMSVGA);
    5177                 Status = vboxWddmInitFullGraphicsDriver(DriverObject, RegistryPath);
     4954                Status = vboxWddmInitFullGraphicsDriver(DriverObject, RegistryPath, enmHwType);
    51784955            }
    51794956
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h

    r80483 r81651  
    210210    } while (0)
    211211
     212DECLINLINE(PVBOXWDDM_ALLOCATION) vboxWddmGetAllocationFromAllocList(DXGK_ALLOCATIONLIST *pAllocList)
     213{
     214    PVBOXWDDM_OPENALLOCATION pOa = (PVBOXWDDM_OPENALLOCATION)pAllocList->hDeviceSpecificAllocation;
     215    return pOa->pAllocation;
     216}
     217
    212218#endif /* !GA_INCLUDED_SRC_WINNT_Graphics_Video_mp_wddm_VBoxMPWddm_h */
    213219
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