VirtualBox

Changeset 33165 in vbox


Ignore:
Timestamp:
Oct 15, 2010 4:04:33 PM (14 years ago)
Author:
vboxsync
Message:

Additions/WINNT/Graphics: more refactoring

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

Legend:

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

    r33048 r33165  
    17001700       * with old guest additions.
    17011701       */
    1702       VBoxSetupDisplaysHGSMI((PDEVICE_EXTENSION)HwDeviceExtension, ConfigInfo, AdapterMemorySize);
     1702      VBoxSetupDisplaysHGSMI((PDEVICE_EXTENSION)HwDeviceExtension, ConfigInfo, AdapterMemorySize, 0);
    17031703
    17041704      if (commonFromDeviceExt((PDEVICE_EXTENSION)HwDeviceExtension)->bHGSMI)
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h

    r33085 r33165  
    220220                                         */
    221221
     222    /** Host HGSMI capabilities the guest can handle */
     223    uint32_t fCaps;
     224
    222225    BOOLEAN bHGSMI;                     /* Whether HGSMI is enabled. */
    223226
     
    232235
    233236    /* The IO Port Number for guest commands. */
    234     RTIOPORT IOPortGuest;
     237    RTIOPORT IOPortGuest;   
    235238} VBOXVIDEO_COMMON, *PVBOXVIDEO_COMMON;
    236239
     
    886889                             PVIDEO_PORT_CONFIG_INFO pConfigInfo,
    887890#endif
    888                              ULONG AdapterMemorySize);
     891                             ULONG AdapterMemorySize, uint32_t fCaps);
    889892BOOLEAN vboxUpdatePointerShape (PDEVICE_EXTENSION DeviceExtension,
    890893                                PVIDEO_POINTER_ATTRIBUTES pointerAttr,
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp

    r33085 r33165  
    316316}
    317317
    318 static int vboxQueryConfHGSMI (PDEVICE_EXTENSION PrimaryExtension, uint32_t u32Index, ULONG *pulValue)
     318static int vboxQueryConfHGSMI (PVBOXVIDEO_COMMON pCommon, uint32_t u32Index, ULONG *pulValue)
    319319{
    320320    dprintf(("VBoxVideo::vboxQueryConf: u32Index = %d\n", u32Index));
     
    325325    context.pulValue = pulValue;
    326326
    327     int rc = vboxCallVBVA (commonFromDeviceExt(PrimaryExtension),
     327    int rc = vboxCallVBVA (pCommon,
    328328                           VBVA_QUERY_CONF32,
    329329                           sizeof (VBVACONF32),
     
    389389    return VERR_INTERNAL_ERROR;
    390390}
    391 #else
    392 int vbvaInitInfoCaps (PVBOXVIDEO_COMMON, void *pvContext, void *pvData)
     391#endif
     392int vbvaInitInfoCaps (PVBOXVIDEO_COMMON pCommon, void *pvContext, void *pvData)
    393393{
    394394    VBVACAPS *pCaps = (VBVACAPS*)pvData;
    395395    pCaps->rc = VERR_NOT_IMPLEMENTED;
    396     pCaps->fCaps = VBVACAPS_COMPLETEGCMD_BY_IOREAD | VBVACAPS_IRQ;
     396    pCaps->fCaps = pCommon->fCaps;
    397397    return VINF_SUCCESS;
    398398}
     
    405405    return pCaps->rc;
    406406}
    407 #endif
    408407
    409408static int vbvaInitInfoHeap (PVBOXVIDEO_COMMON pCommon, void *pvContext, void *pvData)
     
    445444                       NULL);
    446445    AssertRC(rc);
    447     if(RT_SUCCESS (rc))
    448     {
    449446#ifndef VBOX_WITH_WDDM
     447    if (RT_SUCCESS(rc))
     448    {
    450449        rc = VBoxHGSMISendViewInfo (commonFromDeviceExt(PrimaryExtension),
    451450                               PrimaryExtension->u.primary.cDisplays,
     
    453452                               (void *) PrimaryExtension);
    454453        AssertRC(rc);
    455         if (RT_SUCCESS (rc))
    456 #else
    457         /* in case of WDDM we do not control the framebuffer location,
    458          * i.e. it is assigned by Video Memory Manager,
    459          * The FB information should be passed to guest from our DxgkDdiSetVidPnSourceAddress callback */
    460 
     454    }
     455    /* in case of WDDM we do not control the framebuffer location,
     456     * i.e. it is assigned by Video Memory Manager,
     457     * The FB information should be passed to guest from our
     458     * DxgkDdiSetVidPnSourceAddress callback */
     459#endif
     460    if (RT_SUCCESS(rc) && commonFromDeviceExt(PrimaryExtension)->fCaps)
     461    {
    461462        /* Inform about caps */
    462463        rc = vboxCallVBVA (commonFromDeviceExt(PrimaryExtension),
     
    467468                               NULL);
    468469        AssertRC(rc);
    469         if (RT_SUCCESS (rc))
    470 #endif
    471         {
    472             /* Report the host heap location. */
    473             rc = vboxCallVBVA (commonFromDeviceExt(PrimaryExtension),
    474                                VBVA_INFO_HEAP,
    475                                sizeof (VBVAINFOHEAP),
    476                                vbvaInitInfoHeap,
    477                                NULL,
    478                                NULL);
    479             AssertRC(rc);
    480         }
     470    }
     471    if (RT_SUCCESS (rc))
     472    {
     473        /* Report the host heap location. */
     474        rc = vboxCallVBVA (commonFromDeviceExt(PrimaryExtension),
     475                           VBVA_INFO_HEAP,
     476                           sizeof (VBVAINFOHEAP),
     477                           vbvaInitInfoHeap,
     478                           NULL,
     479                           NULL);
     480        AssertRC(rc);
    481481    }
    482482
     
    721721        PVIDEO_PORT_CONFIG_INFO pConfigInfo,
    722722#endif
    723         ULONG AdapterMemorySize)
     723        ULONG AdapterMemorySize, uint32_t fCaps)
    724724{
    725725    VP_STATUS rc = NO_ERROR;
     
    750750    commonFromDeviceExt(PrimaryExtension)->pHostFlags               = NULL;
    751751    PrimaryExtension->u.primary.ulMaxFrameBufferSize     = 0;
    752     commonFromDeviceExt(PrimaryExtension)->bHGSMI         = VBoxHGSMIIsSupported ();
     752    commonFromDeviceExt(PrimaryExtension)->fCaps         = fCaps;
     753    commonFromDeviceExt(PrimaryExtension)->bHGSMI        = VBoxHGSMIIsSupported ();
    753754    VBoxVideoCmnMemZero(&commonFromDeviceExt(PrimaryExtension)->areaHostHeap, sizeof(HGSMIAREA));
    754755    VBoxVideoCmnMemZero(&PrimaryExtension->areaDisplay, sizeof(HGSMIAREA));
     
    803804        /* The miniport heap is used for the host buffers. */
    804805        ULONG cbMiniportHeap = 0;
    805         vboxQueryConfHGSMI (PrimaryExtension, VBOX_VBVA_CONF32_HOST_HEAP_SIZE, &cbMiniportHeap);
     806        vboxQueryConfHGSMI (commonFromDeviceExt(PrimaryExtension), VBOX_VBVA_CONF32_HOST_HEAP_SIZE, &cbMiniportHeap);
    806807
    807808        if (cbMiniportHeap != 0)
     
    887888            /* Query the configured number of displays. */
    888889            ULONG cDisplays = 0;
    889             vboxQueryConfHGSMI (PrimaryExtension, VBOX_VBVA_CONF32_MONITOR_COUNT, &cDisplays);
     890            vboxQueryConfHGSMI (commonFromDeviceExt(PrimaryExtension), VBOX_VBVA_CONF32_MONITOR_COUNT, &cDisplays);
    890891
    891892            dprintf(("VBoxVideo::VBoxSetupDisplays: cDisplays = %d\n",
     
    12471248}
    12481249
     1250#ifndef VBOX_WITH_WDDM
    12491251typedef struct _VBVAMINIPORT_CHANNELCONTEXT
    12501252{
     
    13521354}
    13531355
    1354 #ifndef VBOX_WITH_WDDM
    13551356DECLCALLBACK(void) hgsmiHostCmdComplete (HVBOXVIDEOHGSMI hHGSMI, struct _VBVAHOSTCMD * pCmd)
    13561357{
     
    14011402    return VERR_INVALID_PARAMETER;
    14021403}
    1403 #endif
    14041404
    14051405static DECLCALLBACK(int) vboxVBVAChannelGenericHandler(void *pvHandler, uint16_t u16ChannelInfo, void *pvBuffer, HGSMISIZE cbBuffer)
     
    16101610    return VERR_GENERAL_FAILURE;
    16111611}
     1612#endif /* !VBOX_WITH_WDDM */
    16121613
    16131614/** @todo Mouse pointer position to be read from VMMDev memory, address of the memory region
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r33146 r33165  
    579579                 * with old guest additions.
    580580                 */
    581                 VBoxSetupDisplaysHGSMI(pContext, AdapterMemorySize);
     581                VBoxSetupDisplaysHGSMI(pContext, AdapterMemorySize,
     582                                       VBVACAPS_COMPLETEGCMD_BY_IOREAD | VBVACAPS_IRQ);
    582583                if (commonFromDeviceExt(pContext)->bHGSMI)
    583584                {
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