Changeset 67918 in vbox
- Timestamp:
- Jul 12, 2017 9:30:24 AM (7 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
-
Devices/EFI/DevEFI.cpp (modified) (7 diffs)
-
Devices/EFI/DevEFI.h (modified) (1 diff)
-
Devices/EFI/Firmware/VBoxPkg/VBoxVgaDxe/VBoxVgaGraphicsOutput.c (modified) (2 diffs)
-
Devices/EFI/Firmware/VBoxPkg/VBoxVgaDxe/VBoxVgaUgaDraw.c (modified) (4 diffs)
-
Main/src-client/ConsoleImpl2.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/DevEFI.cpp
r67586 r67918 222 222 /** Virtual machine CPU frequency. */ 223 223 uint64_t u64CpuFrequency; 224 /** GOP mode. */225 uint32_t u32G opMode;226 /** Uga modehorizontal resolution. */227 uint32_t cxUgaResolution;228 /** Uga modevertical resolution. */229 uint32_t cyUgaResolution;224 /** EFI Graphics mode (used as fallback if resolution is not known). */ 225 uint32_t u32GraphicsMode; 226 /** EFI Graphics (GOP or UGA) horizontal resolution. */ 227 uint32_t u32HorizontalResolution; 228 /** EFI Graphics (GOP or UGA) vertical resolution. */ 229 uint32_t u32VerticalResolution; 230 230 /** Physical address of PCI config space MMIO region */ 231 231 uint64_t u64McfgBase; … … 1105 1105 case EFI_INFO_INDEX_STACK_BASE: 1106 1106 case EFI_INFO_INDEX_STACK_SIZE: 1107 case EFI_INFO_INDEX_G OP_MODE:1108 case EFI_INFO_INDEX_ UGA_VERTICAL_RESOLUTION:1109 case EFI_INFO_INDEX_ UGA_HORIZONTAL_RESOLUTION:1107 case EFI_INFO_INDEX_GRAPHICS_MODE: 1108 case EFI_INFO_INDEX_VERTICAL_RESOLUTION: 1109 case EFI_INFO_INDEX_HORIZONTAL_RESOLUTION: 1110 1110 return 4; 1111 1111 case EFI_INFO_INDEX_BOOT_ARGS: … … 1190 1190 case EFI_INFO_INDEX_BOOT_ARGS: return efiInfoNextByteBuf(pThis, pThis->szBootArgs, sizeof(pThis->szBootArgs)); 1191 1191 case EFI_INFO_INDEX_DEVICE_PROPS: return efiInfoNextByteBuf(pThis, pThis->pbDeviceProps, pThis->cbDeviceProps); 1192 case EFI_INFO_INDEX_G OP_MODE: return efiInfoNextByteU32(pThis, pThis->u32GopMode);1193 case EFI_INFO_INDEX_ UGA_HORIZONTAL_RESOLUTION: return efiInfoNextByteU32(pThis, pThis->cxUgaResolution);1194 case EFI_INFO_INDEX_ UGA_VERTICAL_RESOLUTION: return efiInfoNextByteU32(pThis, pThis->cyUgaResolution);1192 case EFI_INFO_INDEX_GRAPHICS_MODE: return efiInfoNextByteU32(pThis, pThis->u32GraphicsMode); 1193 case EFI_INFO_INDEX_HORIZONTAL_RESOLUTION: return efiInfoNextByteU32(pThis, pThis->u32HorizontalResolution); 1194 case EFI_INFO_INDEX_VERTICAL_RESOLUTION: return efiInfoNextByteU32(pThis, pThis->u32VerticalResolution); 1195 1195 1196 1196 /* Keep in sync with value in EfiThunk.asm */ … … 1467 1467 pThis->szMsg[pThis->iMsg] = '\0'; 1468 1468 if (pThis->iMsg) 1469 Log (("efi: %s\n", pThis->szMsg));1469 LogRel(("efi: %s\n", pThis->szMsg)); 1470 1470 pThis->iMsg = 0; 1471 1471 } … … 1475 1475 { 1476 1476 pThis->szMsg[pThis->iMsg] = '\0'; 1477 Log (("efi: %s\n", pThis->szMsg));1477 LogRel(("efi: %s\n", pThis->szMsg)); 1478 1478 pThis->iMsg = 0; 1479 1479 } … … 2189 2189 "BootArgs\0" 2190 2190 "DeviceProps\0" 2191 "GopMode\0" 2192 "UgaHorizontalResolution\0" 2193 "UgaVerticalResolution\0")) 2191 "GopMode\0" // legacy 2192 "GraphicsMode\0" 2193 "UgaHorizontalResolution\0" // legacy 2194 "UgaVerticalResolution\0" // legacy 2195 "HorizontalResolution\0" 2196 "VerticalResolution\0")) 2194 2197 return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, 2195 2198 N_("Configuration error: Invalid config value(s) for the EFI device")); … … 2319 2322 2320 2323 /* 2321 * GOP graphics. 2322 */ 2323 rc = CFGMR3QueryU32Def(pCfg, "GopMode", &pThis->u32GopMode, 2 /* 1024x768 */); 2324 * EFI graphics mode (with new EFI VGA code used only as a fallback, for 2325 * old EFI VGA code the only way to select the GOP mode). 2326 */ 2327 rc = CFGMR3QueryU32Def(pCfg, "GraphicsMode", &pThis->u32GraphicsMode, UINT32_MAX); 2324 2328 if (RT_FAILURE(rc)) 2325 2329 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, 2326 N_("Configuration error: Querying \"GopMode\" as a 32-bit int failed")); 2327 if (pThis->u32GopMode == UINT32_MAX) 2328 pThis->u32GopMode = 2; /* 1024x768 */ 2329 2330 /* 2331 * Uga graphics, default to 1024x768. 2332 */ 2333 rc = CFGMR3QueryU32Def(pCfg, "UgaHorizontalResolution", &pThis->cxUgaResolution, 0); 2330 N_("Configuration error: Querying \"GraphicsMode\" as a 32-bit int failed")); 2331 if (pThis->u32GraphicsMode == UINT32_MAX) 2332 { 2333 /* get the legacy value if nothing else was specified */ 2334 rc = CFGMR3QueryU32Def(pCfg, "GopMode", &pThis->u32GraphicsMode, UINT32_MAX); 2335 if (RT_FAILURE(rc)) 2336 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, 2337 N_("Configuration error: Querying \"GopMode\" as a 32-bit int failed")); 2338 } 2339 if (pThis->u32GraphicsMode == UINT32_MAX) 2340 pThis->u32GraphicsMode = 2; /* 1024x768 */ 2341 2342 /* 2343 * EFI graphics resolution, defaults to 1024x768 (used to be UGA only, now 2344 * is the main config setting as the mode number is so hard to predict). 2345 */ 2346 rc = CFGMR3QueryU32Def(pCfg, "HorizontalResolution", &pThis->u32HorizontalResolution, 0); 2334 2347 AssertRCReturn(rc, rc); 2335 rc = CFGMR3QueryU32Def(pCfg, " UgaVerticalResolution", &pThis->cyUgaResolution, 0);2348 rc = CFGMR3QueryU32Def(pCfg, "VerticalResolution", &pThis->u32VerticalResolution, 0); 2336 2349 AssertRCReturn(rc, rc); 2337 if (pThis->cxUgaResolution == 0 || pThis->cyUgaResolution == 0) 2338 { 2339 pThis->cxUgaResolution = 1024; 2340 pThis->cyUgaResolution = 768; 2350 if (pThis->u32HorizontalResolution == 0 || pThis->u32VerticalResolution == 0) 2351 { 2352 /* get the legacy values if nothing else was specified */ 2353 rc = CFGMR3QueryU32Def(pCfg, "UgaHorizontalResolution", &pThis->u32HorizontalResolution, 0); 2354 AssertRCReturn(rc, rc); 2355 rc = CFGMR3QueryU32Def(pCfg, "UgaVerticalResolution", &pThis->u32VerticalResolution, 0); 2356 AssertRCReturn(rc, rc); 2357 } 2358 if (pThis->u32HorizontalResolution == 0 || pThis->u32VerticalResolution == 0) 2359 { 2360 pThis->u32HorizontalResolution = 1024; 2361 pThis->u32VerticalResolution = 768; 2341 2362 } 2342 2363 -
trunk/src/VBox/Devices/EFI/DevEFI.h
r67912 r67918 66 66 EFI_INFO_INDEX_CPU_FREQUENCY, 67 67 EFI_INFO_INDEX_TSC_FREQUENCY, 68 EFI_INFO_INDEX_G OP_MODE,69 EFI_INFO_INDEX_ UGA_HORIZONTAL_RESOLUTION,70 EFI_INFO_INDEX_ UGA_VERTICAL_RESOLUTION,68 EFI_INFO_INDEX_GRAPHICS_MODE, 69 EFI_INFO_INDEX_HORIZONTAL_RESOLUTION, 70 EFI_INFO_INDEX_VERTICAL_RESOLUTION, 71 71 EFI_INFO_INDEX_MCFG_BASE, 72 72 EFI_INFO_INDEX_MCFG_SIZE, -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxVgaDxe/VBoxVgaGraphicsOutput.c
r67356 r67918 426 426 ) 427 427 { 428 EFI_STATUS Status; 429 EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; 430 UINT32 GopMode = 2; 428 EFI_STATUS Status; 429 EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; 430 UINT32 Index; 431 UINT32 HorizontalResolution = 1024; 432 UINT32 VerticalResolution = 768; 433 UINT32 ColorDepth = 32; 434 435 DEBUG((DEBUG_INFO, "%a:%d construct\n", __FILE__, __LINE__)); 431 436 432 437 GraphicsOutput = &Private->GraphicsOutput; … … 461 466 // Initialize the hardware 462 467 // 463 VBoxVgaGetVmVariable(EFI_INFO_INDEX_GOP_MODE, (CHAR8 *)&GopMode, sizeof(GopMode)); 464 465 GraphicsOutput->SetMode (GraphicsOutput, GopMode); 468 VBoxVgaGetVmVariable(EFI_INFO_INDEX_HORIZONTAL_RESOLUTION, (CHAR8 *)&HorizontalResolution, 469 sizeof(HorizontalResolution)); 470 VBoxVgaGetVmVariable(EFI_INFO_INDEX_VERTICAL_RESOLUTION, (CHAR8 *)&VerticalResolution, 471 sizeof(VerticalResolution)); 472 for (Index = 0; Index < Private->MaxMode; Index++) 473 { 474 if ( HorizontalResolution == Private->ModeData[Index].HorizontalResolution 475 && VerticalResolution == Private->ModeData[Index].VerticalResolution 476 && ColorDepth == Private->ModeData[Index].ColorDepth) 477 break; 478 } 479 // not found? try mode number 480 if (Index >= Private->MaxMode) 481 { 482 VBoxVgaGetVmVariable(EFI_INFO_INDEX_GRAPHICS_MODE, (CHAR8 *)&Index, sizeof(Index)); 483 // try with mode 2 (usually 1024x768) as a fallback 484 if (Index >= Private->MaxMode) 485 Index = 2; 486 // try with mode 0 (usually 640x480) as a fallback 487 if (Index >= Private->MaxMode) 488 Index = 0; 489 } 490 491 // skip mode setting completely if there is no valid mode 492 if (Index >= Private->MaxMode) 493 return EFI_UNSUPPORTED; 494 495 GraphicsOutput->SetMode (GraphicsOutput, Index); 466 496 467 497 DrawLogo ( -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxVgaDxe/VBoxVgaUgaDraw.c
r67356 r67918 90 90 ) 91 91 { 92 VBOX_VGA_PRIVATE_DATA *Private;93 UINTN Index;92 VBOX_VGA_PRIVATE_DATA *Private; 93 UINTN Index; 94 94 95 95 DEBUG((DEBUG_INFO, "%a:%d VIDEO: %dx%d %d bpp\n", __FILE__, __LINE__, HorizontalResolution, VerticalResolution, ColorDepth)); … … 328 328 { 329 329 EFI_UGA_DRAW_PROTOCOL *UgaDraw; 330 UINT32 Index; 330 331 UINT32 HorizontalResolution = 1024; 331 332 UINT32 VerticalResolution = 768; 333 UINT32 ColorDepth = 32; 332 334 333 335 // … … 349 351 // Initialize the hardware 350 352 // 351 VBoxVgaGetVmVariable(EFI_INFO_INDEX_ UGA_HORIZONTAL_RESOLUTION, (CHAR8 *)&HorizontalResolution,353 VBoxVgaGetVmVariable(EFI_INFO_INDEX_HORIZONTAL_RESOLUTION, (CHAR8 *)&HorizontalResolution, 352 354 sizeof(HorizontalResolution)); 353 VBoxVgaGetVmVariable(EFI_INFO_INDEX_ UGA_VERTICAL_RESOLUTION, (CHAR8 *)&VerticalResolution,355 VBoxVgaGetVmVariable(EFI_INFO_INDEX_VERTICAL_RESOLUTION, (CHAR8 *)&VerticalResolution, 354 356 sizeof(VerticalResolution)); 357 for (Index = 0; Index < Private->MaxMode; Index++) 358 { 359 if ( HorizontalResolution == Private->ModeData[Index].HorizontalResolution 360 && VerticalResolution == Private->ModeData[Index].VerticalResolution 361 && ColorDepth == Private->ModeData[Index].ColorDepth) 362 break; 363 } 364 // not found? try mode number 365 if (Index >= Private->MaxMode) 366 { 367 VBoxVgaGetVmVariable(EFI_INFO_INDEX_GRAPHICS_MODE, (CHAR8 *)&Index, sizeof(Index)); 368 // try with mode 2 (usually 1024x768) as a fallback 369 if (Index >= Private->MaxMode) 370 Index = 2; 371 // try with mode 0 (usually 640x480) as a fallback 372 if (Index >= Private->MaxMode) 373 Index = 0; 374 375 // get the resolution from the mode if valid 376 if (Index < Private->MaxMode) 377 { 378 HorizontalResolution = Private->ModeData[Index].HorizontalResolution; 379 VerticalResolution = Private->ModeData[Index].VerticalResolution; 380 ColorDepth = Private->ModeData[Index].ColorDepth; 381 } 382 } 383 384 // skip mode setting completely if there is no valid mode 385 if (Index >= Private->MaxMode) 386 return EFI_UNSUPPORTED; 355 387 356 388 UgaDraw->SetMode ( … … 358 390 HorizontalResolution, 359 391 VerticalResolution, 360 32,392 ColorDepth, 361 393 60 362 394 ); -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r67914 r67918 1778 1778 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/EfiDeviceProps", &deviceProps); 1779 1779 1780 /* Get GOP mode settings */ 1781 uint32_t u32GopMode = UINT32_MAX; 1782 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/EfiGopMode", &strTmp); 1780 /* Get graphics mode settings */ 1781 uint32_t u32GraphicsMode = UINT32_MAX; 1782 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/EfiGraphicsMode", &strTmp); 1783 if (strTmp.isEmpty()) 1784 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/EfiGopMode", &strTmp); 1783 1785 if (!strTmp.isEmpty()) 1784 u32GopMode = strTmp.toUInt32(); 1785 1786 /* UGA mode settings */ 1787 uint32_t u32UgaHorizontal = 0; 1788 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/EfiUgaHorizontalResolution", &strTmp); 1786 u32GraphicsMode = strTmp.toUInt32(); 1787 1788 /* Get graphics resolution settings */ 1789 uint32_t u32HorizontalResolution = 0; 1790 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/EfiHorizontalResolution", &strTmp); 1791 if (strTmp.isEmpty()) 1792 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/EfiUgaHorizontalResolution", &strTmp); 1789 1793 if (!strTmp.isEmpty()) 1790 u32UgaHorizontal = strTmp.toUInt32(); 1791 1792 uint32_t u32UgaVertical = 0; 1793 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/EfiUgaVerticalResolution", &strTmp); 1794 u32HorizontalResolution = strTmp.toUInt32(); 1795 1796 uint32_t u32VerticalResolution = 0; 1797 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/EfiVerticalResolution", &strTmp); 1798 if (strTmp.isEmpty()) 1799 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/EfiUgaVerticalResolution", &strTmp); 1794 1800 if (!strTmp.isEmpty()) 1795 u32 UgaVertical= strTmp.toUInt32();1801 u32VerticalResolution = strTmp.toUInt32(); 1796 1802 1797 1803 /* … … 1812 1818 InsertConfigBytes(pCfg, "UUID", &HardwareUuid,sizeof(HardwareUuid)); 1813 1819 InsertConfigInteger(pCfg, "64BitEntry", f64BitEntry); /* boolean */ 1814 InsertConfigInteger(pCfg, "G opMode", u32GopMode);1815 InsertConfigInteger(pCfg, " UgaHorizontalResolution", u32UgaHorizontal);1816 InsertConfigInteger(pCfg, " UgaVerticalResolution", u32UgaVertical);1820 InsertConfigInteger(pCfg, "GraphicsMode", u32GraphicsMode); 1821 InsertConfigInteger(pCfg, "HorizontalResolution", u32HorizontalResolution); 1822 InsertConfigInteger(pCfg, "VerticalResolution", u32VerticalResolution); 1817 1823 1818 1824 /* For OS X guests we'll force passing host's DMI info to the guest */
Note:
See TracChangeset
for help on using the changeset viewer.

