- Timestamp:
- Dec 18, 2020 6:27:04 PM (4 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r86197 r87105 2069 2069 2070 2070 # if 0 /* unused? */ 2071 int vgaR3UpdateDisplay( VGAState *s, unsigned xStart, unsigned yStart, unsigned cx, unsigned cy)2071 int vgaR3UpdateDisplay(PVGASTATE pThis, PVGASTATER3 pThisCC, unsigned xStart, unsigned yStart, unsigned cx, unsigned cy, PDMIDISPLAYCONNECTOR *pDrv) 2072 2072 { 2073 2073 uint32_t v; 2074 2074 vga_draw_line_func *vga_draw_line; 2075 2075 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); 2079 2079 return VINF_SUCCESS; 2080 2080 } 2081 2081 /** @todo might crash if a blit follows a resolution change very quickly (seen this many times!) */ 2082 2082 2083 if ( s->svga.uWidth == VMSVGA_VAL_UNINITIALIZED2084 || s->svga.uHeight == VMSVGA_VAL_UNINITIALIZED2085 || 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) 2086 2086 { 2087 2087 /* Intermediate state; skip redraws. */ … … 2091 2091 2092 2092 uint32_t cBits; 2093 switch ( s->svga.uBpp) {2093 switch (pThis->svga.uBpp) { 2094 2094 default: 2095 2095 case 0: … … 2114 2114 break; 2115 2115 } 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; 2123 2123 2124 2124 for (unsigned y = yStart; y < yStart + cy; y++) 2125 2125 { 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); 2132 2132 2133 2133 return VINF_SUCCESS; … … 6602 6602 AssertLogRelRCReturn(rc, PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, 6603 6603 N_("Failed to allocate %u bytes of VRAM"), pThis->vram_size)); 6604 # ifndef VGA_WITH_PARTIAL_RING0_MAPPING6605 pThis->vram_ptrR0 = (RTR0PTR)pThisCC->pbVRam;6606 # endif6607 6604 6608 6605 /* -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r86197 r87105 193 193 #ifndef VBOX 194 194 #define VGA_STATE_COMMON \ 195 uint8_t *vram_ptr; \196 195 unsigned long vram_offset; \ 197 196 unsigned int vram_size; \
Note:
See TracChangeset
for help on using the changeset viewer.