VirtualBox

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


Ignore:
Timestamp:
Oct 21, 2021 9:09:51 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147733
Message:

VMM,Devices: Eliminate direct calls to PGMHandlerPhysical* APIs and introduce callbacks in the device helper callback table, bugref:10074

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

Legend:

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

    r91507 r91928  
    592592        for (uint32_t i = 0; i < pGbo->cDescriptors; ++i)
    593593        {
    594             rc = PGMHandlerPhysicalRegister(PDMDevHlpGetVM(pSvgaR3State->pDevIns),
    595                                             pGbo->paDescriptors[i].GCPhys, pGbo->paDescriptors[i].GCPhys + pGbo->paDescriptors[i].cPages * PAGE_SIZE - 1,
    596                                             pSvgaR3State->hGboAccessHandlerType, pSvgaR3State->pDevIns, NIL_RTR0PTR, NIL_RTRCPTR, "VMSVGA GBO");
     594            rc = PDMDevHlpPGMHandlerPhysicalRegister(pSvgaR3State->pDevIns,
     595                                                     pGbo->paDescriptors[i].GCPhys, pGbo->paDescriptors[i].GCPhys + pGbo->paDescriptors[i].cPages * PAGE_SIZE - 1,
     596                                                     pSvgaR3State->hGboAccessHandlerType, pSvgaR3State->pDevIns, NIL_RTR0PTR, NIL_RTRCPTR, "VMSVGA GBO");
    597597            AssertRC(rc);
    598598        }
     
    611611            for (uint32_t i = 0; i < pGbo->cDescriptors; ++i)
    612612            {
    613                 int rc = PGMHandlerPhysicalDeregister(PDMDevHlpGetVM(pSvgaR3State->pDevIns), pGbo->paDescriptors[i].GCPhys);
     613                int rc = PDMDevHlpPGMHandlerPhysicalDeregister(pSvgaR3State->pDevIns, pGbo->paDescriptors[i].GCPhys);
    614614                AssertRC(rc);
    615615            }
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp

    r91920 r91928  
    28612861    for (uint32_t i = 0; i < pGMR->numDescriptors; i++)
    28622862    {
    2863         rc = PGMHandlerPhysicalRegister(PDMDevHlpGetVM(pDevIns),
    2864                                         pGMR->paDesc[i].GCPhys, pGMR->paDesc[i].GCPhys + pGMR->paDesc[i].numPages * PAGE_SIZE - 1,
    2865                                         pThis->svga.hGmrAccessHandlerType, pThis, NIL_RTR0PTR, NIL_RTRCPTR, "VMSVGA GMR");
     2863        rc = PDMDevHlpPGMHandlerPhysicalRegister(pDevIns,
     2864                                                 pGMR->paDesc[i].GCPhys, pGMR->paDesc[i].GCPhys + pGMR->paDesc[i].numPages * PAGE_SIZE - 1,
     2865                                                 pThis->svga.hGmrAccessHandlerType, pThis, NIL_RTR0PTR, NIL_RTRCPTR, "VMSVGA GMR");
    28662866        AssertRC(rc);
    28672867    }
     
    28782878    for (uint32_t i = 0; i < pGMR->numDescriptors; i++)
    28792879    {
    2880         int rc = PGMHandlerPhysicalDeregister(PDMDevHlpGetVM(pDevIns), pGMR->paDesc[i].GCPhys);
     2880        int rc = PDMDevHlpPGMHandlerPhysicalDeregister(pDevIns, pGMR->paDesc[i].GCPhys);
    28812881        AssertRC(rc);
    28822882    }
     
    28972897            for (uint32_t j = 0; j < pGMR->numDescriptors; j++)
    28982898            {
    2899                 int rc = PGMHandlerPhysicalReset(PDMDevHlpGetVM(pDevIns), pGMR->paDesc[j].GCPhys);
     2899                int rc = PDMDevHlpPGMHandlerPhysicalReset(pDevIns, pGMR->paDesc[j].GCPhys);
    29002900                AssertRC(rc);
    29012901            }
     
    45804580            {
    45814581# ifdef VMSVGA_USE_FIFO_ACCESS_HANDLER
    4582                 int rc2 = PGMHandlerPhysicalReset(PDMDevHlpGetVM(pDevIns), pThis->svga.GCPhysFIFO);
     4582                int rc2 = PDMDevHlpPGMHandlerPhysicalReset(pDevIns, pThis->svga.GCPhysFIFO);
    45834583                AssertRC(rc2); /* No break. Racing EMTs unmapping and remapping the region. */
    45844584# endif
     
    51965196        if (RT_SUCCESS(rc))
    51975197        {
    5198             rc = PGMHandlerPhysicalRegister(PDMDevHlpGetVM(pDevIns), GCPhysAddress,
     5198            rc = PDMDevHlpPGMHandlerPhysicalRegister(pDevIns, GCPhysAddress,
    51995199#  ifdef DEBUG_FIFO_ACCESS
    5200                                             GCPhysAddress + (pThis->svga.cbFIFO - 1),
     5200                                                     GCPhysAddress + (pThis->svga.cbFIFO - 1),
    52015201#  else
    5202                                             GCPhysAddress + PAGE_SIZE - 1,
     5202                                                     GCPhysAddress + PAGE_SIZE - 1,
    52035203#  endif
    5204                                             pThis->svga.hFifoAccessHandlerType, pThis, NIL_RTR0PTR, NIL_RTRCPTR,
    5205                                             "VMSVGA FIFO");
     5204                                                     pThis->svga.hFifoAccessHandlerType, pThis, NIL_RTR0PTR, NIL_RTRCPTR,
     5205                                                     "VMSVGA FIFO");
    52065206            AssertRC(rc);
    52075207        }
     
    52185218        Assert(pThis->svga.GCPhysFIFO);
    52195219# if defined(VMSVGA_USE_FIFO_ACCESS_HANDLER) || defined(DEBUG_FIFO_ACCESS)
    5220         rc = PGMHandlerPhysicalDeregister(PDMDevHlpGetVM(pDevIns), pThis->svga.GCPhysFIFO);
     5220        rc = PDMDevHlpPGMHandlerPhysicalDeregister(pDevIns, pThis->svga.GCPhysFIFO);
    52215221        AssertRC(rc);
    52225222# else
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r90447 r91928  
    36263626static VBOXSTRICTRC vgaLFBAccess(PVMCC pVM, PPDMDEVINS pDevIns, PVGASTATE pThis, RTGCPHYS GCPhys, RTGCPTR GCPtr)
    36273627{
     3628    RT_NOREF(pVM);
     3629
    36283630    VBOXSTRICTRC rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VINF_EM_RAW_EMULATE_INSTR);
    36293631    if (rc == VINF_SUCCESS)
     
    36403642         * ASSUME: the guest always maps video memory RW.
    36413643         */
    3642         rc = PGMHandlerPhysicalPageTempOff(pVM, pThis->GCPhysVRAM, GCPhys);
     3644        rc = PDMDevHlpPGMHandlerPhysicalPageTempOff(pDevIns, pThis->GCPhysVRAM, GCPhys);
    36433645        if (RT_SUCCESS(rc))
    36443646        {
     
    47854787    if (pThis->fHasDirtyBits && pThis->GCPhysVRAM && pThis->GCPhysVRAM != NIL_RTGCPHYS)
    47864788    {
    4787         PGMHandlerPhysicalReset(PDMDevHlpGetVM(pDevIns), pThis->GCPhysVRAM);
     4789        PDMDevHlpPGMHandlerPhysicalReset(pDevIns, pThis->GCPhysVRAM);
    47884790        pThis->fHasDirtyBits = false;
    47894791    }
     
    48144816        /* The dirty bits array has been just cleared, reset handlers as well. */
    48154817        if (pThis->GCPhysVRAM && pThis->GCPhysVRAM != NIL_RTGCPHYS)
    4816             PGMHandlerPhysicalReset(PDMDevHlpGetVM(pDevIns), pThis->GCPhysVRAM);
     4818            PDMDevHlpPGMHandlerPhysicalReset(pDevIns, pThis->GCPhysVRAM);
    48174819    }
    48184820    if (pThis->fRemappedVGA)
     
    54995501{
    55005502    Assert(pThis->GCPhysVRAM);
    5501     int rc = PGMHandlerPhysicalRegister(PDMDevHlpGetVM(pDevIns),
    5502                                         pThis->GCPhysVRAM, pThis->GCPhysVRAM + (cbFrameBuffer - 1),
    5503                                         pThis->hLfbAccessHandlerType, pDevIns, pDevIns->pDevInsR0RemoveMe,
    5504                                         pDevIns->pDevInsForRC, "VGA LFB");
     5503    int rc = PDMDevHlpPGMHandlerPhysicalRegister(pDevIns,
     5504                                                 pThis->GCPhysVRAM, pThis->GCPhysVRAM + (cbFrameBuffer - 1),
     5505                                                 pThis->hLfbAccessHandlerType, pDevIns, pDevIns->pDevInsR0RemoveMe,
     5506                                                 pDevIns->pDevInsForRC, "VGA LFB");
    55055507
    55065508    AssertRC(rc);
     
    55155517{
    55165518    Assert(pThis->GCPhysVRAM);
    5517     int rc = PGMHandlerPhysicalDeregister(PDMDevHlpGetVM(pDevIns), pThis->GCPhysVRAM);
     5519    int rc = PDMDevHlpPGMHandlerPhysicalDeregister(pDevIns, pThis->GCPhysVRAM);
    55185520    AssertRC(rc);
    55195521    return rc;
     
    55695571# endif
    55705572            {
    5571                 rc = PGMHandlerPhysicalRegister(PDMDevHlpGetVM(pDevIns), GCPhysAddress, GCPhysAddress + (pThis->vram_size - 1),
    5572                                                 pThis->hLfbAccessHandlerType, pDevIns, pDevIns->pDevInsR0RemoveMe,
    5573                                                 pDevIns->pDevInsForRC, "VGA LFB");
     5573                rc = PDMDevHlpPGMHandlerPhysicalRegister(pDevIns, GCPhysAddress, GCPhysAddress + (pThis->vram_size - 1),
     5574                                                         pThis->hLfbAccessHandlerType, pDevIns, pDevIns->pDevInsR0RemoveMe,
     5575                                                         pDevIns->pDevInsForRC, "VGA LFB");
    55745576                AssertLogRelRC(rc);
    55755577            }
     
    55965598# endif
    55975599        {
    5598             rc = PGMHandlerPhysicalDeregister(PDMDevHlpGetVM(pDevIns), pThis->GCPhysVRAM);
     5600            rc = PDMDevHlpPGMHandlerPhysicalDeregister(pDevIns, pThis->GCPhysVRAM);
    55995601            AssertRC(rc);
    56005602        }
     
    60536055        &&  pThis->GCPhysVRAM != NIL_RTGCPHYS)
    60546056    {
    6055         int rc = PGMHandlerPhysicalReset(PDMDevHlpGetVM(pDevIns), pThis->GCPhysVRAM);
     6057        int rc = PDMDevHlpPGMHandlerPhysicalReset(pDevIns, pThis->GCPhysVRAM);
    60566058        AssertRC(rc);
    60576059    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette