Changeset 101477 in vbox
- Timestamp:
- Oct 17, 2023 12:09:33 PM (15 months ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r101474 r101477 758 758 const ComPtr<IGraphicsAdapter> &ptrGraphicsAdapter, 759 759 const ComPtr<IFirmwareSettings> &ptrFirmwareSettings, 760 bool f HMEnabled);760 bool fForceVmSvga3 = false, bool fExposeLegacyVga = true); 761 761 int i_checkMediumLocation(IMedium *pMedium, bool *pfUseHostIOCache); 762 762 int i_unmountMediumFromGuest(PUVM pUVM, PCVMMR3VTABLE pVMM, StorageBus_T enmBus, DeviceType_T enmDevType, -
trunk/src/VBox/Main/src-client/ConsoleImplConfigArmV8.cpp
r101475 r101477 605 605 vrc = RTFdtNodeFinalize(hFdt); VRC(); 606 606 607 /* 608 * VMSVGA compliant graphics controller. 609 */ 607 610 if ( enmGraphicsController != GraphicsControllerType_QemuRamFB 608 611 && enmGraphicsController != GraphicsControllerType_Null) 609 612 { 610 InsertConfigNode(pDevices, "vga", &pDev); 611 InsertConfigNode(pDev, "0", &pInst); 612 InsertConfigInteger(pInst, "Trusted", 1); 613 hrc = pBusMgr->assignPCIDevice("vga", pInst); H(); 614 InsertConfigNode(pInst, "Config", &pCfg); 615 InsertConfigInteger(pCfg, "VRamSize", 32 * _1M); 616 InsertConfigInteger(pCfg, "MonitorCount", 1); 617 i_attachStatusDriver(pInst, DeviceType_Graphics3D); 618 InsertConfigInteger(pCfg, "VMSVGAEnabled", true); 619 InsertConfigInteger(pCfg, "VMSVGAPciBarLayout", true); 620 InsertConfigInteger(pCfg, "VMSVGAPciId", true); 621 InsertConfigInteger(pCfg, "VMSVGA3dEnabled", false); 622 InsertConfigInteger(pCfg, "VmSvga3", true); 623 InsertConfigInteger(pCfg, "VmSvgaExposeLegacyVga", false); 624 625 /* Attach the display. */ 626 InsertConfigNode(pInst, "LUN#0", &pLunL0); 627 InsertConfigString(pLunL0, "Driver", "MainDisplay"); 628 InsertConfigNode(pLunL0, "Config", &pCfg); 613 vrc = i_configGraphicsController(pDevices, enmGraphicsController, pBusMgr, pMachine, 614 pGraphicsAdapter, firmwareSettings, 615 true /*fForceVmSvga3*/, false /*fExposeLegacyVga*/); VRC(); 629 616 } 630 617 -
trunk/src/VBox/Main/src-client/ConsoleImplConfigCommon.cpp
r101474 r101477 5026 5026 5027 5027 5028 int Console::i_configGraphicsController(PCFGMNODE pDevices, 5029 const GraphicsControllerType_T enmGraphicsController, 5030 BusAssignmentManager *pBusMgr, 5031 const ComPtr<IMachine> &ptrMachine, 5032 const ComPtr<IGraphicsAdapter> &ptrGraphicsAdapter, 5033 const ComPtr<IFirmwareSettings> &ptrFirmwareSettings, 5034 bool fForceVmSvga3, bool fExposeLegacyVga) 5035 { 5036 // InsertConfig* throws 5037 try 5038 { 5039 PCFGMNODE pDev, pInst, pCfg, pLunL0; 5040 HRESULT hrc; 5041 Bstr bstr; 5042 const char *pcszDevice = "vga"; 5043 5044 InsertConfigNode(pDevices, pcszDevice, &pDev); 5045 InsertConfigNode(pDev, "0", &pInst); 5046 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 5047 5048 hrc = pBusMgr->assignPCIDevice(pcszDevice, pInst); H(); 5049 InsertConfigNode(pInst, "Config", &pCfg); 5050 ULONG cVRamMBs; 5051 hrc = ptrGraphicsAdapter->COMGETTER(VRAMSize)(&cVRamMBs); H(); 5052 InsertConfigInteger(pCfg, "VRamSize", cVRamMBs * _1M); 5053 ULONG cMonitorCount; 5054 hrc = ptrGraphicsAdapter->COMGETTER(MonitorCount)(&cMonitorCount); H(); 5055 InsertConfigInteger(pCfg, "MonitorCount", cMonitorCount); 5056 5057 BOOL f3DEnabled; 5058 hrc = ptrGraphicsAdapter->COMGETTER(Accelerate3DEnabled)(&f3DEnabled); H(); 5059 InsertConfigInteger(pCfg, "3DEnabled", f3DEnabled); 5060 5061 i_attachStatusDriver(pInst, DeviceType_Graphics3D); 5062 5063 #ifdef VBOX_WITH_VMSVGA 5064 if ( enmGraphicsController == GraphicsControllerType_VMSVGA 5065 || enmGraphicsController == GraphicsControllerType_VBoxSVGA) 5066 { 5067 InsertConfigInteger(pCfg, "VMSVGAEnabled", true); 5068 if (enmGraphicsController == GraphicsControllerType_VMSVGA) 5069 { 5070 InsertConfigInteger(pCfg, "VMSVGAPciBarLayout", true); 5071 InsertConfigInteger(pCfg, "VMSVGAPciId", true); 5072 } 5073 # ifdef VBOX_WITH_VMSVGA3D 5074 InsertConfigInteger(pCfg, "VMSVGA3dEnabled", f3DEnabled); 5075 # else 5076 LogRel(("VMSVGA3d not available in this build!\n")); 5077 # endif /* VBOX_WITH_VMSVGA3D */ 5078 5079 InsertConfigInteger(pCfg, "VmSvga3", fForceVmSvga3); 5080 InsertConfigInteger(pCfg, "VmSvgaExposeLegacyVga", fExposeLegacyVga); 5081 } 5082 #else 5083 RT_NOREF(enmGraphicsController); 5084 #endif /* VBOX_WITH_VMSVGA */ 5085 5086 /* Custom VESA mode list */ 5087 unsigned cModes = 0; 5088 for (unsigned iMode = 1; iMode <= 16; ++iMode) 5089 { 5090 char szExtraDataKey[sizeof("CustomVideoModeXX")]; 5091 RTStrPrintf(szExtraDataKey, sizeof(szExtraDataKey), "CustomVideoMode%u", iMode); 5092 hrc = ptrMachine->GetExtraData(Bstr(szExtraDataKey).raw(), bstr.asOutParam()); H(); 5093 if (bstr.isEmpty()) 5094 break; 5095 InsertConfigString(pCfg, szExtraDataKey, bstr); 5096 ++cModes; 5097 } 5098 InsertConfigInteger(pCfg, "CustomVideoModes", cModes); 5099 5100 /* VESA height reduction */ 5101 ULONG ulHeightReduction; 5102 IFramebuffer *pFramebuffer = NULL; 5103 hrc = i_getDisplay()->QueryFramebuffer(0, &pFramebuffer); 5104 if (SUCCEEDED(hrc) && pFramebuffer) 5105 { 5106 hrc = pFramebuffer->COMGETTER(HeightReduction)(&ulHeightReduction); H(); 5107 pFramebuffer->Release(); 5108 pFramebuffer = NULL; 5109 } 5110 else 5111 { 5112 /* If framebuffer is not available, there is no height reduction. */ 5113 ulHeightReduction = 0; 5114 } 5115 InsertConfigInteger(pCfg, "HeightReduction", ulHeightReduction); 5116 5117 /* 5118 * BIOS logo 5119 */ 5120 BOOL fFadeIn; 5121 hrc = ptrFirmwareSettings->COMGETTER(LogoFadeIn)(&fFadeIn); H(); 5122 InsertConfigInteger(pCfg, "FadeIn", fFadeIn ? 1 : 0); 5123 BOOL fFadeOut; 5124 hrc = ptrFirmwareSettings->COMGETTER(LogoFadeOut)(&fFadeOut); H(); 5125 InsertConfigInteger(pCfg, "FadeOut", fFadeOut ? 1: 0); 5126 ULONG logoDisplayTime; 5127 hrc = ptrFirmwareSettings->COMGETTER(LogoDisplayTime)(&logoDisplayTime); H(); 5128 InsertConfigInteger(pCfg, "LogoTime", logoDisplayTime); 5129 Bstr bstrLogoImagePath; 5130 hrc = ptrFirmwareSettings->COMGETTER(LogoImagePath)(bstrLogoImagePath.asOutParam()); H(); 5131 InsertConfigString(pCfg, "LogoFile", bstrLogoImagePath); 5132 5133 /* 5134 * Boot menu 5135 */ 5136 FirmwareBootMenuMode_T enmBootMenuMode; 5137 int iShowBootMenu; 5138 hrc = ptrFirmwareSettings->COMGETTER(BootMenuMode)(&enmBootMenuMode); H(); 5139 switch (enmBootMenuMode) 5140 { 5141 case FirmwareBootMenuMode_Disabled: iShowBootMenu = 0; break; 5142 case FirmwareBootMenuMode_MenuOnly: iShowBootMenu = 1; break; 5143 default: iShowBootMenu = 2; break; 5144 } 5145 InsertConfigInteger(pCfg, "ShowBootMenu", iShowBootMenu); 5146 5147 /* Attach the display. */ 5148 InsertConfigNode(pInst, "LUN#0", &pLunL0); 5149 InsertConfigString(pLunL0, "Driver", "MainDisplay"); 5150 InsertConfigNode(pLunL0, "Config", &pCfg); 5151 } 5152 catch (ConfigError &x) 5153 { 5154 // InsertConfig threw something: 5155 return x.m_vrc; 5156 } 5157 5158 return VINF_SUCCESS; 5159 } 5160 5028 5161 #undef H 5029 5162 #undef VRC -
trunk/src/VBox/Main/src-client/ConsoleImplConfigX86.cpp
r101469 r101477 1419 1419 #endif 1420 1420 case GraphicsControllerType_VBoxVGA: 1421 vrc = i_configGraphicsController(pDevices, enmGraphicsController, pBusMgr, pMachine, pGraphicsAdapter, firmwareSettings, 1422 RT_BOOL(fHMEnabled)); 1421 vrc = i_configGraphicsController(pDevices, enmGraphicsController, pBusMgr, pMachine, pGraphicsAdapter, firmwareSettings); 1423 1422 if (FAILED(vrc)) 1424 1423 return vrc; … … 2070 2069 return vrc; 2071 2070 } 2072 2073 2074 int Console::i_configGraphicsController(PCFGMNODE pDevices,2075 const GraphicsControllerType_T enmGraphicsController,2076 BusAssignmentManager *pBusMgr,2077 const ComPtr<IMachine> &ptrMachine,2078 const ComPtr<IGraphicsAdapter> &ptrGraphicsAdapter,2079 const ComPtr<IFirmwareSettings> &ptrFirmwareSettings,2080 bool fHMEnabled)2081 {2082 // InsertConfig* throws2083 try2084 {2085 PCFGMNODE pDev, pInst, pCfg, pLunL0;2086 HRESULT hrc;2087 Bstr bstr;2088 const char *pcszDevice = "vga";2089 2090 #define H() AssertLogRelMsgReturn(!FAILED(hrc), ("hrc=%Rhrc\n", hrc), VERR_MAIN_CONFIG_CONSTRUCTOR_COM_ERROR)2091 InsertConfigNode(pDevices, pcszDevice, &pDev);2092 InsertConfigNode(pDev, "0", &pInst);2093 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */2094 2095 hrc = pBusMgr->assignPCIDevice(pcszDevice, pInst); H();2096 InsertConfigNode(pInst, "Config", &pCfg);2097 ULONG cVRamMBs;2098 hrc = ptrGraphicsAdapter->COMGETTER(VRAMSize)(&cVRamMBs); H();2099 InsertConfigInteger(pCfg, "VRamSize", cVRamMBs * _1M);2100 ULONG cMonitorCount;2101 hrc = ptrGraphicsAdapter->COMGETTER(MonitorCount)(&cMonitorCount); H();2102 InsertConfigInteger(pCfg, "MonitorCount", cMonitorCount);2103 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE2104 InsertConfigInteger(pCfg, "R0Enabled", fHMEnabled);2105 #else2106 NOREF(fHMEnabled);2107 #endif2108 BOOL f3DEnabled;2109 hrc = ptrGraphicsAdapter->COMGETTER(Accelerate3DEnabled)(&f3DEnabled); H();2110 InsertConfigInteger(pCfg, "3DEnabled", f3DEnabled);2111 2112 i_attachStatusDriver(pInst, DeviceType_Graphics3D);2113 2114 #ifdef VBOX_WITH_VMSVGA2115 if ( enmGraphicsController == GraphicsControllerType_VMSVGA2116 || enmGraphicsController == GraphicsControllerType_VBoxSVGA)2117 {2118 InsertConfigInteger(pCfg, "VMSVGAEnabled", true);2119 if (enmGraphicsController == GraphicsControllerType_VMSVGA)2120 {2121 InsertConfigInteger(pCfg, "VMSVGAPciBarLayout", true);2122 InsertConfigInteger(pCfg, "VMSVGAPciId", true);2123 }2124 # ifdef VBOX_WITH_VMSVGA3D2125 InsertConfigInteger(pCfg, "VMSVGA3dEnabled", f3DEnabled);2126 # else2127 LogRel(("VMSVGA3d not available in this build!\n"));2128 # endif /* VBOX_WITH_VMSVGA3D */2129 }2130 #else2131 RT_NOREF(enmGraphicsController);2132 #endif /* VBOX_WITH_VMSVGA */2133 2134 /* Custom VESA mode list */2135 unsigned cModes = 0;2136 for (unsigned iMode = 1; iMode <= 16; ++iMode)2137 {2138 char szExtraDataKey[sizeof("CustomVideoModeXX")];2139 RTStrPrintf(szExtraDataKey, sizeof(szExtraDataKey), "CustomVideoMode%u", iMode);2140 hrc = ptrMachine->GetExtraData(Bstr(szExtraDataKey).raw(), bstr.asOutParam()); H();2141 if (bstr.isEmpty())2142 break;2143 InsertConfigString(pCfg, szExtraDataKey, bstr);2144 ++cModes;2145 }2146 InsertConfigInteger(pCfg, "CustomVideoModes", cModes);2147 2148 /* VESA height reduction */2149 ULONG ulHeightReduction;2150 IFramebuffer *pFramebuffer = NULL;2151 hrc = i_getDisplay()->QueryFramebuffer(0, &pFramebuffer);2152 if (SUCCEEDED(hrc) && pFramebuffer)2153 {2154 hrc = pFramebuffer->COMGETTER(HeightReduction)(&ulHeightReduction); H();2155 pFramebuffer->Release();2156 pFramebuffer = NULL;2157 }2158 else2159 {2160 /* If framebuffer is not available, there is no height reduction. */2161 ulHeightReduction = 0;2162 }2163 InsertConfigInteger(pCfg, "HeightReduction", ulHeightReduction);2164 2165 /*2166 * BIOS logo2167 */2168 BOOL fFadeIn;2169 hrc = ptrFirmwareSettings->COMGETTER(LogoFadeIn)(&fFadeIn); H();2170 InsertConfigInteger(pCfg, "FadeIn", fFadeIn ? 1 : 0);2171 BOOL fFadeOut;2172 hrc = ptrFirmwareSettings->COMGETTER(LogoFadeOut)(&fFadeOut); H();2173 InsertConfigInteger(pCfg, "FadeOut", fFadeOut ? 1: 0);2174 ULONG logoDisplayTime;2175 hrc = ptrFirmwareSettings->COMGETTER(LogoDisplayTime)(&logoDisplayTime); H();2176 InsertConfigInteger(pCfg, "LogoTime", logoDisplayTime);2177 Bstr bstrLogoImagePath;2178 hrc = ptrFirmwareSettings->COMGETTER(LogoImagePath)(bstrLogoImagePath.asOutParam()); H();2179 InsertConfigString(pCfg, "LogoFile", bstrLogoImagePath);2180 2181 /*2182 * Boot menu2183 */2184 FirmwareBootMenuMode_T enmBootMenuMode;2185 int iShowBootMenu;2186 hrc = ptrFirmwareSettings->COMGETTER(BootMenuMode)(&enmBootMenuMode); H();2187 switch (enmBootMenuMode)2188 {2189 case FirmwareBootMenuMode_Disabled: iShowBootMenu = 0; break;2190 case FirmwareBootMenuMode_MenuOnly: iShowBootMenu = 1; break;2191 default: iShowBootMenu = 2; break;2192 }2193 InsertConfigInteger(pCfg, "ShowBootMenu", iShowBootMenu);2194 2195 /* Attach the display. */2196 InsertConfigNode(pInst, "LUN#0", &pLunL0);2197 InsertConfigString(pLunL0, "Driver", "MainDisplay");2198 InsertConfigNode(pLunL0, "Config", &pCfg);2199 }2200 catch (ConfigError &x)2201 {2202 // InsertConfig threw something:2203 return x.m_vrc;2204 }2205 2206 #undef H2207 2208 return VINF_SUCCESS;2209 }
Note:
See TracChangeset
for help on using the changeset viewer.