VirtualBox

Changeset 82086 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Nov 21, 2019 7:32:20 PM (5 years ago)
Author:
vboxsync
Message:

DevVGA: SUPSem -> DevHlpSUPSem. bugref:9218

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

Legend:

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

    r82083 r82086  
    520520    SSMFIELD_ENTRY(                 VMSVGAState, u32RegCaps),
    521521    SSMFIELD_ENTRY(                 VMSVGAState, u32IndexReg),
    522     SSMFIELD_ENTRY_IGNORE(          VMSVGAState, pSupDrvSession),
    523     SSMFIELD_ENTRY_IGNORE(          VMSVGAState, FIFORequestSem),
    524     SSMFIELD_ENTRY_IGNORE(          VMSVGAState, FIFOExtCmdSem),
     522    SSMFIELD_ENTRY_IGNORE(          VMSVGAState, hFIFORequestSem),
     523    SSMFIELD_ENTRY_IGNORE(          VMSVGAState, hFIFOExtCmdSem),
    525524    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGAState, pFIFOIOThread),
    526525    SSMFIELD_ENTRY_IGNORE(          VMSVGAState, uLastCursorUpdateCount),
     
    15001499 * @param   u32         Value to write
    15011500 */
    1502 static VBOXSTRICTRC vmsvgaWritePort(PVGASTATE pThis, uint32_t u32)
     1501static VBOXSTRICTRC vmsvgaWritePort(PPDMDEVINS pDevIns, PVGASTATE pThis, uint32_t u32)
    15031502{
    15041503#ifdef IN_RING3
     
    16931692
    16941693                /* Kick the FIFO thread to start processing commands again. */
    1695                 SUPSemEventSignal(pThis->svga.pSupDrvSession, pThis->svga.FIFORequestSem);
     1694                PDMDevHlpSUPSemEventSignal(pDevIns, pThis->svga.hFIFORequestSem);
    16961695#else
    16971696                rc = VINF_IOM_R3_IOPORT_WRITE;
     
    20062005
    20072006            case SVGA_VALUE_PORT:
    2008                 return vmsvgaWritePort(pThis, u32);
     2007                return vmsvgaWritePort(pDevIns, pThis, u32);
    20092008
    20102009            case SVGA_BIOS_PORT:
     
    24042403     * Wake up the FIFO thread as it might have work to do now.
    24052404     */
    2406     int rc = SUPSemEventSignal(pThis->svga.pSupDrvSession, pThis->svga.FIFORequestSem);
     2405    int rc = PDMDevHlpSUPSemEventSignal(pDevIns, pThis->svga.hFIFORequestSem);
    24072406    AssertLogRelRC(rc);
    24082407# endif
     
    29522951    pThis->svga.u8FIFOExtCommand  = VMSVGA_FIFO_EXTCMD_NONE;
    29532952    ASMMemoryFence(); /* paranoia^2 */
    2954     int rc = RTSemEventSignal(pThis->svga.FIFOExtCmdSem);
     2953    int rc = RTSemEventSignal(pThis->svga.hFIFOExtCmdSem);
    29552954    AssertLogRelRC(rc);
    29562955}
     
    29972996        {
    29982997            /* Wait. Take care in case the semaphore was already posted (same as below). */
    2999             rc = RTSemEventWait(pThis->svga.FIFOExtCmdSem, cMsWait);
     2998            rc = RTSemEventWait(pThis->svga.hFIFOExtCmdSem, cMsWait);
    30002999            if (   rc == VINF_SUCCESS
    30013000                && pThis->svga.u8FIFOExtCommand == uExtCmd)
    3002                 rc = RTSemEventWait(pThis->svga.FIFOExtCmdSem, cMsWait);
     3001                rc = RTSemEventWait(pThis->svga.hFIFOExtCmdSem, cMsWait);
    30033002            AssertLogRelMsg(pThis->svga.u8FIFOExtCommand != uExtCmd || RT_FAILURE_NP(rc),
    30043003                            ("%#x %Rrc\n", pThis->svga.u8FIFOExtCommand, rc));
     
    30273026        pThis->svga.u8FIFOExtCommand  = uExtCmd;
    30283027        ASMMemoryFence(); /* paranoia^2 */
    3029         rc = SUPSemEventSignal(pThis->svga.pSupDrvSession, pThis->svga.FIFORequestSem);
     3028        rc = PDMDevHlpSUPSemEventSignal(pDevIns, pThis->svga.hFIFORequestSem);
    30303029        AssertLogRelRC(rc);
    30313030
    30323031        /* Wait. Take care in case the semaphore was already posted (same as above). */
    3033         rc = RTSemEventWait(pThis->svga.FIFOExtCmdSem, cMsWait);
     3032        rc = RTSemEventWait(pThis->svga.hFIFOExtCmdSem, cMsWait);
    30343033        if (   rc == VINF_SUCCESS
    30353034            && pThis->svga.u8FIFOExtCommand == uExtCmd)
    3036             rc = RTSemEventWait(pThis->svga.FIFOExtCmdSem, cMsWait); /* it was already posted, retry the wait. */
     3035            rc = RTSemEventWait(pThis->svga.hFIFOExtCmdSem, cMsWait); /* it was already posted, retry the wait. */
    30373036        AssertLogRelMsg(pThis->svga.u8FIFOExtCommand != uExtCmd || RT_FAILURE_NP(rc),
    30383037                        ("%#x %Rrc\n", pThis->svga.u8FIFOExtCommand, rc));
     
    31093108                                     uint32_t offCurrentCmd, uint32_t offFifoMin, uint32_t offFifoMax,
    31103109                                     uint8_t *pbBounceBuf, uint32_t *pcbAlreadyRead,
    3111                                      PPDMTHREAD pThread, PVGASTATE pThis, PVMSVGAR3STATE pSVGAState)
     3110                                     PPDMTHREAD pThread, PVGASTATE pThis, PVMSVGAR3STATE pSVGAState, PPDMDEVINS pDevIns)
    31123111{
    31133112    Assert(pbBounceBuf);
     
    31963195                 cbPayloadReq, cbAfter + cbBefore, offCurrentCmd, offNextCmd, pFIFO[SVGA_FIFO_STOP], i));
    31973196
    3198             SUPSemEventWaitNoResume(pThis->svga.pSupDrvSession, pThis->svga.FIFORequestSem, i < 16 ? 1 : 2);
     3197            PDMDevHlpSUPSemEventWaitNoResume(pDevIns, pThis->svga.hFIFORequestSem, i < 16 ? 1 : 2);
    31993198
    32003199            offNextCmd = pFIFO[SVGA_FIFO_NEXT_CMD];
     
    33403339 * @param   pThis   The VGA state.
    33413340 */
    3342 void vmsvgaFIFOWatchdogTimer(PVGASTATE pThis)
     3341void vmsvgaFIFOWatchdogTimer(PPDMDEVINS pDevIns, PVGASTATE pThis)
    33433342{
    33443343    /* Caller already checked pThis->svga.fFIFOThreadSleeping, so we only have
     
    33493348        && pThis->svga.fFIFOThreadSleeping)
    33503349    {
    3351         int rc = SUPSemEventSignal(pThis->svga.pSupDrvSession, pThis->svga.FIFORequestSem);
     3350        int rc = PDMDevHlpSUPSemEventSignal(pDevIns, pThis->svga.hFIFORequestSem);
    33523351        AssertRC(rc);
    33533352        STAM_REL_COUNTER_INC(&pThis->svga.pSvgaR3State->StatFifoWatchdogWakeUps);
     
    33763375        while (pThread->enmState == PDMTHREADSTATE_RUNNING)
    33773376            if (pThis->svga.u8FIFOExtCommand == VMSVGA_FIFO_EXTCMD_NONE)
    3378                 SUPSemEventWaitNoResume(pThis->svga.pSupDrvSession, pThis->svga.FIFORequestSem, RT_MS_1MIN);
     3377                PDMDevHlpSUPSemEventWaitNoResume(pDevIns, pThis->svga.hFIFORequestSem, RT_MS_1MIN);
    33793378            else
    33803379                vmsvgaR3FifoHandleExtCmd(pThis);
     
    33873386     * suspend & resume scenario (see vmsvgaFIFOGetCmdPayload).
    33883387     */
    3389     SUPSemEventSignal(pThis->svga.pSupDrvSession, pThis->svga.FIFORequestSem);
     3388    PDMDevHlpSUPSemEventSignal(pDevIns, pThis->svga.hFIFORequestSem);
    33903389
    33913390    /*
     
    34523451            Assert(pThis->cMilliesRefreshInterval > 0);
    34533452            if (cMsSleep < pThis->cMilliesRefreshInterval)
    3454                 rc = SUPSemEventWaitNoResume(pThis->svga.pSupDrvSession, pThis->svga.FIFORequestSem, cMsSleep);
     3453                rc = PDMDevHlpSUPSemEventWaitNoResume(pDevIns, pThis->svga.hFIFORequestSem, cMsSleep);
    34553454            else
    34563455            {
     
    34653464                {
    34663465                    STAM_REL_PROFILE_START(&pSVGAState->StatFifoExtendedSleep, Acc);
    3467                     rc = SUPSemEventWaitNoResume(pThis->svga.pSupDrvSession, pThis->svga.FIFORequestSem, cMsExtendedSleep);
     3466                    rc = PDMDevHlpSUPSemEventWaitNoResume(pDevIns, pThis->svga.hFIFORequestSem, cMsExtendedSleep);
    34683467                    STAM_REL_PROFILE_STOP(&pSVGAState->StatFifoExtendedSleep, Acc);
    34693468                }
     
    35833582            if (1) { \
    35843583                (a_PtrVar) = (a_Type *)vmsvgaFIFOGetCmdPayload((a_cbPayloadReq), pFIFO, offCurrentCmd, offFifoMin, offFifoMax, \
    3585                                                                pbBounceBuf, &cbPayload, pThread, pThis, pSVGAState); \
     3584                                                               pbBounceBuf, &cbPayload, pThread, pThis, pSVGAState, pDevIns); \
    35863585                if (RT_UNLIKELY((uintptr_t)(a_PtrVar) < 2)) { if ((uintptr_t)(a_PtrVar) == 1) continue; break; } \
    35873586                RT_UNTRUSTED_NONVOLATILE_COPY_FENCE(); \
     
    51875186    PVGASTATE pThis = (PVGASTATE)pThread->pvUser;
    51885187    Log(("vmsvgaFIFOLoopWakeUp\n"));
    5189     return SUPSemEventSignal(pThis->svga.pSupDrvSession, pThis->svga.FIFORequestSem);
     5188    return PDMDevHlpSUPSemEventSignal(pDevIns, pThis->svga.hFIFORequestSem);
    51905189}
    51915190
     
    60726071        pThis->svga.pbVgaFrameBufferR3 = NULL;
    60736072    }
    6074     if (pThis->svga.FIFOExtCmdSem != NIL_RTSEMEVENT)
    6075     {
    6076         RTSemEventDestroy(pThis->svga.FIFOExtCmdSem);
    6077         pThis->svga.FIFOExtCmdSem = NIL_RTSEMEVENT;
    6078     }
    6079     if (pThis->svga.FIFORequestSem != NIL_SUPSEMEVENT)
    6080     {
    6081         SUPSemEventClose(pThis->svga.pSupDrvSession, pThis->svga.FIFORequestSem);
    6082         pThis->svga.FIFORequestSem = NIL_SUPSEMEVENT;
     6073    if (pThis->svga.hFIFOExtCmdSem != NIL_RTSEMEVENT)
     6074    {
     6075        RTSemEventDestroy(pThis->svga.hFIFOExtCmdSem);
     6076        pThis->svga.hFIFOExtCmdSem = NIL_RTSEMEVENT;
     6077    }
     6078    if (pThis->svga.hFIFORequestSem != NIL_SUPSEMEVENT)
     6079    {
     6080        PDMDevHlpSUPSemEventClose(pDevIns, pThis->svga.hFIFORequestSem);
     6081        pThis->svga.hFIFORequestSem = NIL_SUPSEMEVENT;
    60836082    }
    60846083
     
    61086107
    61096108    /* Create event semaphore. */
    6110     pThis->svga.pSupDrvSession = PDMDevHlpGetSupDrvSession(pDevIns);
    6111 
    6112     rc = SUPSemEventCreate(pThis->svga.pSupDrvSession, &pThis->svga.FIFORequestSem);
    6113     if (RT_FAILURE(rc))
    6114     {
    6115         Log(("%s: Failed to create event semaphore for FIFO handling.\n", __FUNCTION__));
    6116         return rc;
    6117     }
     6109    rc = PDMDevHlpSUPSemEventCreate(pDevIns, &pThis->svga.hFIFORequestSem);
     6110    AssertRCReturn(rc, rc);
    61186111
    61196112    /* Create event semaphore. */
    6120     rc = RTSemEventCreate(&pThis->svga.FIFOExtCmdSem);
    6121     if (RT_FAILURE(rc))
    6122     {
    6123         Log(("%s: Failed to create event semaphore for external fifo cmd handling.\n", __FUNCTION__));
    6124         return rc;
    6125     }
     6113    rc = RTSemEventCreate(&pThis->svga.hFIFOExtCmdSem);
     6114    AssertRCReturn(rc, rc);
    61266115
    61276116    pThis->svga.pSvgaR3State = (PVMSVGAR3STATE)RTMemAlloc(sizeof(VMSVGAR3STATE));
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.h

    r82079 r82086  
    223223    /** Port io index register. */
    224224    uint32_t                    u32IndexReg;
    225     /** The support driver session handle for use with FIFORequestSem. */
    226     R3R0PTRTYPE(PSUPDRVSESSION) pSupDrvSession;
    227225    /** FIFO request semaphore. */
    228     SUPSEMEVENT                 FIFORequestSem;
     226    SUPSEMEVENT                 hFIFORequestSem;
    229227    /** FIFO external command semaphore. */
    230     R3PTRTYPE(RTSEMEVENT)       FIFOExtCmdSem;
     228    R3PTRTYPE(RTSEMEVENT)       hFIFOExtCmdSem;
    231229    /** FIFO IO Thread. */
    232230    R3PTRTYPE(PPDMTHREAD)       pFIFOIOThread;
     
    379377DECLCALLBACK(void) vmsvgaR3PowerOn(PPDMDEVINS pDevIns);
    380378DECLCALLBACK(void) vmsvgaR3PowerOff(PPDMDEVINS pDevIns);
    381 void vmsvgaFIFOWatchdogTimer(PVGASTATE pThis);
     379void vmsvgaFIFOWatchdogTimer(PPDMDEVINS pDevIns, PVGASTATE pThis);
    382380
    383381#ifdef IN_RING3
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r82084 r82086  
    49774977#ifdef VBOX_WITH_VMSVGA
    49784978    if (pThis->svga.fFIFOThreadSleeping)
    4979         SUPSemEventSignal(pThis->svga.pSupDrvSession, pThis->svga.FIFORequestSem);
     4979        PDMDevHlpSUPSemEventSignal(pDevIns, pThis->svga.hFIFORequestSem);
    49804980#endif
    49814981
     
    55855585     */
    55865586    if (pThis->svga.fFIFOThreadSleeping && pThis->svga.fEnabled && pThis->svga.fConfigured)
    5587         vmsvgaFIFOWatchdogTimer(pThis);
     5587        vmsvgaFIFOWatchdogTimer(pDevIns, pThis);
    55885588#endif
    55895589}
    55905590
    55915591#ifdef VBOX_WITH_VMSVGA
     5592
    55925593int vgaR3RegisterVRAMHandler(PVGASTATE pVGAState, uint64_t cbFrameBuffer)
    55935594{
     
    56135614    return rc;
    56145615}
    5615 #endif
     5616
     5617#endif /* PPDMDEVINS pDevIns */
    56165618
    56175619/* -=-=-=-=-=- Ring 3: PCI Device -=-=-=-=-=- */
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