Changeset 31195 in vbox
- Timestamp:
- Jul 29, 2010 8:40:17 AM (15 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r30886 r31195 1763 1763 static void vga_draw_text(VGAState *s, int full_update) 1764 1764 #else 1765 static int vga_draw_text(VGAState *s, int full_update )1765 static int vga_draw_text(VGAState *s, int full_update, bool fFailOnResize) 1766 1766 #endif /* !VBOX */ 1767 1767 { … … 1851 1851 if (width != (int)s->last_width || height != (int)s->last_height || 1852 1852 cw != s->last_cw || cheight != s->last_ch) { 1853 #ifdef VBOX 1854 if (fFailOnResize) 1855 { 1856 /* The caller does not want to call the pfnResize. */ 1857 return VERR_TRY_AGAIN; 1858 } 1859 #endif /* VBOX */ 1853 1860 s->last_scr_width = width * cw; 1854 1861 s->last_scr_height = height * cheight; … … 2175 2182 static void vga_draw_graphic(VGAState *s, int full_update) 2176 2183 #else 2177 static int vga_draw_graphic(VGAState *s, int full_update )2184 static int vga_draw_graphic(VGAState *s, int full_update, bool fFailOnResize) 2178 2185 #endif /* !VBOX */ 2179 2186 { … … 2262 2269 || offsets_changed) 2263 2270 { 2271 if (fFailOnResize) 2272 { 2273 /* The caller does not want to call the pfnResize. */ 2274 return VERR_TRY_AGAIN; 2275 } 2264 2276 int rc = vga_resize_graphic(s, disp_width, height, v); 2265 2277 if (rc != VINF_SUCCESS) /* Return any rc, particularly VINF_VGA_RESIZE_IN_PROGRESS, to the caller. */ … … 2468 2480 VGAState *s = vga_state; 2469 2481 #else /* VBOX */ 2470 static int vga_update_display(PVGASTATE s, bool fUpdateAll )2482 static int vga_update_display(PVGASTATE s, bool fUpdateAll, bool fFailOnResize) 2471 2483 { 2472 2484 int rc = VINF_SUCCESS; … … 2503 2515 #ifdef VBOX 2504 2516 if (fUpdateAll) { 2505 /* A full update is requested. Special processing for a "blank" mode is required. */ 2517 /* A full update is requested. Special processing for a "blank" mode is required, because 2518 * the request must process all pending resolution changes. 2519 * 2520 * Appropriate vga_draw_graphic or vga_draw_text function, which checks the resolution change, 2521 * must be called even if the screen has been blanked, but then the function should do no actual 2522 * screen update. To do this, pfnUpdateRect is replaced with a nop. 2523 */ 2506 2524 typedef DECLCALLBACK(void) FNUPDATERECT(PPDMIDISPLAYCONNECTOR pInterface, uint32_t x, uint32_t y, uint32_t cx, uint32_t cy); 2507 2525 typedef FNUPDATERECT *PFNUPDATERECT; … … 2524 2542 2525 2543 /* Do a complete redraw, which will pick up a new screen resolution. */ 2526 if (fBlank) { 2527 s->graphic_mode = GMODE_BLANK; 2528 vga_draw_blank(s, 1); 2529 } else if (s->gr[6] & 1) { 2544 if (s->gr[6] & 1) { 2530 2545 s->graphic_mode = GMODE_GRAPH; 2531 rc = vga_draw_graphic(s, 1 );2546 rc = vga_draw_graphic(s, 1, false); 2532 2547 } else { 2533 2548 s->graphic_mode = GMODE_TEXT; 2534 rc = vga_draw_text(s, 1 );2549 rc = vga_draw_text(s, 1, false); 2535 2550 } 2536 2551 … … 2561 2576 rc = 2562 2577 #endif /* VBOX */ 2563 vga_draw_text(s, full_update );2578 vga_draw_text(s, full_update, fFailOnResize); 2564 2579 break; 2565 2580 case GMODE_GRAPH: … … 2567 2582 rc = 2568 2583 #endif /* VBOX */ 2569 vga_draw_graphic(s, full_update );2584 vga_draw_graphic(s, full_update, fFailOnResize); 2570 2585 break; 2571 2586 case GMODE_BLANK: … … 3480 3495 { 3481 3496 #ifdef DEBUG_sunlover 3482 AssertMsgFailed(("vgaR3IOPortHGSMIRead: Port=%#x cb=%d\n", Port, cb));3497 Log(("vgaR3IOPortHGSMIRead: Port=%#x cb=%d\n", Port, cb)); 3483 3498 #endif 3484 3499 rc = VERR_IOM_IOPORT_UNUSED; … … 4861 4876 } 4862 4877 4863 rc = vga_update_display(pThis, false );4878 rc = vga_update_display(pThis, false, false); 4864 4879 if (rc != VINF_SUCCESS) 4865 4880 { … … 4889 4904 pThis->graphic_mode = -1; /* force full update */ 4890 4905 4891 return vga_update_display(pThis, true );4906 return vga_update_display(pThis, true, false); 4892 4907 } 4893 4908 … … 4978 4993 4979 4994 /* 4980 * Do a complete screen update first to resolve any pending resize issues. 4995 * Get screenshot. This function will fail if a resize is required. 4996 * So there is not need to do a 'updateDisplayAll' before taking screenshot. 4981 4997 */ 4982 updateDisplayAll(pThis);4983 4998 4984 4999 /* … … 5028 5043 /* Make the screenshot. 5029 5044 * 5030 * The second parameter is 'false' because the current display state, already updated by the 5031 * pfnUpdateDisplayAll call above, is being rendered to an external buffer using a fake connector. 5032 * That is if display is blanked, we expect a black screen in the external buffer. 5045 * The second parameter is 'false' because the current display state is being rendered to an 5046 * external buffer using a fake connector. That is if display is blanked, we expect a black 5047 * screen in the external buffer. 5048 * If there is a pending resize, the function will fail. 5033 5049 */ 5034 rc = vga_update_display(pThis, false );5050 rc = vga_update_display(pThis, false, true); 5035 5051 5036 5052 /* Restore. */ -
trunk/src/VBox/Main/DisplayImpl.cpp
r30871 r31195 2433 2433 uint32_t cx = 0; 2434 2434 uint32_t cy = 0; 2435 int vrc = VINF_SUCCESS; 2435 2436 2436 2437 #ifdef VBOX_WITH_OLD_VBVA_LOCK 2437 int vrc = VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)Display::displayTakeScreenshotEMT, 6, 2438 int cRetries = 5; 2439 2440 while (cRetries-- > 0) 2441 { 2442 vrc = VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)Display::displayTakeScreenshotEMT, 6, 2438 2443 pDisplay, aScreenId, &pu8Data, &cbData, &cx, &cy); 2444 if (vrc != VERR_TRY_AGAIN) 2445 { 2446 break; 2447 } 2448 2449 RTThreadSleep(10); 2450 } 2439 2451 #else 2440 2452 /* @todo pfnTakeScreenshot is probably callable from any thread, because it uses the VGA device lock. */ 2441 intvrc = VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)pDrv->pUpPort->pfnTakeScreenshot, 5,2453 vrc = VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)pDrv->pUpPort->pfnTakeScreenshot, 5, 2442 2454 pDrv->pUpPort, &pu8Data, &cbData, &cx, &cy); 2443 2455 #endif /* !VBOX_WITH_OLD_VBVA_LOCK */ … … 2525 2537 rc = setError(E_NOTIMPL, 2526 2538 tr("This feature is not implemented")); 2539 else if (vrc == VERR_TRY_AGAIN) 2540 rc = setError(E_UNEXPECTED, 2541 tr("This feature is not available at this time")); 2527 2542 else if (RT_FAILURE(vrc)) 2528 2543 rc = setError(VBOX_E_IPRT_ERROR,
Note:
See TracChangeset
for help on using the changeset viewer.