VirtualBox

Ignore:
Timestamp:
Oct 7, 2010 3:47:31 PM (14 years ago)
Author:
vboxsync
Message:

Additions/WINNT/Graphics: more refactoring

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

Legend:

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

    r31763 r32989  
    2222{
    2323    int rc = VERR_NO_MEMORY;
    24     void *p = vboxHGSMIBufferAlloc (pDevExt,
     24    void *p = vboxHGSMIBufferAlloc (commonFromDeviceExt(pDevExt),
    2525                                  sizeof (VBVAENABLE_EX),
    2626                                  HGSMI_CH_VBVA,
     
    4343        pEnable->i32Result = VERR_NOT_SUPPORTED;
    4444
    45         vboxHGSMIBufferSubmit (pDevExt, p);
     45        vboxHGSMIBufferSubmit (commonFromDeviceExt(pDevExt), p);
    4646
    4747        if (bEnable)
     
    5353            rc = VINF_SUCCESS;
    5454
    55         vboxHGSMIBufferFree (pDevExt, p);
     55        vboxHGSMIBufferFree (commonFromDeviceExt(pDevExt), p);
    5656    }
    5757    return rc;
     
    151151{
    152152    /* Issue the flush command. */
    153     void *p = vboxHGSMIBufferAlloc (pDevExt,
     153    void *p = vboxHGSMIBufferAlloc (commonFromDeviceExt(pDevExt),
    154154                              sizeof (VBVAFLUSH),
    155155                              HGSMI_CH_VBVA,
     
    166166        pFlush->u32Reserved = 0;
    167167
    168         vboxHGSMIBufferSubmit (pDevExt, p);
    169 
    170         vboxHGSMIBufferFree (pDevExt, p);
     168        vboxHGSMIBufferSubmit (commonFromDeviceExt(pDevExt), p);
     169
     170        vboxHGSMIBufferFree (commonFromDeviceExt(pDevExt), p);
    171171    }
    172172
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp

    r32889 r32989  
    10021002static int vboxWddmVdmaSubmitHgsmi(struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo, HGSMIOFFSET offDr)
    10031003{
    1004     VBoxHGSMIGuestWrite(hgsmiFromDeviceExt(pDevExt), offDr);
     1004    VBoxHGSMIGuestWrite(commonFromDeviceExt(pDevExt), offDr);
    10051005    return VINF_SUCCESS;
    10061006}
     
    10121012    int rc = VINF_SUCCESS;
    10131013
    1014     PVBOXVDMA_CTL pCmd = (PVBOXVDMA_CTL)VBoxSHGSMICommandAlloc(&hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap, sizeof (VBOXVDMA_CTL), HGSMI_CH_VBVA, VBVA_VDMA_CTL);
     1014    PVBOXVDMA_CTL pCmd = (PVBOXVDMA_CTL)VBoxSHGSMICommandAlloc(&commonFromDeviceExt(pDevExt)->hgsmiAdapterHeap, sizeof (VBOXVDMA_CTL), HGSMI_CH_VBVA, VBVA_VDMA_CTL);
    10151015    if (pCmd)
    10161016    {
     
    10191019        pCmd->i32Result = VERR_NOT_SUPPORTED;
    10201020
    1021         const VBOXSHGSMIHEADER* pHdr = VBoxSHGSMICommandPrepSynch(&hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap, pCmd);
     1021        const VBOXSHGSMIHEADER* pHdr = VBoxSHGSMICommandPrepSynch(&commonFromDeviceExt(pDevExt)->hgsmiAdapterHeap, pCmd);
    10221022        Assert(pHdr);
    10231023        if (pHdr)
     
    10251025            do
    10261026            {
    1027                 HGSMIOFFSET offCmd = VBoxSHGSMICommandOffset(&hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap, pHdr);
     1027                HGSMIOFFSET offCmd = VBoxSHGSMICommandOffset(&commonFromDeviceExt(pDevExt)->hgsmiAdapterHeap, pHdr);
    10281028                Assert(offCmd != HGSMIOFFSET_VOID);
    10291029                if (offCmd != HGSMIOFFSET_VOID)
     
    10331033                    if (RT_SUCCESS(rc))
    10341034                    {
    1035                         rc = VBoxSHGSMICommandDoneSynch(&hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap, pHdr);
     1035                        rc = VBoxSHGSMICommandDoneSynch(&commonFromDeviceExt(pDevExt)->hgsmiAdapterHeap, pHdr);
    10361036                        AssertRC(rc);
    10371037                        if (RT_SUCCESS(rc))
     
    10461046                    rc = VERR_INVALID_PARAMETER;
    10471047                /* fail to submit, cancel it */
    1048                 VBoxSHGSMICommandCancelSynch(&hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap, pHdr);
     1048                VBoxSHGSMICommandCancelSynch(&commonFromDeviceExt(pDevExt)->hgsmiAdapterHeap, pHdr);
    10491049            } while (0);
    10501050        }
    10511051
    1052         VBoxSHGSMICommandFree (&hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap, pCmd);
     1052        VBoxSHGSMICommandFree (&commonFromDeviceExt(pDevExt)->hgsmiAdapterHeap, pCmd);
    10531053    }
    10541054    else
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVhwa.cpp

    r32823 r32989  
    4545    if(!cRefs)
    4646    {
    47         vboxHGSMIBufferFree(pDevExt, pCmd);
     47        vboxHGSMIBufferFree(commonFromDeviceExt(pDevExt), pCmd);
    4848    }
    4949}
     
    6161    vbvaVhwaCommandRetain(pDevExt, pCmd);
    6262
    63     vboxHGSMIBufferSubmit(pDevExt, pCmd);
     63    vboxHGSMIBufferSubmit(commonFromDeviceExt(pDevExt), pCmd);
    6464
    6565    if(!(pCmd->Flags & VBOXVHWACMD_FLAG_HG_ASYNCH)
     
    100100                              VBVA_VHWA_CMD);
    101101#else
    102     VBOXVHWACMD* pHdr = (VBOXVHWACMD*)vboxHGSMIBufferAlloc(pDevExt,
     102    VBOXVHWACMD* pHdr = (VBOXVHWACMD*)vboxHGSMIBufferAlloc(commonFromDeviceExt(pDevExt),
    103103                              cbCmd + VBOXVHWACMD_HEADSIZE(),
    104104                              HGSMI_CH_VBVA,
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r32930 r32989  
    107107NTSTATUS vboxWddmGhDisplayPostInfoScreenBySDesc (PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SURFACE_DESC pDesc, POINT * pVScreenPos, uint16_t fFlags)
    108108{
    109     void *p = vboxHGSMIBufferAlloc (pDevExt,
     109    void *p = vboxHGSMIBufferAlloc (commonFromDeviceExt(pDevExt),
    110110                                      sizeof (VBVAINFOSCREEN),
    111111                                      HGSMI_CH_VBVA,
     
    126126        pScreen->u16Flags        = fFlags;
    127127
    128         vboxHGSMIBufferSubmit (pDevExt, p);
    129 
    130         vboxHGSMIBufferFree (pDevExt, p);
     128        vboxHGSMIBufferSubmit (commonFromDeviceExt(pDevExt), p);
     129
     130        vboxHGSMIBufferFree (commonFromDeviceExt(pDevExt), p);
    131131    }
    132132
     
    150150
    151151    /* Issue the screen info command. */
    152     void *p = vboxHGSMIBufferAlloc (pDevExt,
     152    void *p = vboxHGSMIBufferAlloc (commonFromDeviceExt(pDevExt),
    153153                                      sizeof (VBVAINFOVIEW),
    154154                                      HGSMI_CH_VBVA,
     
    165165        pView->u32MaxScreenSize = pView->u32ViewSize;
    166166
    167         vboxHGSMIBufferSubmit (pDevExt, p);
    168 
    169         vboxHGSMIBufferFree (pDevExt, p);
     167        vboxHGSMIBufferSubmit (commonFromDeviceExt(pDevExt), p);
     168
     169        vboxHGSMIBufferFree (commonFromDeviceExt(pDevExt), p);
    170170    }
    171171
     
    268268        return &pDevExt->u.primary.Vdma.CmdHeap;
    269269#endif
    270     if (HGSMIAreaContainsOffset(&hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap.area, offCmd))
    271         return &hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap;
     270    if (HGSMIAreaContainsOffset(&commonFromDeviceExt(pDevExt)->hgsmiAdapterHeap.area, offCmd))
     271        return &commonFromDeviceExt(pDevExt)->hgsmiAdapterHeap;
    272272    return NULL;
    273273}
     
    288288        return VBOXWDDM_HGSMICMD_TYPE_DMACMD;
    289289#endif
    290     if (HGSMIAreaContainsOffset(&hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap.area, offCmd))
     290    if (HGSMIAreaContainsOffset(&commonFromDeviceExt(pDevExt)->hgsmiAdapterHeap.area, offCmd))
    291291        return VBOXWDDM_HGSMICMD_TYPE_CTL;
    292292    return VBOXWDDM_HGSMICMD_TYPE_UNDEFINED;
     
    421421       if (VBoxHGSMIIsSupported (pContext))
    422422       {
    423            hgsmiFromDeviceExt(pContext)->IOPortHost = (RTIOPORT)VGA_PORT_HGSMI_HOST;
    424            hgsmiFromDeviceExt(pContext)->IOPortGuest = (RTIOPORT)VGA_PORT_HGSMI_GUEST;
     423           commonFromDeviceExt(pContext)->IOPortHost = (RTIOPORT)VGA_PORT_HGSMI_HOST;
     424           commonFromDeviceExt(pContext)->IOPortGuest = (RTIOPORT)VGA_PORT_HGSMI_GUEST;
    425425
    426426           PCM_RESOURCE_LIST pRcList = pDeviceInfo->TranslatedResourceList;
     
    580580                 */
    581581                VBoxSetupDisplaysHGSMI(pContext, AdapterMemorySize);
    582                 if (hgsmiFromDeviceExt(pContext)->bHGSMI)
     582                if (commonFromDeviceExt(pContext)->bHGSMI)
    583583                {
    584584                    drprintf(("VBoxVideoWddm: using HGSMI\n"));
     
    794794            {
    795795                /* read the command offset */
    796                 HGSMIOFFSET offCmd = VBoxHGSMIGuestRead(hgsmiFromDeviceExt(pDevExt));
     796                HGSMIOFFSET offCmd = VBoxHGSMIGuestRead(commonFromDeviceExt(pDevExt));
    797797                Assert(offCmd != HGSMIOFFSET_VOID);
    798798                if (offCmd != HGSMIOFFSET_VOID)
     
    811811                        case VBOXWDDM_HGSMICMD_TYPE_CTL:
    812812                            pList = &CtlList;
    813                             pHeap = &hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap;
     813                            pHeap = &commonFromDeviceExt(pDevExt)->hgsmiAdapterHeap;
    814814                            break;
    815815                        default:
     
    888888        if (bOur)
    889889        {
    890             HGSMIClearIrq (hgsmiFromDeviceExt(pDevExt));
     890            HGSMIClearIrq (commonFromDeviceExt(pDevExt));
    891891#ifdef DEBUG_misha
    892892            /* this is not entirely correct since host may concurrently complete some commands and raise a new IRQ while we are here,
     
    974974    if (!vboxSHGSMIListIsEmpty(&context.data.CtlList))
    975975    {
    976         int rc = VBoxSHGSMICommandPostprocessCompletion (&hgsmiFromDeviceExt(pDevExt)->hgsmiAdapterHeap, &context.data.CtlList);
     976        int rc = VBoxSHGSMICommandPostprocessCompletion (&commonFromDeviceExt(pDevExt)->hgsmiAdapterHeap, &context.data.CtlList);
    977977        AssertRC(rc);
    978978    }
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