Changeset 55795 in vbox
- Timestamp:
- May 10, 2015 5:43:38 PM (9 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 3 edited
-
DevVGA-SVGA.h (modified) (1 diff)
-
DevVGA.cpp (modified) (11 diffs)
-
DevVGA.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.h
r53201 r55795 27 27 /** Maximum nr of GMR ids. */ 28 28 #define VMSVGA_MAX_GMR_IDS 0x100 29 /** Size of the region to backup when switching into svga mode. */30 #define VMSVGA_FRAMEBUFFER_BACKUP_SIZE (32*1024)31 29 32 30 #define VMSVGA_VAL_UNINITIALIZED (unsigned)-1 -
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r55767 r55795 103 103 } while (0) 104 104 #endif 105 106 /** @def VBOX_WITH_VMSVGA_BACKUP_VGA_FB 107 * Enables correct VGA MMIO read/write handling when VMSVGA is enabled. It 108 * is SLOW and probably not entirely right, but it helps with getting 3dmark 109 * output and other stuff. */ 110 #define VBOX_WITH_VMSVGA_BACKUP_VGA_FB 1 105 111 106 112 … … 1193 1199 #endif 1194 1200 1201 #if !defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */ 1202 /* Ugly hack to get result from 2dmark and other vmsvga examples. */ 1203 if (pThis->svga.fEnabled) 1204 return VINF_IOM_R3_MMIO_READ; 1205 #endif 1206 1195 1207 addr &= 0x1ffff; 1196 1208 switch(memory_map_mode) { … … 1232 1244 # endif /* IN_RC */ 1233 1245 VERIFY_VRAM_READ_OFF_RETURN(pThis, addr, *prc); 1234 ret = pThis->CTX_SUFF(vram_ptr)[addr]; 1246 #if defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */ 1247 if (pThis->svga.fEnabled && addr < _32K) 1248 ret = ((uint8_t *)pThis->svga.pFrameBufferBackup)[addr]; 1249 else 1250 #endif 1251 ret = pThis->CTX_SUFF(vram_ptr)[addr]; 1235 1252 } else if (!(pThis->sr[4] & 0x04)) { /* Host access is controlled by SR4, not GR5! */ 1236 1253 /* odd/even mode (aka text mode mapping) */ … … 1239 1256 RTGCPHYS off = ((addr & ~1) << 2) | plane; 1240 1257 VERIFY_VRAM_READ_OFF_RETURN(pThis, off, *prc); 1241 ret = pThis->CTX_SUFF(vram_ptr)[off]; 1258 #if defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */ 1259 if (pThis->svga.fEnabled && off < _32K) 1260 ret = ((uint8_t *)pThis->svga.pFrameBufferBackup)[off]; 1261 else 1262 #endif 1263 ret = pThis->CTX_SUFF(vram_ptr)[off]; 1242 1264 } else { 1243 1265 /* standard VGA latched access */ 1244 VERIFY_VRAM_READ_OFF_RETURN(pThis, addr, *prc); 1245 pThis->latch = ((uint32_t *)pThis->CTX_SUFF(vram_ptr))[addr]; 1266 VERIFY_VRAM_READ_OFF_RETURN(pThis, addr, *prc); /** @todo wrong check! Missing addr*4. */ 1267 #if defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */ 1268 if (pThis->svga.fEnabled && addr * 4 + 3 < _32K) 1269 pThis->latch = ((uint32_t *)pThis->svga.pFrameBufferBackup)[addr]; 1270 else 1271 #endif 1272 pThis->latch = ((uint32_t *)pThis->CTX_SUFF(vram_ptr))[addr]; 1246 1273 1247 1274 if (!(pThis->gr[5] & 0x08)) { … … 1272 1299 #ifndef IN_RC 1273 1300 RTGCPHYS GCPhys = addr; /* save original address */ 1301 #endif 1302 1303 #if !defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */ 1304 /* Ugly hack to get result from 2dmark and other vmsvga examples. */ 1305 if (pThis->svga.fEnabled) 1306 return VINF_IOM_R3_MMIO_WRITE; 1274 1307 #endif 1275 1308 … … 1314 1347 1315 1348 VERIFY_VRAM_WRITE_OFF_RETURN(pThis, addr); 1316 pThis->CTX_SUFF(vram_ptr)[addr] = val; 1349 #if defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */ 1350 if (pThis->svga.fEnabled && addr < _32K) 1351 ((uint8_t *)pThis->svga.pFrameBufferBackup)[addr] = val; 1352 else 1353 #endif 1354 pThis->CTX_SUFF(vram_ptr)[addr] = val; 1317 1355 Log3(("vga: chain4: [0x%x]\n", addr)); 1318 1356 pThis->plane_updated |= mask; /* only used to detect font change */ … … 1331 1369 addr = ((addr & ~1) << 2) | plane; 1332 1370 VERIFY_VRAM_WRITE_OFF_RETURN(pThis, addr); 1333 pThis->CTX_SUFF(vram_ptr)[addr] = val; 1371 #if defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */ 1372 if (pThis->svga.fEnabled && addr < _32K) 1373 ((uint8_t *)pThis->svga.pFrameBufferBackup)[addr] = val; 1374 else 1375 #endif 1376 pThis->CTX_SUFF(vram_ptr)[addr] = val; 1334 1377 Log3(("vga: odd/even: [0x%x]\n", addr)); 1335 1378 pThis->plane_updated |= mask; /* only used to detect font change */ … … 1442 1485 pThis->plane_updated |= mask; /* only used to detect font change */ 1443 1486 write_mask = mask16[mask]; 1444 ((uint32_t *)pThis->CTX_SUFF(vram_ptr))[addr] = 1445 (((uint32_t *)pThis->CTX_SUFF(vram_ptr))[addr] & ~write_mask) | 1487 #if defined(IN_RING3) && defined(VBOX_WITH_VMSVGA) && defined(VBOX_WITH_VMSVGA_BACKUP_VGA_FB) /** @todo figure out the right way */ 1488 if (pThis->svga.fEnabled && addr * 4 + 3U < _32K) 1489 ((uint32_t *)pThis->svga.pFrameBufferBackup)[addr] = 1490 (((uint32_t *)pThis->svga.pFrameBufferBackup)[addr] & ~write_mask) | (val & write_mask); 1491 else 1492 #endif 1493 ((uint32_t *)pThis->CTX_SUFF(vram_ptr))[addr] = 1494 (((uint32_t *)pThis->CTX_SUFF(vram_ptr))[addr] & ~write_mask) | 1446 1495 (val & write_mask); 1447 1496 Log3(("vga: latch: [0x%x] mask=0x%08x val=0x%08x\n", … … 4106 4155 pHlp->pfnPrintf(pHlp, "char height %d\n", val); 4107 4156 pHlp->pfnPrintf(pHlp, "text mode %dx%d\n", w / char_dots, h / (char_height << double_scan)); 4157 4158 uint32_t cbLine; 4159 uint32_t offStart; 4160 uint32_t uLineCompareIgn; 4161 vga_get_offsets(pThis, &cbLine, &offStart, &uLineCompareIgn); 4162 if (!cbLine) 4163 cbLine = 80 * 8; 4164 offStart *= 8; 4165 pHlp->pfnPrintf(pHlp, "cbLine: %#x\n", cbLine); 4166 pHlp->pfnPrintf(pHlp, "offStart: %#x (line %#x)\n", offStart, offStart / cbLine); 4108 4167 } 4109 4168 if (pThis->fRealRetrace) … … 4126 4185 } 4127 4186 pHlp->pfnPrintf(pHlp, "display refresh interval: %u ms\n", pThis->cMilliesRefreshInterval); 4187 4188 #ifdef VBOX_WITH_VMSVGA 4189 if (pThis->svga.fEnabled) { 4190 pHlp->pfnPrintf(pHlp, pThis->svga.f3DEnabled ? "VMSVGA 3D enabled: %ux%ux%u\n" : "VMSVGA enabled: %ux%ux%u", 4191 pThis->svga.uWidth, pThis->svga.uHeight, pThis->svga.uBpp); 4192 } 4193 #endif 4128 4194 } 4129 4195 … … 4263 4329 * frame buffer is done intentionally so that we're more 4264 4330 * likely to obtain the full scrollback of a linux panic. 4331 * windbg> .printf "------ start -----\n"; .for (r $t0 = 0; @$t0 < 25; r $t0 = @$t0 + 1) { .for (r $t1 = 0; @$t1 < 80; r $t1 = @$t1 + 1) { .printf "%c", by( (@$t0 * 80 + @$t1) * 8 + 100f0000) }; .printf "\n" }; .printf "------ end -----\n"; 4265 4332 */ 4266 4333 uint32_t cbLine; -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r55493 r55795 219 219 #define VMSVGA_FIFO_EXTCMD_LOADSTATE 3 220 220 #define VMSVGA_FIFO_EXTCMD_RESET 4 221 222 /** Size of the region to backup when switching into svga mode. */ 223 #define VMSVGA_FRAMEBUFFER_BACKUP_SIZE (32*1024) 221 224 222 225 typedef struct
Note:
See TracChangeset
for help on using the changeset viewer.

