VirtualBox

Changeset 60465 in vbox for trunk/src/VBox/Devices/Graphics


Ignore:
Timestamp:
Apr 12, 2016 6:42:22 PM (9 years ago)
Author:
vboxsync
Message:

DevVGA: set IRQs only if the VM is running (bugref:8320)

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

Legend:

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

    r60449 r60465  
    69856985}
    69866986
     6987static DECLCALLBACK(void) vgaR3PowerOn(PPDMDEVINS pDevIns)
     6988{
     6989    PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);
     6990    vmsvgaR3PowerOn(pDevIns);
     6991    VBVAOnResume(pThis);
     6992}
     6993
     6994static DECLCALLBACK(void) vgaR3Resume(PPDMDEVINS pDevIns)
     6995{
     6996    PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);
     6997    VBVAOnResume(pThis);
     6998}
    69876999
    69887000/**
     
    70197031    /* pfnPowerOn */
    70207032#ifdef VBOX_WITH_VMSVGA
    7021     vmsvgaR3PowerOn,
     7033    vgaR3PowerOn,
    70227034#else
    70237035    NULL,
     
    70287040    NULL,
    70297041    /* pfnResume */
    7030     NULL,
     7042    vgaR3Resume,
    70317043    /* pfnAttach */
    70327044    vgaAttach,
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r60369 r60465  
    683683void     VBVAPause (PVGASTATE pVGAState, bool fPause);
    684684void     VBVAOnVBEChanged(PVGASTATE pVGAState);
     685void     VBVAOnResume(PVGASTATE pThis);
    685686
    686687bool VBVAIsPaused(PVGASTATE pVGAState);
  • trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp

    r60369 r60465  
    20862086    PDMCritSectLeave(&pVGAState->CritSect);
    20872087
    2088     PDMDevHlpPCISetIrq(pDevIns, 0, PDM_IRQ_LEVEL_HIGH);
     2088    /* Set IRQ only for a running VM.
     2089     * If HGSMIHOSTFLAGS_IRQ is set, then vgaR3Resume/vgaR3PowerOn will
     2090     * set the postponed IRQ.
     2091     */
     2092    VMSTATE enmVMState = PDMDevHlpVMState(pDevIns);
     2093    if (   enmVMState == VMSTATE_RUNNING
     2094        || enmVMState == VMSTATE_RUNNING_LS)
     2095    {
     2096        PDMDevHlpPCISetIrq(pDevIns, 0, PDM_IRQ_LEVEL_HIGH);
     2097    }
    20892098}
    20902099
     
    21032112     * 3. IRQ is set */
    21042113    VMR3ReqCallNoWait(PDMDevHlpGetVM(pVGAState->pDevInsR3), VMCPUID_ANY, (PFNRT)vbvaRaiseIrqEMT, 2, pVGAState, fFlags);
     2114}
     2115
     2116void VBVAOnResume(PVGASTATE pThis)
     2117{
     2118    PPDMDEVINS pDevIns = pThis->pDevInsR3;
     2119
     2120    PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     2121    bool fIrq = RT_BOOL(HGSMIGetHostGuestFlags(pThis->pHGSMI) & HGSMIHOSTFLAGS_IRQ);
     2122    PDMCritSectLeave(&pThis->CritSect);
     2123
     2124    if (fIrq)
     2125        PDMDevHlpPCISetIrq(pDevIns, 0, PDM_IRQ_LEVEL_HIGH);
    21052126}
    21062127
  • trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp

    r56972 r60465  
    474474    AssertPtrReturnVoid(pIns->pHGFlags);
    475475    ASMAtomicOrU32(&pIns->pHGFlags->u32HostFlags, flags);
     476}
     477
     478uint32_t HGSMIGetHostGuestFlags(HGSMIINSTANCE *pIns)
     479{
     480    return pIns->pHGFlags? ASMAtomicReadU32(&pIns->pHGFlags->u32HostFlags) : 0;
    476481}
    477482
  • trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.h

    r55560 r60465  
    9292
    9393void HGSMISetHostGuestFlags(PHGSMIINSTANCE pIns, uint32_t flags);
     94uint32_t HGSMIGetHostGuestFlags(HGSMIINSTANCE *pIns);
    9495
    9596void HGSMIClearHostGuestFlags(PHGSMIINSTANCE pIns, uint32_t flags);
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