VirtualBox

Changeset 87105 in vbox for trunk/src


Ignore:
Timestamp:
Dec 18, 2020 6:27:04 PM (4 years ago)
Author:
vboxsync
Message:

DevVGA: Finish the elimination of vram_ptr. bugref:9218

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

Legend:

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

    r86197 r87105  
    20692069
    20702070#  if 0 /* unused? */
    2071 int vgaR3UpdateDisplay(VGAState *s, unsigned xStart, unsigned yStart, unsigned cx, unsigned cy)
     2071int vgaR3UpdateDisplay(PVGASTATE pThis, PVGASTATER3 pThisCC, unsigned xStart, unsigned yStart, unsigned cx, unsigned cy, PDMIDISPLAYCONNECTOR *pDrv)
    20722072{
    20732073    uint32_t v;
    20742074    vga_draw_line_func *vga_draw_line;
    20752075
    2076     if (!s->fRenderVRAM)
    2077     {
    2078         s->pDrv->pfnUpdateRect(s->pDrv, xStart, yStart, cx, cy);
     2076    if (!pThis->fRenderVRAM)
     2077    {
     2078        pDrv->pfnUpdateRect(pDrv, xStart, yStart, cx, cy);
    20792079        return VINF_SUCCESS;
    20802080    }
    20812081    /** @todo might crash if a blit follows a resolution change very quickly (seen this many times!) */
    20822082
    2083     if (    s->svga.uWidth  == VMSVGA_VAL_UNINITIALIZED
    2084         ||  s->svga.uHeight == VMSVGA_VAL_UNINITIALIZED
    2085         ||  s->svga.uBpp    == VMSVGA_VAL_UNINITIALIZED)
     2083    if (    pThis->svga.uWidth  == VMSVGA_VAL_UNINITIALIZED
     2084        ||  pThis->svga.uHeight == VMSVGA_VAL_UNINITIALIZED
     2085        ||  pThis->svga.uBpp    == VMSVGA_VAL_UNINITIALIZED)
    20862086    {
    20872087        /* Intermediate state; skip redraws. */
     
    20912091
    20922092    uint32_t cBits;
    2093     switch (s->svga.uBpp) {
     2093    switch (pThis->svga.uBpp) {
    20942094    default:
    20952095    case 0:
     
    21142114        break;
    21152115    }
    2116     vga_draw_line = vga_draw_line_table[v * 4 + vgaR3GetDepthIndex(s->pDrv->cBits)];
    2117 
    2118     uint32_t offSrc = (xStart * cBits) / 8 + s->svga.cbScanline * yStart;
    2119     uint32_t offDst = (xStart * RT_ALIGN(s->pDrv->cBits, 8)) / 8 + s->pDrv->cbScanline * yStart;
    2120 
    2121     uint8_t       *pbDst = s->pDrv->pbData       + offDst;
    2122     uint8_t const *pbSrc = s->CTX_SUFF(vram_ptr) + offSrc;
     2116    vga_draw_line = vga_draw_line_table[v * 4 + vgaR3GetDepthIndex(pDrv->cBits)];
     2117
     2118    uint32_t offSrc = (xStart * cBits) / 8 + pThis->svga.cbScanline * yStart;
     2119    uint32_t offDst = (xStart * RT_ALIGN(pDrv->cBits, 8)) / 8 + pDrv->cbScanline * yStart;
     2120
     2121    uint8_t       *pbDst = pDrv->pbData     + offDst;
     2122    uint8_t const *pbSrc = pThisCC->pbVRam + offSrc;
    21232123
    21242124    for (unsigned y = yStart; y < yStart + cy; y++)
    21252125    {
    2126         vga_draw_line(s, pbDst, pbSrc, cx);
    2127 
    2128         pbDst += s->pDrv->cbScanline;
    2129         pbSrc += s->svga.cbScanline;
    2130     }
    2131     s->pDrv->pfnUpdateRect(s->pDrv, xStart, yStart, cx, cy);
     2126        vga_draw_line(pThis, pThisCC, pbDst, pbSrc, cx);
     2127
     2128        pbDst += pDrv->cbScanline;
     2129        pbSrc += pThis->svga.cbScanline;
     2130    }
     2131    pDrv->pfnUpdateRect(pDrv, xStart, yStart, cx, cy);
    21322132
    21332133    return VINF_SUCCESS;
     
    66026602    AssertLogRelRCReturn(rc, PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,
    66036603                                                 N_("Failed to allocate %u bytes of VRAM"), pThis->vram_size));
    6604 # ifndef VGA_WITH_PARTIAL_RING0_MAPPING
    6605     pThis->vram_ptrR0 = (RTR0PTR)pThisCC->pbVRam;
    6606 # endif
    66076604
    66086605    /*
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r86197 r87105  
    193193#ifndef VBOX
    194194#define VGA_STATE_COMMON                                                \
    195     uint8_t *vram_ptr;                                                  \
    196195    unsigned long vram_offset;                                          \
    197196    unsigned int vram_size;                                             \
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