VirtualBox

Ignore:
Timestamp:
Mar 2, 2010 8:28:01 PM (15 years ago)
Author:
vboxsync
Message:

wddm: bugfixes + stubs for DMA support in VGA device

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoShgsmi.cpp

    r26930 r26969  
    2828
    2929/* SHGSMI */
    30 
    31 DECLINLINE(uint8_t *) vboxSHGSMIBufferData (const PVBOXSHGSMIHEADER pHeader)
    32 {
    33     return (uint8_t *)pHeader + sizeof (VBOXSHGSMIHEADER);
    34 }
    35 
    36 DECLINLINE(PVBOXSHGSMIHEADER) vboxSHGSMIBufferHeader (const void *pvData)
    37 {
    38     return (PVBOXSHGSMIHEADER)((uint8_t *)pvData - sizeof (VBOXSHGSMIHEADER));
    39 }
    40 
    4130DECLINLINE(void) vboxSHGSMICommandRetain (PVBOXSHGSMIHEADER pCmd)
    4231{
     
    6453DECLCALLBACK(void) vboxSHGSMICompletionCommandRelease(struct _HGSMIHEAP * pHeap, void *pvCmd, void *pvContext)
    6554{
    66     vboxSHGSMICommandRelease (pHeap, vboxSHGSMIBufferHeader(pvCmd));
     55    vboxSHGSMICommandRelease (pHeap, VBoxSHGSMIBufferHeader(pvCmd));
    6756}
    6857
     
    8877    {
    8978        PFNVBOXSHGSMICMDCOMPLETION pfnCompletion = (PFNVBOXSHGSMICMDCOMPLETION)pHeader->u64Info1;
    90         pfnCompletion(pHeap, vboxSHGSMIBufferData (pHeader), (PVOID)pHeader->u64Info2);
     79        pfnCompletion(pHeap, VBoxSHGSMIBufferData (pHeader), (PVOID)pHeader->u64Info2);
    9180    }
    9281
     
    9786void VBoxSHGSMICommandSubmitAsynchEvent (struct _HGSMIHEAP * pHeap, PVOID pvBuff, RTSEMEVENT hEventSem)
    9887{
    99     PVBOXSHGSMIHEADER pHeader = vboxSHGSMIBufferHeader (pvBuff);
     88    PVBOXSHGSMIHEADER pHeader = VBoxSHGSMIBufferHeader (pvBuff);
    10089    pHeader->u64Info1 = (uint64_t)vboxSHGSMICompletionSetEvent;
    10190    pHeader->u64Info2 = (uint64_t)hEventSem;
     
    125114{
    126115    fFlags &= ~VBOXSHGSMI_FLAG_GH_ASYNCH_CALLBACK_IRQ;
    127     PVBOXSHGSMIHEADER pHeader = vboxSHGSMIBufferHeader (pvBuff);
     116    PVBOXSHGSMIHEADER pHeader = VBoxSHGSMIBufferHeader (pvBuff);
    128117    pHeader->u64Info1 = (uint64_t)pfnCompletion;
    129118    pHeader->u64Info2 = (uint64_t)pvCompletion;
     
    136125{
    137126    fFlags |= VBOXSHGSMI_FLAG_GH_ASYNCH_CALLBACK_IRQ | VBOXSHGSMI_FLAG_GH_ASYNCH_IRQ;
    138     PVBOXSHGSMIHEADER pHeader = vboxSHGSMIBufferHeader (pvBuff);
     127    PVBOXSHGSMIHEADER pHeader = VBoxSHGSMIBufferHeader (pvBuff);
    139128    pHeader->u64Info1 = (uint64_t)pfnCompletion;
    140129    pHeader->u64Info2 = (uint64_t)pvCompletion;
     130    /* we must assign rather than or because flags field does not get zeroed on command creation */
    141131    pHeader->fFlags = fFlags;
    142132
     
    150140    Assert(pHeader);
    151141    if (pHeader)
    152         return vboxSHGSMIBufferData(pHeader);
     142    {
     143        pHeader->cRefs = 1;
     144        return VBoxSHGSMIBufferData(pHeader);
     145    }
    153146    return NULL;
    154147}
     
    156149void VBoxSHGSMICommandFree (struct _HGSMIHEAP * pHeap, void *pvBuffer)
    157150{
    158     PVBOXSHGSMIHEADER pHeader = vboxSHGSMIBufferHeader(pvBuffer);
     151    PVBOXSHGSMIHEADER pHeader = VBoxSHGSMIBufferHeader(pvBuffer);
    159152    vboxSHGSMICommandRelease (pHeap, pHeader);
    160153}
     
    204197                void *pvCallback = (void*)pCur->u64Info2;
    205198
    206                 pfnCallback(pHeap, vboxSHGSMIBufferData(pCur), pvCallback, &pfnCompletion, &pvCompletion);
     199                pfnCallback(pHeap, VBoxSHGSMIBufferData(pCur), pvCallback, &pfnCompletion, &pvCompletion);
    207200                if (pfnCompletion)
    208201                {
     
    222215                PFNVBOXSHGSMICMDCOMPLETION pfnCallback = (PFNVBOXSHGSMICMDCOMPLETION)pCur->u64Info1;
    223216                void *pvCallback = (void*)pCur->u64Info2;
    224                 pfnCallback(pHeap, vboxSHGSMIBufferData(pCur), pvCallback);
     217                pfnCallback(pHeap, VBoxSHGSMIBufferData(pCur), pvCallback);
    225218            }
    226219            else
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp

    r26661 r26969  
    3030
    3131
    32 static int vboxVdmaInformHost (PDEVICE_EXTENSION pDevExt, PVBOXVDMAINFO pInfo, uint32_t fFlags)
     32static int vboxVdmaInformHost (PDEVICE_EXTENSION pDevExt, PVBOXVDMAINFO pInfo, VBOXVDMA_CTL_TYPE enmCtl)
    3333{
    3434    int rc = VINF_SUCCESS;
     
    3737    if (pCmd)
    3838    {
    39         pCmd->u32Flags = fFlags;
     39        pCmd->enmCtl = enmCtl;
    4040        pCmd->u32Offset = pInfo->CmdHeap.area.offBase;
    4141        pCmd->i32Result = VERR_NOT_SUPPORTED;
     
    5151    {
    5252        drprintf((__FUNCTION__": HGSMIHeapAlloc failed\n"));
    53         rc = VERR_GENERAL_FAILURE;
     53        rc = VERR_OUT_OF_RESOURCES;
    5454    }
    5555
     
    115115    pInfo->fEnabled        = FALSE;
    116116
    117     int rc = vboxVdmaInformHost (pDevExt, pInfo, VBOXVDMA_CTL_DISABLE);
     117    int rc = vboxVdmaInformHost (pDevExt, pInfo, VBOXVDMA_CTL_TYPE_DISABLE);
    118118    AssertRC(rc);
    119119    return rc;
     
    128128        return VINF_ALREADY_INITIALIZED;
    129129
    130     int rc = vboxVdmaInformHost (pDevExt, pInfo, VBOXVDMA_CTL_ENABLE);
     130    int rc = vboxVdmaInformHost (pDevExt, pInfo, VBOXVDMA_CTL_TYPE_ENABLE);
    131131    Assert(RT_SUCCESS(rc));
    132132    if (RT_SUCCESS(rc))
     
    144144        return VINF_ALREADY_INITIALIZED;
    145145
    146     int rc = vboxVdmaInformHost (pDevExt, pInfo, VBOXVDMA_CTL_FLUSH);
     146    int rc = vboxVdmaInformHost (pDevExt, pInfo, VBOXVDMA_CTL_TYPE_FLUSH);
    147147    Assert(RT_SUCCESS(rc));
    148148
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