VirtualBox

Changeset 25980 in vbox


Ignore:
Timestamp:
Jan 22, 2010 5:38:13 PM (15 years ago)
Author:
vboxsync
Message:

wddm: initial stub prototype, make common XPDM-WDDM driver parts DM-agnostic

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Miniport
Files:
4 edited

Legend:

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

    r23452 r25980  
    6666endif
    6767
     68ifdef VBOXWDDM
     69SYSMODS += VBoxVideoWddm
     70VBoxVideoWddm_TEMPLATE    = VBOXGUESTR0
     71ifdef VBOX_SIGN_ADDITIONS # (See the parent makefile.)
     72 VBoxVideoWddm_NOINST     = true
     73endif
     74VBoxVideoWddm_SDKS=WINDDKWLH
     75VBoxVideoWddm_DEFS          += LOG_TO_BACKDOOR VBOX_WITH_8BPP_MODES
     76#VBoxVideoWddm_DEFS         += LOG_ENABLED
     77VBoxVideoWddm_INCS          += ../../include
     78VBoxVideoWddm_LDFLAGS.x86   += /Entry:DriverEntry@8
     79VBoxVideoWddm_LDFLAGS.amd64 += /Entry:DriverEntry
     80VBoxVideoWddm_SOURCES     = \
     81        VBoxVideoHGSMI.cpp \
     82        VBoxVideo.cpp \
     83        wddm/VBoxVideoWddm.cpp \
     84        wddm/VBoxVideoWddm.def \
     85        wddm/VBoxVideoWddm.rc
     86#VBoxVideoWddm_LIBS.x86    += \
     87#       $(PATH_SDK_WINDDKWLH_LIB)/exsup.lib
     88VBoxVideoWddm_LIBS.x86    += \
     89        $(PATH_SDK_WINDDKWLH_LIB)/bufferoverflowu.lib
     90VBoxVideoWddm_LIBS        = \
     91        $(PATH_SDK_WINDDKWLH_LIB)/ntoskrnl.lib \
     92        $(PATH_SDK_WINDDKWLH_LIB)/hal.lib \
     93        $(PATH_SDK_WINDDKWLH_LIB)/displib.lib \
     94        $(VBOX_LIB_VBGL_R0) \
     95        $(VBOX_LIB_IPRT_GUEST_R0_NT4) \
     96        $(VBOX_PATH_ADDITIONS_LIB)/HGSMIGuestR0Lib$(VBOX_SUFF_LIB)
     97       
     98VBoxVideoWddm_DEFS += VBOX_WITH_HGSMI VBOXWDDM
     99
     100ifdef VBOX_WITH_VIDEOHWACCEL
     101VBoxVideoWddm_DEFS += VBOX_WITH_VIDEOHWACCEL
     102endif
     103
     104endif
     105
    68106include $(KBUILD_PATH)/subfooter.kmk
    69107
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp

    r24709 r25980  
    5555int vboxVbvaEnable (PDEVICE_EXTENSION pDevExt, ULONG ulEnable, VBVAENABLERESULT *pVbvaResult);
    5656
     57#ifndef VBOXWDDM
    5758ULONG DriverEntry(IN PVOID Context1, IN PVOID Context2)
    5859{
     
    861862}
    862863
     864#endif
     865
    863866/* Computes the size of a framebuffer. DualView has a few framebuffers of the computed size. */
    864867void VBoxComputeFrameBufferSizes (PDEVICE_EXTENSION PrimaryExtension)
     
    942945
    943946    PVOID VideoRamBase = NULL;
     947    ULONG VideoRamLength = ulSize;
     948    VP_STATUS Status;
     949#ifndef VBOXWDDM
    944950    ULONG inIoSpace = 0;
    945     ULONG VideoRamLength = ulSize;
    946 
    947     VP_STATUS Status = VideoPortMapMemory (PrimaryExtension, FrameBuffer,
     951
     952    Status = VideoPortMapMemory (PrimaryExtension, FrameBuffer,
    948953                                           &VideoRamLength, &inIoSpace,
    949954                                           &VideoRamBase);
     955#else
     956    VideoRamBase = MmMapIoSpace(FrameBuffer,
     957            VideoRamLength,
     958            MmNonCached);
     959    Status = VideoRamBase ? NO_ERROR : ERROR_INVALID_PARAMETER; /*<- this is what VideoPortMapMemory returns according to the docs */
     960#endif
    950961
    951962    if (Status == NO_ERROR)
     
    959970}
    960971
    961 void VBoxUnmapAdapterMemory (PDEVICE_EXTENSION PrimaryExtension, void **ppv)
     972void VBoxUnmapAdapterMemory (PDEVICE_EXTENSION PrimaryExtension, void **ppv, ULONG ulSize)
    962973{
    963974    dprintf(("VBoxVideo::VBoxMapAdapterMemory\n"));
     
    965976    if (*ppv)
    966977    {
     978#ifndef VBOXWDDM
    967979        VideoPortUnmapMemory(PrimaryExtension, *ppv, NULL);
     980#else
     981        MmUnmapIoSpace(*ppv, ulSize);
     982#endif
    968983    }
    969984
     
    972987
    973988#ifndef VBOX_WITH_HGSMI
     989
     990# ifdef VBOXWDDM
     991/* sanity check */
     992#  error WDDM is supported only for HGSMI-based driver
     993# endif
     994
    974995static void vboxQueryConf (PDEVICE_EXTENSION PrimaryExtension, uint32_t u32Index, ULONG *pulValue)
    975996{
     
    12471268    {
    12481269        /* Unmap the memory if VBoxVideo is not supported. */
    1249         VBoxUnmapAdapterMemory (PrimaryExtension, &PrimaryExtension->u.primary.pvMiniportHeap);
    1250         VBoxUnmapAdapterMemory (PrimaryExtension, &PrimaryExtension->u.primary.pvAdapterInformation);
     1270        VBoxUnmapAdapterMemory (PrimaryExtension, &PrimaryExtension->u.primary.pvMiniportHeap, PrimaryExtension->u.primary.cbMiniportHeap);
     1271        VBoxUnmapAdapterMemory (PrimaryExtension, &PrimaryExtension->u.primary.pvAdapterInformation, VBOX_VIDEO_ADAPTER_INFORMATION_SIZE);
    12511272    }
    12521273
     
    12541275}
    12551276#endif /* !VBOX_WITH_HGSMI */
     1277
     1278#ifndef VBOXWDDM
    12561279
    12571280VP_STATUS VBoxVideoFindAdapter(IN PVOID HwDeviceExtension,
     
    14621485}
    14631486
    1464 #if defined(VBOX_WITH_HGSMI) && defined(VBOX_WITH_VIDEOHWACCEL)
     1487# if defined(VBOX_WITH_HGSMI) && defined(VBOX_WITH_VIDEOHWACCEL)
    14651488
    14661489BOOLEAN VBoxVideoInterrupt(PVOID  HwDeviceExtension)
     
    14891512    return FALSE;
    14901513}
    1491 #endif
    1492 
     1514# endif /* #if defined(VBOX_WITH_HGSMI) && defined(VBOX_WITH_VIDEOHWACCEL) */
     1515#endif  /* #ifndef VBOXWDDM */
    14931516/**
    14941517 * Send a request to the host to make the absolute pointer visible
     
    15221545}
    15231546
     1547#ifndef VBOXWDDM
    15241548/**
    15251549 * VBoxVideoStartIO
     
    22342258    VbglTerminate ();
    22352259
    2236     VBoxUnmapAdapterMemory (pDevExt, &pDevExt->u.primary.pvMiniportHeap);
    2237     VBoxUnmapAdapterMemory (pDevExt, &pDevExt->u.primary.pvAdapterInformation);
     2260    VBoxUnmapAdapterMemory (pDevExt, &pDevExt->u.primary.pvMiniportHeap, pDevExt->u.primary.cbMiniportHeap);
     2261    VBoxUnmapAdapterMemory (pDevExt, &pDevExt->u.primary.pvAdapterInformation, VBVA_ADAPTER_INFORMATION_SIZE);
    22382262
    22392263    return TRUE;
     
    22632287    return NO_ERROR;
    22642288}
     2289#endif /* #ifndef VBOXWDDM */
    22652290
    22662291/**
     
    22972322}
    22982323
     2324#ifndef VBOXWDDM
     2325
    22992326/**
    23002327 * VBoxVideoSetCurrentMode
     
    23262353
    23272354    /* set the mode characteristics */
    2328     VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_XRES);
    2329     VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, (USHORT)ModeInfo->VisScreenWidth);
    2330     VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_YRES);
    2331     VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, (USHORT)ModeInfo->VisScreenHeight);
    2332     VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_BPP);
    2333     VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, (USHORT)ModeInfo->BitsPerPlane);
     2355    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_XRES);
     2356    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, (USHORT)ModeInfo->VisScreenWidth);
     2357    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_YRES);
     2358    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, (USHORT)ModeInfo->VisScreenHeight);
     2359    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_BPP);
     2360    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, (USHORT)ModeInfo->BitsPerPlane);
    23342361    /* enable the mode */
    2335     VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ENABLE);
    2336     VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED);
     2362    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ENABLE);
     2363    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, VBE_DISPI_ENABLED | VBE_DISPI_LFB_ENABLED);
    23372364    /** @todo read from the port to see if the mode switch was successful */
    23382365
     
    25082535    return TRUE;
    25092536}
    2510 
     2537#endif /* ifndef VBOXWDDM */
    25112538/*
    25122539 * VBoxVideoSetColorRegisters
     
    25342561        Entry++)
    25352562   {
    2536       VideoPortWritePortUchar((PUCHAR)0x03c8, (UCHAR)Entry);
    2537       VideoPortWritePortUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[Entry].RgbArray.Red);
    2538       VideoPortWritePortUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[Entry].RgbArray.Green);
    2539       VideoPortWritePortUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[Entry].RgbArray.Blue);
     2563      VBoxVideoCmnPortWriteUchar((PUCHAR)0x03c8, (UCHAR)Entry);
     2564      VBoxVideoCmnPortWriteUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[Entry].RgbArray.Red);
     2565      VBoxVideoCmnPortWriteUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[Entry].RgbArray.Green);
     2566      VBoxVideoCmnPortWriteUchar((PUCHAR)0x03c9, ColorLookUpTable->LookupTable[Entry].RgbArray.Blue);
    25402567   }
    25412568
     
    26252652        else
    26262653        {
    2627             VideoPortZeroMemory(&pVbvaResult, sizeof(VBVAENABLERESULT));
     2654            VBoxVideoCmnMemZero(&pVbvaResult, sizeof(VBVAENABLERESULT));
    26282655        }
    26292656
     
    26942721                    else
    26952722                    {
    2696                         VideoPortZeroMemory(&pVbvaResult, sizeof(VBVAENABLERESULT));
     2723                        VBoxVideoCmnMemZero(&pVbvaResult, sizeof(VBVAENABLERESULT));
    26972724                    }
    26982725
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h

    r24709 r25980  
    2525
    2626#ifdef VBOX_WITH_HGSMI
    27 #include <iprt/thread.h>
     27//#include <iprt/thread.h>
    2828
    2929#include <VBox/HGSMI/HGSMI.h>
     
    3333
    3434RT_C_DECLS_BEGIN
     35#ifndef VBOXWDDM
    3536#include "dderror.h"
    3637#include "devioctl.h"
     
    3839#include "ntddvdeo.h"
    3940#include "video.h"
     41#else
     42#   define VBOX_WITH_WORKAROUND_MISSING_PACK
     43#   if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)
     44#       define _InterlockedExchange           _InterlockedExchange_StupidDDKVsCompilerCrap
     45#       define _InterlockedExchangeAdd        _InterlockedExchangeAdd_StupidDDKVsCompilerCrap
     46#       define _InterlockedCompareExchange    _InterlockedCompareExchange_StupidDDKVsCompilerCrap
     47#       define _InterlockedAddLargeStatistic  _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
     48#       define _interlockedbittestandset      _interlockedbittestandset_StupidDDKVsCompilerCrap
     49#       define _interlockedbittestandreset    _interlockedbittestandreset_StupidDDKVsCompilerCrap
     50#       define _interlockedbittestandset64    _interlockedbittestandset64_StupidDDKVsCompilerCrap
     51#       define _interlockedbittestandreset64  _interlockedbittestandreset64_StupidDDKVsCompilerCrap
     52#       pragma warning(disable : 4163)
     53#       ifdef VBOX_WITH_WORKAROUND_MISSING_PACK
     54#          pragma warning(disable : 4103)
     55#       endif
     56#       include <ntddk.h>
     57#       pragma warning(default : 4163)
     58#       ifdef VBOX_WITH_WORKAROUND_MISSING_PACK
     59#         pragma pack()
     60#         pragma warning(default : 4103)
     61#       endif
     62#       undef  _InterlockedExchange
     63#       undef  _InterlockedExchangeAdd
     64#       undef  _InterlockedCompareExchange
     65#       undef  _InterlockedAddLargeStatistic
     66#       undef  _interlockedbittestandset
     67#       undef  _interlockedbittestandreset
     68#       undef  _interlockedbittestandset64
     69#       undef  _interlockedbittestandreset64
     70#   else
     71#       include <ntddk.h>
     72#   endif
     73#include "dispmprt.h"
     74#include "ntddvdeo.h"
     75#include "dderror.h"
     76#endif
    4077RT_C_DECLS_END
    4178
     
    70107#endif /* VBOX_WITH_HGSMI */
    71108
     109/* common API types */
     110#ifndef VBOXWDDM
     111typedef PSPIN_LOCK VBOXVCMNSPIN_LOCK, *PVBOXVCMNSPIN_LOCK;
     112typedef UCHAR VBOXVCMNIRQL, *PVBOXVCMNIRQL;
     113
     114typedef PEVENT VBOXVCMNEVENT, *PVBOXVCMNEVENT;
     115#else
     116typedef KSPIN_LOCK VBOXVCMNSPIN_LOCK, *PVBOXVCMNSPIN_LOCK;
     117typedef KIRQL VBOXVCMNIRQL, *PVBOXVCMNIRQL;
     118
     119typedef KEVENT VBOXVCMNEVENT, *PVBOXVCMNEVENT;
     120#endif
     121
    72122typedef struct _DEVICE_EXTENSION
    73123{
     
    117167           volatile HGSMIHOSTFLAGS * pHostFlags; /* HGSMI host flags */
    118168           volatile bool bHostCmdProcessing;
    119            PSPIN_LOCK pSynchLock;
     169           VBOXVCMNSPIN_LOCK pSynchLock;
    120170#endif
    121171
     
    148198           /* The IO Port Number for guest commands. */
    149199           RTIOPORT IOPortGuest;
    150 
     200# ifndef VBOXWDDM
    151201           /* Video Port API dynamically picked up at runtime for binary backwards compatibility with older NT versions */
    152202           VBOXVIDEOPORTPROCS VideoPortProcs;
     203# endif
    153204#endif /* VBOX_WITH_HGSMI */
    154205       } primary;
     
    177228extern "C"
    178229{
     230#ifndef VBOXWDDM
     231/* XPDM-WDDM common API */
     232
     233typedef PEVENT VBOXVCMNEVENT, *PVBOXVCMNEVENT;
     234
     235DECLINLINE(VOID) VBoxVideoCmnPortWriteUchar(IN PUCHAR Port, IN UCHAR Value)
     236{
     237    VideoPortWritePortUchar(Port,Value);
     238}
     239
     240DECLINLINE(VOID) VBoxVideoCmnPortWriteUshort(IN PUSHORT Port, IN USHORT Value)
     241{
     242    VideoPortWritePortUshort(Port,Value);
     243}
     244
     245DECLINLINE(VOID) VBoxVideoCmnPortWriteUlong(IN PULONG Port, IN ULONG Value)
     246{
     247    VideoPortWritePortUlong(Port,Value);
     248}
     249
     250DECLINLINE(UCHAR) VBoxVideoCmnPortReadUchar(IN PUCHAR  Port)
     251{
     252    return VideoPortReadPortUchar(Port);
     253}
     254
     255DECLINLINE(USHORT) VBoxVideoCmnPortReadUshort(IN PUSHORT Port)
     256{
     257    return VideoPortReadPortUshort(Port);
     258}
     259
     260DECLINLINE(ULONG) VBoxVideoCmnPortReadUlong(IN PULONG Port)
     261{
     262    return VideoPortReadPortUlong(Port);
     263}
     264
     265DECLINLINE(VOID) VBoxVideoCmnMemZero(PVOID pvMem, ULONG cbMem)
     266{
     267    VideoPortZeroMemory(pvMem, cbMem);
     268}
     269
     270DECLINLINE(VOID) VBoxVideoCmnSpinLockAcquire(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNSPIN_LOCK SpinLock, OUT PVBOXVCMNIRQL OldIrql)
     271{
     272    pDeviceExtension->u.primary.VideoPortProcs.pfnAcquireSpinLock(pDeviceExtension, *SpinLock, OldIrql);
     273}
     274
     275DECLINLINE(VOID) VBoxVideoCmnSpinLockAcquireAtDpcLevel(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNSPIN_LOCK SpinLock)
     276{
     277    pDeviceExtension->u.primary.VideoPortProcs.pfnAcquireSpinLockAtDpcLevel(pDeviceExtension, *SpinLock);
     278}
     279
     280DECLINLINE(VOID) VBoxVideoCmnSpinLockRelease(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNSPIN_LOCK SpinLock, IN VBOXVCMNIRQL NewIrql)
     281{
     282    pDeviceExtension->u.primary.VideoPortProcs.pfnReleaseSpinLock(pDeviceExtension, *SpinLock, NewIrql);
     283}
     284
     285DECLINLINE(VOID) VBoxVideoCmnSpinLockReleaseFromDpcLevel(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNSPIN_LOCK SpinLock)
     286{
     287    pDeviceExtension->u.primary.VideoPortProcs.pfnReleaseSpinLockFromDpcLevel(pDeviceExtension, *SpinLock);
     288}
     289
     290DECLINLINE(VP_STATUS) VBoxVideoCmnSpinLockCreate(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNSPIN_LOCK SpinLock)
     291{
     292    return pDeviceExtension->u.primary.VideoPortProcs.pfnCreateSpinLock(pDeviceExtension, SpinLock);
     293}
     294
     295DECLINLINE(VP_STATUS) VBoxVideoCmnSpinLockDelete(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNSPIN_LOCK SpinLock)
     296{
     297    return pDeviceExtension->u.primary.VideoPortProcs.pfnDeleteSpinLock(pDeviceExtension, *SpinLock);
     298}
     299
     300DECLINLINE(LONG) VBoxVideoCmnEventSet(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNEVENT pEvent)
     301{
     302    return pDeviceExtension->u.primary.VideoPortProcs.pfnSetEvent(pDeviceExtension, *pEvent);
     303}
     304
     305DECLINLINE(VP_STATUS) VBoxVideoCmnEventCreateNotification(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNEVENT pEvent, IN BOOLEAN bSignaled)
     306{
     307    ULONG fFlags = NOTIFICATION_EVENT;
     308    if(bSignaled)
     309        fFlags |= INITIAL_EVENT_SIGNALED;
     310
     311    return pDeviceExtension->u.primary.VideoPortProcs.pfnCreateEvent(pDeviceExtension, fFlags, NULL, pEvent);
     312}
     313
     314DECLINLINE(VP_STATUS) VBoxVideoCmnEventDelete(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNEVENT pEvent)
     315{
     316    return pDeviceExtension->u.primary.VideoPortProcs.pfnDeleteEvent(pDeviceExtension, *pEvent);
     317}
     318
     319DECLINLINE(PVOID) VBoxVideoCmnMemAllocNonPaged(IN PDEVICE_EXTENSION pDeviceExtension, IN SIZE_T NumberOfBytes, IN ULONG Tag)
     320{
     321    return pDeviceExtension->u.primary.VideoPortProcs.pfnAllocatePool(pDeviceExtension, (VBOXVP_POOL_TYPE)VpNonPagedPool, NumberOfBytes, Tag);
     322}
     323
     324DECLINLINE(VOID) VBoxVideoCmnMemFree(IN PDEVICE_EXTENSION pDeviceExtension, IN PVOID Ptr)
     325{
     326    pDeviceExtension->u.primary.VideoPortProcs.pfnFreePool(pDeviceExtension, Ptr);
     327}
     328/* */
    179329
    180330RT_C_DECLS_BEGIN
     
    214364   ULONG HwId,
    215365   PVIDEO_POWER_MANAGEMENT VideoPowerControl);
    216 
    217 BOOLEAN FASTCALL VBoxVideoSetCurrentMode(
    218    PDEVICE_EXTENSION DeviceExtension,
    219    PVIDEO_MODE RequestedMode,
    220    PSTATUS_BLOCK StatusBlock);
    221 
    222 BOOLEAN FASTCALL VBoxVideoResetDevice(
    223    PDEVICE_EXTENSION DeviceExtension,
    224    PSTATUS_BLOCK StatusBlock);
    225 
    226 BOOLEAN FASTCALL VBoxVideoMapVideoMemory(
    227    PDEVICE_EXTENSION DeviceExtension,
    228    PVIDEO_MEMORY RequestedAddress,
    229    PVIDEO_MEMORY_INFORMATION MapInformation,
    230    PSTATUS_BLOCK StatusBlock);
    231 
    232 BOOLEAN FASTCALL VBoxVideoUnmapVideoMemory(
    233    PDEVICE_EXTENSION DeviceExtension,
    234    PVIDEO_MEMORY VideoMemory,
    235    PSTATUS_BLOCK StatusBlock);
    236 
    237 BOOLEAN FASTCALL VBoxVideoQueryNumAvailModes(
    238    PDEVICE_EXTENSION DeviceExtension,
    239    PVIDEO_NUM_MODES Modes,
    240    PSTATUS_BLOCK StatusBlock);
    241 
    242 BOOLEAN FASTCALL VBoxVideoQueryAvailModes(
    243    PDEVICE_EXTENSION DeviceExtension,
    244    PVIDEO_MODE_INFORMATION ReturnedModes,
    245    PSTATUS_BLOCK StatusBlock);
    246 
    247 BOOLEAN FASTCALL VBoxVideoQueryCurrentMode(
    248    PDEVICE_EXTENSION DeviceExtension,
    249    PVIDEO_MODE_INFORMATION VideoModeInfo,
    250    PSTATUS_BLOCK StatusBlock);
    251 
    252 BOOLEAN FASTCALL VBoxVideoSetColorRegisters(
    253    PDEVICE_EXTENSION DeviceExtension,
    254    PVIDEO_CLUT ColorLookUpTable,
    255    PSTATUS_BLOCK StatusBlock);
    256366
    257367VP_STATUS VBoxVideoGetChildDescriptor(
     
    263373   PULONG pUnused);
    264374
     375
     376void VBoxSetupVideoPortFunctions(PDEVICE_EXTENSION PrimaryExtension,
     377                                VBOXVIDEOPORTPROCS *pCallbacks,
     378                                PVIDEO_PORT_CONFIG_INFO pConfigInfo);
     379
     380#else
     381
     382/* XPDM-WDDM common API */
     383DECLINLINE(VOID) VBoxVideoCmnPortWriteUchar(IN PUCHAR Port, IN UCHAR Value)
     384{
     385    WRITE_PORT_UCHAR(Port,Value);
     386}
     387
     388DECLINLINE(VOID) VBoxVideoCmnPortWriteUshort(IN PUSHORT Port, IN USHORT Value)
     389{
     390    WRITE_PORT_USHORT(Port,Value);
     391}
     392
     393DECLINLINE(VOID) VBoxVideoCmnPortWriteUlong(IN PULONG Port, IN ULONG Value)
     394{
     395    WRITE_PORT_ULONG(Port,Value);
     396}
     397
     398DECLINLINE(UCHAR) VBoxVideoCmnPortReadUchar(IN PUCHAR Port)
     399{
     400    return READ_PORT_UCHAR(Port);
     401}
     402
     403DECLINLINE(USHORT) VBoxVideoCmnPortReadUshort(IN PUSHORT Port)
     404{
     405    return READ_PORT_USHORT(Port);
     406}
     407
     408DECLINLINE(ULONG) VBoxVideoCmnPortReadUlong(IN PULONG Port)
     409{
     410    return READ_PORT_ULONG(Port);
     411}
     412
     413DECLINLINE(VOID) VBoxVideoCmnMemZero(PVOID pvMem, ULONG cbMem)
     414{
     415    memset(pvMem, 0, cbMem);
     416}
     417
     418DECLINLINE(VOID) VBoxVideoCmnSpinLockAcquire(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNSPIN_LOCK SpinLock, OUT PVBOXVCMNIRQL OldIrql)
     419{
     420    KeAcquireSpinLock(SpinLock, OldIrql);
     421}
     422
     423DECLINLINE(VOID) VBoxVideoCmnSpinLockAcquireAtDpcLevel(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNSPIN_LOCK SpinLock)
     424{
     425    KeAcquireSpinLockAtDpcLevel(SpinLock);
     426}
     427
     428DECLINLINE(VOID) VBoxVideoCmnSpinLockRelease(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNSPIN_LOCK SpinLock, IN VBOXVCMNIRQL NewIrql)
     429{
     430    KeReleaseSpinLock(SpinLock, NewIrql);
     431}
     432
     433DECLINLINE(VOID) VBoxVideoCmnSpinLockReleaseFromDpcLevel(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNSPIN_LOCK SpinLock)
     434{
     435    KeReleaseSpinLockFromDpcLevel(SpinLock);
     436}
     437
     438DECLINLINE(VP_STATUS) VBoxVideoCmnSpinLockCreate(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNSPIN_LOCK SpinLock)
     439{
     440    KeInitializeSpinLock(SpinLock);
     441    return NO_ERROR;
     442}
     443
     444DECLINLINE(VP_STATUS) VBoxVideoCmnSpinLockDelete(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNSPIN_LOCK SpinLock)
     445{
     446    return NO_ERROR;
     447}
     448
     449DECLINLINE(LONG) VBoxVideoCmnEventSet(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNEVENT pEvent)
     450{
     451    return KeSetEvent(pEvent, 0, FALSE);
     452}
     453
     454DECLINLINE(VP_STATUS) VBoxVideoCmnEventCreateNotification(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNEVENT pEvent, IN BOOLEAN bSignaled)
     455{
     456    KeInitializeEvent(pEvent, NotificationEvent, bSignaled);
     457    return NO_ERROR;
     458}
     459
     460DECLINLINE(VP_STATUS) VBoxVideoCmnEventDelete(IN PDEVICE_EXTENSION pDeviceExtension, IN PVBOXVCMNEVENT pEvent)
     461{
     462    return NO_ERROR;
     463}
     464
     465DECLINLINE(PVOID) VBoxVideoCmnMemAllocNonPaged(IN PDEVICE_EXTENSION pDeviceExtension, IN SIZE_T NumberOfBytes, IN ULONG Tag)
     466{
     467    return ExAllocatePoolWithTag(NonPagedPool, NumberOfBytes, Tag);
     468}
     469
     470DECLINLINE(VOID) VBoxVideoCmnMemFree(IN PDEVICE_EXTENSION pDeviceExtension, IN PVOID Ptr)
     471{
     472    ExFreePool(Ptr);
     473}
     474
     475/* */
     476
     477RT_C_DECLS_BEGIN
     478NTSTATUS
     479DriverEntry(
     480    IN PDRIVER_OBJECT DriverObject,
     481    IN PUNICODE_STRING RegistryPath
     482    );
     483RT_C_DECLS_END
     484#endif
     485
     486BOOLEAN FASTCALL VBoxVideoSetCurrentMode(
     487   PDEVICE_EXTENSION DeviceExtension,
     488   PVIDEO_MODE RequestedMode,
     489   PSTATUS_BLOCK StatusBlock);
     490
     491BOOLEAN FASTCALL VBoxVideoResetDevice(
     492   PDEVICE_EXTENSION DeviceExtension,
     493   PSTATUS_BLOCK StatusBlock);
     494
     495BOOLEAN FASTCALL VBoxVideoMapVideoMemory(
     496   PDEVICE_EXTENSION DeviceExtension,
     497   PVIDEO_MEMORY RequestedAddress,
     498   PVIDEO_MEMORY_INFORMATION MapInformation,
     499   PSTATUS_BLOCK StatusBlock);
     500
     501BOOLEAN FASTCALL VBoxVideoUnmapVideoMemory(
     502   PDEVICE_EXTENSION DeviceExtension,
     503   PVIDEO_MEMORY VideoMemory,
     504   PSTATUS_BLOCK StatusBlock);
     505
     506BOOLEAN FASTCALL VBoxVideoQueryNumAvailModes(
     507   PDEVICE_EXTENSION DeviceExtension,
     508   PVIDEO_NUM_MODES Modes,
     509   PSTATUS_BLOCK StatusBlock);
     510
     511BOOLEAN FASTCALL VBoxVideoQueryAvailModes(
     512   PDEVICE_EXTENSION DeviceExtension,
     513   PVIDEO_MODE_INFORMATION ReturnedModes,
     514   PSTATUS_BLOCK StatusBlock);
     515
     516BOOLEAN FASTCALL VBoxVideoQueryCurrentMode(
     517   PDEVICE_EXTENSION DeviceExtension,
     518   PVIDEO_MODE_INFORMATION VideoModeInfo,
     519   PSTATUS_BLOCK StatusBlock);
     520
     521BOOLEAN FASTCALL VBoxVideoSetColorRegisters(
     522   PDEVICE_EXTENSION DeviceExtension,
     523   PVIDEO_CLUT ColorLookUpTable,
     524   PSTATUS_BLOCK StatusBlock);
     525
    265526int VBoxMapAdapterMemory (PDEVICE_EXTENSION PrimaryExtension,
    266527                          void **ppv,
     
    269530
    270531void VBoxUnmapAdapterMemory (PDEVICE_EXTENSION PrimaryExtension,
    271                              void **ppv);
     532                             void **ppv, ULONG ulSize);
    272533
    273534void VBoxComputeFrameBufferSizes (PDEVICE_EXTENSION PrimaryExtension);
     
    280541DECLINLINE(void) VBoxHGSMIHostWrite(PDEVICE_EXTENSION PrimaryExtension, ULONG data)
    281542{
    282     VideoPortWritePortUlong((PULONG)PrimaryExtension->pPrimary->u.primary.IOPortHost, data);
     543    VBoxVideoCmnPortWriteUlong((PULONG)PrimaryExtension->pPrimary->u.primary.IOPortHost, data);
    283544}
    284545
    285546DECLINLINE(ULONG) VBoxHGSMIHostRead(PDEVICE_EXTENSION PrimaryExtension)
    286547{
    287     return VideoPortReadPortUlong((PULONG)PrimaryExtension->pPrimary->u.primary.IOPortHost);
     548    return VBoxVideoCmnPortReadUlong((PULONG)PrimaryExtension->pPrimary->u.primary.IOPortHost);
    288549}
    289550
    290551DECLINLINE(void) VBoxHGSMIGuestWrite(PDEVICE_EXTENSION PrimaryExtension, ULONG data)
    291552{
    292     VideoPortWritePortUlong((PULONG)PrimaryExtension->pPrimary->u.primary.IOPortGuest, data);
     553    VBoxVideoCmnPortWriteUlong((PULONG)PrimaryExtension->pPrimary->u.primary.IOPortGuest, data);
    293554}
    294555
    295556DECLINLINE(ULONG) VBoxHGSMIGuestRead(PDEVICE_EXTENSION PrimaryExtension)
    296557{
    297     return VideoPortReadPortUlong((PULONG)PrimaryExtension->pPrimary->u.primary.IOPortGuest);
     558    return VBoxVideoCmnPortReadUlong((PULONG)PrimaryExtension->pPrimary->u.primary.IOPortGuest);
    298559}
    299560
    300561BOOLEAN VBoxHGSMIIsSupported (PDEVICE_EXTENSION PrimaryExtension);
    301 
    302 void VBoxSetupVideoPortFunctions(PDEVICE_EXTENSION PrimaryExtension,
    303                                 VBOXVIDEOPORTPROCS *pCallbacks,
    304                                 PVIDEO_PORT_CONFIG_INFO pConfigInfo);
    305562
    306563VOID VBoxSetupDisplaysHGSMI (PDEVICE_EXTENSION PrimaryExtension,
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp

    r25062 r25980  
    8989#define VBOX_HGSMI_LOCK(_pe, _plock, _dpc, _pold) \
    9090    do { \
    91         if(_dpc) { \
    92             (_pe)->u.primary.VideoPortProcs.pfnAcquireSpinLockAtDpcLevel(_pe, _plock); \
     91        if(_dpc) \
     92        { \
     93            VBoxVideoCmnSpinLockAcquireAtDpcLevel(_pe, _plock); \
    9394        } \
    94         else {\
    95             (_pe)->u.primary.VideoPortProcs.pfnAcquireSpinLock(_pe, _plock, _pold); \
     95        else \
     96        {\
     97            VBoxVideoCmnSpinLockAcquire(_pe, _plock, _pold); \
    9698        }\
    9799    } while(0)
     
    99101#define VBOX_HGSMI_UNLOCK(_pe, _plock, _dpc, _pold) \
    100102    do { \
    101         if(_dpc) { \
    102             (_pe)->u.primary.VideoPortProcs.pfnReleaseSpinLockFromDpcLevel(_pe, _plock); \
     103        if(_dpc) \
     104        { \
     105            VBoxVideoCmnSpinLockReleaseFromDpcLevel(_pe, _plock); \
    103106        } \
    104         else {\
    105             (_pe)->u.primary.VideoPortProcs.pfnReleaseSpinLock(_pe, _plock, _pold); \
     107        else \
     108        {\
     109            VBoxVideoCmnSpinLockRelease(_pe, _plock, _pold); \
    106110        }\
    107111    } while(0)
     
    115119    uint32_t flags = (uint32_t)Context;
    116120    bool bProcessing = false;
    117     UCHAR OldIrql;
     121    VBOXVCMNIRQL OldIrql;
    118122    /* we check if another thread is processing the queue and exit if so */
    119123    do
     
    126130                break;
    127131            }
    128             VBOX_HGSMI_LOCK(PrimaryExtension, PrimaryExtension->u.primary.pSynchLock, flags, &OldIrql);
     132            VBOX_HGSMI_LOCK(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock, flags, &OldIrql);
    129133            if(!(PrimaryExtension->u.primary.pHostFlags->u32HostFlags & HGSMIHOSTFLAGS_COMMANDS_PENDING))
    130134            {
    131135                Assert(PrimaryExtension->u.primary.bHostCmdProcessing);
    132136                PrimaryExtension->u.primary.bHostCmdProcessing = false;
    133                 VBOX_HGSMI_UNLOCK(PrimaryExtension, PrimaryExtension->u.primary.pSynchLock, flags, OldIrql);
     137                VBOX_HGSMI_UNLOCK(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock, flags, OldIrql);
    134138                break;
    135139            }
    136             VBOX_HGSMI_UNLOCK(PrimaryExtension, PrimaryExtension->u.primary.pSynchLock, flags, OldIrql);
     140            VBOX_HGSMI_UNLOCK(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock, flags, OldIrql);
    137141        }
    138142        else
     
    140144            if(!bProcessing)
    141145            {
    142                 VBOX_HGSMI_LOCK(PrimaryExtension, PrimaryExtension->u.primary.pSynchLock, flags, &OldIrql);
     146                VBOX_HGSMI_LOCK(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock, flags, &OldIrql);
    143147                if(!(PrimaryExtension->u.primary.pHostFlags->u32HostFlags & HGSMIHOSTFLAGS_COMMANDS_PENDING)
    144148                        || PrimaryExtension->u.primary.bHostCmdProcessing)
    145149                {
    146                     VBOX_HGSMI_UNLOCK(PrimaryExtension, PrimaryExtension->u.primary.pSynchLock, flags, OldIrql);
     150                    VBOX_HGSMI_UNLOCK(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock, flags, OldIrql);
    147151                    break;
    148152                }
    149153                Assert(!PrimaryExtension->u.primary.bHostCmdProcessing);
    150154                PrimaryExtension->u.primary.bHostCmdProcessing = true;
    151                 VBOX_HGSMI_UNLOCK(PrimaryExtension, PrimaryExtension->u.primary.pSynchLock, flags, OldIrql);
     155                VBOX_HGSMI_UNLOCK(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock, flags, OldIrql);
    152156                bProcessing = true;
    153157            }
     
    168172    USHORT DispiId;
    169173
    170     VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ID);
    171     VideoPortWritePortUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, VBE_DISPI_ID_HGSMI);
    172 
    173     DispiId = VideoPortReadPortUshort((PUSHORT)VBE_DISPI_IOPORT_DATA);
     174    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ID);
     175    VBoxVideoCmnPortWriteUshort((PUSHORT)VBE_DISPI_IOPORT_DATA, VBE_DISPI_ID_HGSMI);
     176
     177    DispiId = VBoxVideoCmnPortReadUshort((PUSHORT)VBE_DISPI_IOPORT_DATA);
    174178
    175179    return (DispiId == VBE_DISPI_ID_HGSMI);
     
    411415}
    412416
     417#ifndef VBOXWDDM
    413418VP_STATUS vboxWaitForSingleObjectVoid(IN PVOID  HwDeviceExtension, IN PVOID  Object, IN PLARGE_INTEGER  Timeout  OPTIONAL)
    414419{
     
    630635#endif
    631636}
     637#endif
    632638
    633639/**
     
    663669    PrimaryExtension->u.primary.ulMaxFrameBufferSize     = 0;
    664670    PrimaryExtension->u.primary.bHGSMI                   = VBoxHGSMIIsSupported (PrimaryExtension);
    665     VideoPortZeroMemory(&PrimaryExtension->u.primary.areaHostHeap, sizeof(HGSMIAREA));
    666     VideoPortZeroMemory(&PrimaryExtension->areaDisplay, sizeof(HGSMIAREA));
     671    VBoxVideoCmnMemZero(&PrimaryExtension->u.primary.areaHostHeap, sizeof(HGSMIAREA));
     672    VBoxVideoCmnMemZero(&PrimaryExtension->areaDisplay, sizeof(HGSMIAREA));
    667673
    668674    if (PrimaryExtension->u.primary.IOPortGuest == 0)
     
    781787    if (PrimaryExtension->u.primary.bHGSMI)
    782788    {
     789#ifndef VBOXWDDM
    783790        typedef VP_STATUS (*PFNCREATESECONDARYDISPLAY)(PVOID, PVOID *, ULONG);
    784791        PFNCREATESECONDARYDISPLAY pfnCreateSecondaryDisplay = NULL;
     
    794801
    795802        if (pfnCreateSecondaryDisplay != NULL)
     803#endif
    796804        {
    797805            /* Query the configured number of displays. */
     
    808816            }
    809817
     818#ifndef VBOXWDDM
    810819            PDEVICE_EXTENSION pPrev = PrimaryExtension;
    811820
     
    838847               PrimaryExtension->u.primary.cDisplays++;
    839848            }
     849#else
     850            /* simply store the number of monitors, we will deal with VidPN stuff later */
     851            PrimaryExtension->u.primary.cDisplays = cDisplays;
     852#endif
    840853        }
    841854
     
    863876    {
    864877        /* Unmap the memory if VBoxVideo is not supported. */
    865         VBoxUnmapAdapterMemory (PrimaryExtension, &PrimaryExtension->u.primary.pvMiniportHeap);
    866         VBoxUnmapAdapterMemory (PrimaryExtension, &PrimaryExtension->u.primary.pvAdapterInformation);
     878        VBoxUnmapAdapterMemory (PrimaryExtension, &PrimaryExtension->u.primary.pvMiniportHeap, PrimaryExtension->u.primary.cbMiniportHeap);
     879        VBoxUnmapAdapterMemory (PrimaryExtension, &PrimaryExtension->u.primary.pvAdapterInformation, VBVA_ADAPTER_INFORMATION_SIZE);
    867880
    868881        HGSMIHeapDestroy (&PrimaryExtension->u.primary.hgsmiAdapterHeap);
     
    871884    if (PrimaryExtension->u.primary.bHGSMI)
    872885    {
    873         PrimaryExtension->u.primary.VideoPortProcs.pfnCreateSpinLock(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock);
     886        VBoxVideoCmnSpinLockCreate(PrimaryExtension, &PrimaryExtension->u.primary.pSynchLock);
    874887    }
    875888
     
    10081021    struct _VBVAHOSTCMD * pFirstCmd;
    10091022    struct _VBVAHOSTCMD * pLastCmd;
    1010     PSPIN_LOCK pSynchLock;
     1023    VBOXVCMNSPIN_LOCK pSynchLock;
    10111024#ifdef DEBUG
    10121025    int cCmds;
     
    10361049}
    10371050
    1038 void dbgCheckList(PDEVICE_EXTENSION PrimaryExtension, const VBVADISP_CHANNELCONTEXT *pList, struct _VBVAHOSTCMD * pCmd)
    1039 {
    1040     UCHAR oldIrql;
    1041     PrimaryExtension->u.primary.VideoPortProcs.pfnAcquireSpinLock(PrimaryExtension,
    1042                 pList->pSynchLock,
    1043             &oldIrql);
     1051void dbgCheckList(PDEVICE_EXTENSION PrimaryExtension, VBVADISP_CHANNELCONTEXT *pList, struct _VBVAHOSTCMD * pCmd)
     1052{
     1053    VBOXVCMNIRQL oldIrql;
     1054    VBoxVideoCmnSpinLockAcquire(PrimaryExtension, &pList->pSynchLock, &oldIrql);
    10441055
    10451056    dbgCheckListLocked(pList, pCmd);
    10461057
    1047     PrimaryExtension->u.primary.VideoPortProcs.pfnReleaseSpinLock(PrimaryExtension,
    1048                 pList->pSynchLock,
    1049             oldIrql);
     1058    VBoxVideoCmnSpinLockRelease(PrimaryExtension, &pList->pSynchLock, oldIrql);
    10501059}
    10511060
     
    10701079static int vboxVBVADeleteChannelContexts(PDEVICE_EXTENSION PrimaryExtension, VBVA_CHANNELCONTEXTS * pContext)
    10711080{
    1072     PrimaryExtension->u.primary.VideoPortProcs.pfnFreePool(PrimaryExtension,pContext);
     1081    VBoxVideoCmnMemFree(PrimaryExtension,pContext);
    10731082        return VINF_SUCCESS;
    10741083}
     
    10781087        uint32_t cDisplays = (uint32_t)PrimaryExtension->u.primary.cDisplays;
    10791088        const size_t size = RT_OFFSETOF(VBVA_CHANNELCONTEXTS, aContexts[cDisplays]);
    1080         VBVA_CHANNELCONTEXTS * pContext = (VBVA_CHANNELCONTEXTS*)PrimaryExtension->u.primary.VideoPortProcs.pfnAllocatePool(PrimaryExtension,
    1081                 VBoxVpNonPagedPool,
    1082                 size,
    1083                 MEM_TAG);
     1089        VBVA_CHANNELCONTEXTS * pContext = (VBVA_CHANNELCONTEXTS*)VBoxVideoCmnMemAllocNonPaged(PrimaryExtension, size, MEM_TAG);
    10841090        if(pContext)
    10851091        {
     
    11341140        {
    11351141            UCHAR oldIrql;
    1136             PrimaryExtension->u.primary.VideoPortProcs.pfnAcquireSpinLock(PrimaryExtension,
    1137                     pDispContext->pSynchLock,
    1138                     &oldIrql);
     1142            VBoxVideoCmnSpinLockAcquire(PrimaryExtension, &pDispContext->pSynchLock, &oldIrql);
    11391143
    11401144            DBG_CHECKLIST_LOCKED(pDispContext, NULL);
     
    11461150            pDispContext->cCmds = 0;
    11471151#endif
    1148             PrimaryExtension->u.primary.VideoPortProcs.pfnReleaseSpinLock(PrimaryExtension,
    1149                     pDispContext->pSynchLock,
    1150                     oldIrql);
     1152            VBoxVideoCmnSpinLockRelease(PrimaryExtension, &pDispContext->pSynchLock, oldIrql);
    11511153
    11521154            DBG_CHECKLIST(PrimaryExtension, pDispContext, NULL);
     
    12061208                        {
    12071209                            VBVAHOSTCMDEVENT *pEventCmd = VBVAHOSTCMD_BODY(pCur, VBVAHOSTCMDEVENT);
     1210#ifndef VBOXWDDM
    12081211                            PEVENT pEvent = (PEVENT)pEventCmd->pEvent;
    12091212                            pCallbacks->PrimaryExtension->u.primary.VideoPortProcs.pfnSetEvent(
    12101213                                    pCallbacks->PrimaryExtension,
    12111214                                    pEvent);
     1215#else
     1216                            PKEVENT pEvent = (PKEVENT)pEventCmd->pEvent;
     1217                            KeSetEvent(pEvent, 0, FALSE);
     1218#endif
    12121219                        }
    12131220                        default:
     
    12441251                        Assert(pLast);
    12451252                                        UCHAR oldIrql;
    1246                                         pCallbacks->PrimaryExtension->u.primary.VideoPortProcs.pfnAcquireSpinLock(pCallbacks->PrimaryExtension,
    1247                                                         pHandler->pSynchLock,
     1253                                        VBoxVideoCmnSpinLockAcquire(pCallbacks->PrimaryExtension,
     1254                                                        &pHandler->pSynchLock,
    12481255                                                        &oldIrql);
    12491256
     
    12661273                                        DBG_CHECKLIST_LOCKED(pHandler, NULL);
    12671274
    1268                                         pCallbacks->PrimaryExtension->u.primary.VideoPortProcs.pfnReleaseSpinLock(pCallbacks->PrimaryExtension,
    1269                                                         pHandler->pSynchLock,
     1275                                        VBoxVideoCmnSpinLockRelease(pCallbacks->PrimaryExtension,
     1276                                                        &pHandler->pSynchLock,
    12701277                                                        oldIrql);
    12711278                }
     
    13331340#endif
    13341341
    1335             PrimaryExtension->u.primary.VideoPortProcs.pfnCreateSpinLock(PrimaryExtension, &pDispContext->pSynchLock);
     1342            VBoxVideoCmnSpinLockCreate(PrimaryExtension, &pDispContext->pSynchLock);
    13361343
    13371344                        int rc = VINF_SUCCESS;
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