VirtualBox

Changeset 60369 in vbox


Ignore:
Timestamp:
Apr 7, 2016 12:14:52 PM (9 years ago)
Author:
vboxsync
Message:

DevVGA: handle VBVACAPS_USE_VBVA_ONLY, make sure that VBVA pause is applied correctly when loading saved state.

Location:
trunk/src/VBox/Devices/Graphics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r60175 r60369  
    11481148            pThis->pDrv->pfnLFBModeChange(pThis->pDrv, (val & VBE_DISPI_ENABLED) != 0);
    11491149#ifdef VBOX_WITH_HGSMI
    1150             VBVAPause(pThis, (val & VBE_DISPI_ENABLED) == 0);
     1150            VBVAOnVBEChanged(pThis);
    11511151#endif /* VBOX_WITH_HGSMI */
    11521152
     
    52345234    AssertRC(rc);
    52355235
    5236     /* This method only works if the VGA device is in a VBE mode. */
    5237     if ((pThis->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED) == 0)
     5236    /* This method only works if the VGA device is in a VBE mode or not paused VBVA mode.
     5237     * VGA modes are reported to the caller by returning VERR_INVALID_STATE.
     5238     *
     5239     * If VBE_DISPI_ENABLED is set, then it is a VBE or VBE compatible VBVA mode. Both of them can be handled.
     5240     *
     5241     * If VBE_DISPI_ENABLED is clear, then it is either a VGA mode or a VBVA mode set by guest additions
     5242     * which have VBVACAPS_USE_VBVA_ONLY capability.
     5243     * When VBE_DISPI_ENABLED is being cleared and VBVACAPS_USE_VBVA_ONLY is not set (i.e. guest wants a VGA mode),
     5244     * then VBVAOnVBEChanged makes sure that VBVA is paused.
     5245     * That is a not paused VBVA means that the video mode can be handled even if VBE_DISPI_ENABLED is clear.
     5246     */
     5247    if (   (pThis->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED) == 0
     5248        && VBVAIsPaused(pThis))
    52385249    {
    52395250        PDMCritSectLeave(&pThis->CritSect);
     
    56395650#ifdef VBOX_WITH_HGSMI
    56405651    PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);
    5641     VBVAPause(pThis, (pThis->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED) == 0);
    56425652    rc = vboxVBVALoadStateDone(pDevIns, pSSM);
    56435653    AssertRCReturn(rc, rc);
     
    56465656    AssertRCReturn(rc, rc);
    56475657# endif
     5658    /* Now update the current VBVA state which depends on VBE registers. vboxVBVALoadStateDone cleared the state. */
     5659    VBVAOnVBEChanged(pThis);
    56485660#endif
    56495661#ifdef VBOX_WITH_VMSVGA
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r57518 r60369  
    682682void     VBVAReset (PVGASTATE pVGAState);
    683683void     VBVAPause (PVGASTATE pVGAState, bool fPause);
    684 
     684void     VBVAOnVBEChanged(PVGASTATE pVGAState);
     685
     686bool VBVAIsPaused(PVGASTATE pVGAState);
    685687bool VBVAIsEnabled(PVGASTATE pVGAState);
    686688
  • trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp

    r59307 r60369  
    27652765}
    27662766
     2767bool VBVAIsPaused(PVGASTATE pVGAState)
     2768{
     2769    if (pVGAState && pVGAState->pHGSMI)
     2770    {
     2771        const VBVACONTEXT *pCtx = (VBVACONTEXT *)HGSMIContext(pVGAState->pHGSMI);
     2772        if (pCtx && pCtx->cViews)
     2773        {
     2774            /* If VBVA is enabled at all. */
     2775            const VBVAVIEW *pView = &pCtx->aViews[0];
     2776            if (pView->vbva.guest.pVBVA)
     2777                return pCtx->fPaused;
     2778        }
     2779    }
     2780    /* VBVA is disabled. */
     2781    return true;
     2782}
     2783
     2784void VBVAOnVBEChanged(PVGASTATE pVGAState)
     2785{
     2786    /* The guest does not depend on host handling the VBE registers. */
     2787    if (pVGAState->fGuestCaps & VBVACAPS_USE_VBVA_ONLY)
     2788    {
     2789        return;
     2790    }
     2791
     2792    VBVAPause(pVGAState, (pVGAState->vbe_regs[VBE_DISPI_INDEX_ENABLE] & VBE_DISPI_ENABLED) == 0);
     2793}
     2794
    27672795void VBVAReset (PVGASTATE pVGAState)
    27682796{
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