VirtualBox

Changeset 26969 in vbox for trunk/src/VBox


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
Files:
3 added
9 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
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r26856 r26969  
    4949*   Defined Constants And Macros                                               *
    5050*******************************************************************************/
     51#ifndef VBOX
    5152/** The default amount of VRAM. */
    5253#define VGA_VRAM_DEFAULT    (_4M)
     
    5556/** The minimum amount of VRAM. */
    5657#define VGA_VRAM_MIN        (_1M)
     58#else
     59/* moved to DevVGA.h */
     60#endif
    5761
    5862/** The size of the VGA GC mapping.
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r25985 r26969  
    4444 * THE SOFTWARE.
    4545 */
     46#ifdef VBOX
     47/** The default amount of VRAM. */
     48# define VGA_VRAM_DEFAULT    (_4M)
     49/** The maximum amount of VRAM. */
     50# define VGA_VRAM_MAX        (128 * _1M)
     51/** The minimum amount of VRAM. */
     52# define VGA_VRAM_MIN        (_1M)
     53#endif
    4654
    4755#ifdef VBOX_WITH_HGSMI
     
    252260#endif /* VBOX */
    253261
     262#ifdef VBOXVDMA
     263typedef struct VBOXVDMAHOST *PVBOXVDMAHOST;
     264#endif
     265
    254266typedef struct VGAState {
    255267    VGA_STATE_COMMON
     
    282294    R3PTRTYPE(PHGSMIINSTANCE)   pHGSMI;
    283295#endif /* VBOX_WITH_HGSMI */
     296#ifdef VBOXVDMA
     297    R3PTRTYPE(PVBOXVDMAHOST)    pVdma;
     298#endif
    284299
    285300    /** Current refresh timer interval. */
     
    476491int vboxVBVALoadStateDone (PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
    477492
     493# ifdef VBOXVDMA
     494int vboxVDMAConstruct(PVGASTATE pVGAState, struct VBOXVDMAHOST *pVdma);
     495int vboxVDMADestruct(PVGASTATE pVGAState, struct VBOXVDMAHOST *pVdma);
     496void vboxVDMAControl(PVGASTATE pVGAState, struct VBOXVDMAHOST *pVdma, PVBOXVDMA_CTL pCmd);
     497void vboxVDMACommand(PVGASTATE pVGAState, struct VBOXVDMAHOST *pVdma, PVBOXVDMACBUF_DR pCmd);
     498# endif /* VBOXVDMA */
     499
    478500#endif /* VBOX_WITH_HGSMI */
    479501
  • trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp

    r26856 r26969  
    3434#include <iprt/semaphore.h>
    3535#endif
    36 
    37 /** The default amount of VRAM. */
    38 #define VGA_VRAM_DEFAULT    (_4M)
    39 /** The maximum amount of VRAM. */
    40 #define VGA_VRAM_MAX        (128 * _1M)
    41 /** The minimum amount of VRAM. */
    42 #define VGA_VRAM_MIN        (_1M)
    4336
    4437#include "DevVGA.h"
     
    13041297#ifdef VBOXVDMA
    13051298        case VBVA_VDMA_CMD:
    1306         case VBVA_VDMA_CTL:
     1299        {
     1300            PVBOXVDMACBUF_DR pCmd = (PVBOXVDMACBUF_DR)VBoxSHGSMIBufferData ((PVBOXSHGSMIHEADER)pvBuffer);
     1301            vboxVDMACommand(pVGAState, pVGAState->pVdma, pCmd);
    13071302            rc = VINF_SUCCESS;
    13081303            break;
     1304        }
     1305        case VBVA_VDMA_CTL:
     1306        {
     1307            PVBOXVDMA_CTL pCmd = (PVBOXVDMA_CTL)VBoxSHGSMIBufferData ((PVBOXSHGSMIHEADER)pvBuffer);
     1308            vboxVDMAControl(pVGAState, pVGAState->pVdma, pCmd);
     1309            rc = VINF_SUCCESS;
     1310            break;
     1311        }
    13091312#endif
    13101313        case VBVA_QUERY_CONF32:
  • trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp

    r26556 r26969  
    16771677
    16781678    int rc = hgsmiGuestCompletionFIFOAlloc (pIns, &pEntry);
    1679 
     1679    AssertRC(rc);
    16801680    if (RT_SUCCESS (rc))
    16811681    {
     
    16831683
    16841684        rc = hgsmiFIFOLock(pIns);
     1685        AssertRC(rc);
    16851686        if (RT_SUCCESS (rc))
    16861687        {
  • trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.h

    r25062 r26969  
    136136int HGSMIHostSaveStateExec (PHGSMIINSTANCE pIns, PSSMHANDLE pSSM);
    137137
    138 #if 0
    139 /* Submit this buffer to the guest asynchronously. */
    140 int HGSMIHostBufferProcessAsync (PHGSMIINSTANCE pIns,
    141                                  void *pvMem,
    142                                  PFNHGSMIBUFFERPROCESSED);
     138#ifdef VBOXVDMA
     139int HGSMICompleteGuestCommand(PHGSMIINSTANCE pIns, void *pvMem, bool bDoIrq);
    143140#endif
    144141
  • trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHostHlp.h

    r26876 r26969  
    5050}
    5151
     52DECLINLINE(bool) hgsmiListIsEmpty (HGSMILIST *pList)
     53{
     54    return !pList->pHead;
     55}
     56
    5257DECLINLINE(void) hgsmiListInit (HGSMILIST *pList)
    5358{
  • trunk/src/VBox/Devices/Makefile.kmk

    r26951 r26969  
    348348ifdef VBOXVDMA
    349349 DevicesR3_DEFS        += VBOXVDMA
     350 DevicesR3_SOURCES      += \
     351        Graphics/HGSMI/SHGSMIHost.cpp \
     352    Graphics/DevVGA_VDMA.cpp
    350353endif
    351354
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