Skip to content

Commit fe1644b

Browse files
author
Butkovits Atila
committed
Backed out changeset 8d11a3a0d707 (bug 1843782) for causing failures complaining about RemoteProcessMonitor . CLOSED TREE
1 parent 5fed100 commit fe1644b

8 files changed

+27
-81
lines changed

gfx/config/gfxVars.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ class gfxVarReceiver;
9898
_(AllowBackdropFilter, bool, true) \
9999
_(WebglOopAsyncPresentForceSync, bool, true) \
100100
_(UseAcceleratedCanvas2D, bool, false) \
101-
_(AllowSoftwareWebRenderOGL, bool, false) \
102-
_(WebglUseHardware, bool, true)
101+
_(AllowSoftwareWebRenderOGL, bool, false)
103102

104103
/* Add new entries above this line. */
105104

gfx/gl/GLContextProviderEGL.cpp

-22
Original file line numberDiff line numberDiff line change
@@ -1129,28 +1129,6 @@ RefPtr<GLContextEGL> GLContextEGL::CreateWithoutSurface(
11291129
const std::shared_ptr<EglDisplay> egl, const GLContextCreateDesc& desc,
11301130
nsACString* const out_failureId) {
11311131
const auto WithUseGles = [&](const bool useGles) -> RefPtr<GLContextEGL> {
1132-
#ifdef MOZ_WIDGET_GTK
1133-
// First try creating a context with no config and no surface, this is what
1134-
// we really want, and seems to be the only way to make selecting software
1135-
// Mesa init properly when it's not the first device.
1136-
if (egl->IsExtensionSupported(EGLExtension::KHR_no_config_context) &&
1137-
egl->IsExtensionSupported(EGLExtension::KHR_surfaceless_context)) {
1138-
// These extensions have been supported by mesa and nvidia drivers
1139-
// since 2014 or earlier, this is the preferred code path
1140-
auto fullDesc = GLContextDesc{desc};
1141-
fullDesc.isOffscreen = true;
1142-
RefPtr<GLContextEGL> gl = GLContextEGL::CreateGLContext(
1143-
egl, fullDesc, EGL_NO_CONFIG, EGL_NO_SURFACE, useGles, EGL_NO_CONFIG,
1144-
out_failureId);
1145-
if (gl) {
1146-
return gl;
1147-
}
1148-
NS_WARNING(
1149-
"Failed to create GLContext with no config and no surface, will try "
1150-
"ChooseConfig");
1151-
}
1152-
#endif
1153-
11541132
const EGLConfig surfaceConfig = ChooseConfig(*egl, desc, useGles);
11551133
if (surfaceConfig == EGL_NO_CONFIG) {
11561134
*out_failureId = "FEATURE_FAILURE_EGL_NO_CONFIG"_ns;

gfx/gl/GLLibraryEGL.cpp

+22-34
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,10 @@ static std::shared_ptr<EglDisplay> GetAndInitDisplay(
171171

172172
#ifdef MOZ_WIDGET_GTK
173173
static std::shared_ptr<EglDisplay> GetAndInitDeviceDisplay(
174-
GLLibraryEGL& egl, const StaticMutexAutoLock& aProofOfLock,
175-
bool useDrmRenderDevice) {
174+
GLLibraryEGL& egl, const StaticMutexAutoLock& aProofOfLock) {
176175
nsAutoCString drmRenderDevice(gfx::gfxVars::DrmRenderDevice());
177-
if (!useDrmRenderDevice) {
178-
drmRenderDevice = "";
179-
}
180-
if (!egl.IsExtensionSupported(EGLLibExtension::EXT_platform_device) ||
176+
if (drmRenderDevice.IsEmpty() ||
177+
!egl.IsExtensionSupported(EGLLibExtension::EXT_platform_device) ||
181178
!egl.IsExtensionSupported(EGLLibExtension::EXT_device_enumeration)) {
182179
return nullptr;
183180
}
@@ -198,9 +195,8 @@ static std::shared_ptr<EglDisplay> GetAndInitDeviceDisplay(
198195
for (const auto& device : devices) {
199196
const char* renderNodeString =
200197
egl.fQueryDeviceStringEXT(device, LOCAL_EGL_DRM_RENDER_NODE_FILE_EXT);
201-
// We are looking for a specific device, skip others
202-
if (strcmp(renderNodeString ? renderNodeString : "",
203-
drmRenderDevice.get()) == 0) {
198+
if (renderNodeString &&
199+
strcmp(renderNodeString, drmRenderDevice.get()) == 0) {
204200
const EGLAttrib attrib_list[] = {LOCAL_EGL_NONE};
205201
display = egl.fGetPlatformDisplay(LOCAL_EGL_PLATFORM_DEVICE_EXT, device,
206202
attrib_list);
@@ -896,36 +892,28 @@ std::shared_ptr<EglDisplay> GLLibraryEGL::CreateDisplayLocked(
896892
}
897893
}
898894
} else {
895+
void* nativeDisplay = EGL_DEFAULT_DISPLAY;
899896
#ifdef MOZ_WIDGET_GTK
900-
// Check if we allow hardware rendering for WebGL
901-
if (gfx::gfxVars::WebglUseHardware()) {
902-
// Initialize the display the normal way
903-
if (gdk_display_get_default()) {
904-
void* nativeDisplay = EGL_DEFAULT_DISPLAY;
897+
if (!gdk_display_get_default()) {
898+
ret = GetAndInitDeviceDisplay(*this, aProofOfLock);
899+
if (!ret) {
900+
ret = GetAndInitSurfacelessDisplay(*this, aProofOfLock);
901+
}
902+
}
905903
# ifdef MOZ_WAYLAND
906-
if (widget::GdkIsWaylandDisplay()) {
907-
// Wayland does not support EGL_DEFAULT_DISPLAY
908-
nativeDisplay = widget::WaylandDisplayGetWLDisplay();
909-
if (!nativeDisplay) {
910-
NS_WARNING("Failed to get wl_display.");
911-
return nullptr;
912-
}
913-
}
914-
# endif
915-
ret = GetAndInitDisplay(*this, nativeDisplay, aProofOfLock);
916-
} else {
917-
// Enumerate EGL devices to find the chosen drm render device
918-
ret = GetAndInitDeviceDisplay(*this, aProofOfLock, true);
919-
// Try a mesa surfaceless display
920-
if (!ret) {
921-
ret = GetAndInitSurfacelessDisplay(*this, aProofOfLock);
922-
}
904+
else if (widget::GdkIsWaylandDisplay()) {
905+
// Wayland does not support EGL_DEFAULT_DISPLAY
906+
nativeDisplay = widget::WaylandDisplayGetWLDisplay();
907+
if (!nativeDisplay) {
908+
NS_WARNING("Failed to get wl_display.");
909+
return nullptr;
923910
}
924-
} else {
925-
// Initialize a swrast egl device such as llvmpipe
926-
ret = GetAndInitDeviceDisplay(*this, aProofOfLock, false);
927911
}
912+
# endif
928913
#endif
914+
if (!ret) {
915+
ret = GetAndInitDisplay(*this, nativeDisplay, aProofOfLock);
916+
}
929917
}
930918

931919
if (!ret) {

gfx/thebes/gfxPlatform.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -2995,8 +2995,6 @@ void gfxPlatform::InitWebGLConfig() {
29952995
IsFeatureOk(nsIGfxInfo::FEATURE_WEBGL_OPENGL));
29962996
gfxVars::SetAllowWebglAccelAngle(
29972997
IsFeatureOk(nsIGfxInfo::FEATURE_WEBGL_ANGLE));
2998-
gfxVars::SetWebglUseHardware(
2999-
IsFeatureOk(nsIGfxInfo::FEATURE_WEBGL_USE_HARDWARE));
30002998

30012999
if (kIsMacOS) {
30023000
// Avoid crash for Intel HD Graphics 3000 on OSX. (Bug 1413269)

gfx/thebes/gfxPlatformGtk.cpp

+3-8
Original file line numberDiff line numberDiff line change
@@ -225,16 +225,11 @@ void gfxPlatformGtk::InitDmabufConfig() {
225225
"FEATURE_FAILURE_REQUIRES_EGL"_ns);
226226
}
227227

228-
if (!gfxVars::WebglUseHardware()) {
229-
feature.Disable(FeatureStatus::Blocklisted,
230-
"Blocklisted with forced software rendering", failureId);
231-
}
228+
nsAutoCString drmRenderDevice;
229+
gfxInfo->GetDrmRenderDevice(drmRenderDevice);
230+
gfxVars::SetDrmRenderDevice(drmRenderDevice);
232231

233232
if (feature.IsEnabled()) {
234-
nsAutoCString drmRenderDevice;
235-
gfxInfo->GetDrmRenderDevice(drmRenderDevice);
236-
gfxVars::SetDrmRenderDevice(drmRenderDevice);
237-
238233
if (!GetDMABufDevice()->IsEnabled(failureId)) {
239234
feature.ForceDisable(FeatureStatus::Failed, "Failed to configure",
240235
failureId);

widget/GfxInfoBase.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,6 @@ static const char* GetPrefNameForFeature(int32_t aFeature) {
269269
case nsIGfxInfo::FEATURE_VIDEO_SOFTWARE_OVERLAY:
270270
name = BLOCKLIST_PREF_BRANCH "video-software-overlay";
271271
break;
272-
case nsIGfxInfo::FEATURE_WEBGL_USE_HARDWARE:
273-
name = BLOCKLIST_PREF_BRANCH "webgl-use-hardware";
274-
break;
275272
default:
276273
MOZ_ASSERT_UNREACHABLE("Unexpected nsIGfxInfo feature?!");
277274
break;

widget/gtk/GfxInfo.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -973,13 +973,6 @@ const nsTArray<GfxDriverInfo>& GfxInfo::GetGfxDriverInfo() {
973973
nsIGfxInfo::FEATURE_WEBRENDER, nsIGfxInfo::FEATURE_BLOCKED_DEVICE,
974974
DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0),
975975
"FEATURE_FAILURE_WEBRENDER_MESA_VM", "");
976-
// Disable hardware mesa drivers in virtual machines due to instability.
977-
APPEND_TO_DRIVER_BLOCKLIST_EXT(
978-
OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
979-
WindowProtocol::All, DriverVendor::MesaVM, DeviceFamily::All,
980-
nsIGfxInfo::FEATURE_WEBGL_USE_HARDWARE,
981-
nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED,
982-
V(0, 0, 0, 0), "FEATURE_FAILURE_WEBGL_MESA_VM", "");
983976

984977
////////////////////////////////////
985978
// FEATURE_WEBRENDER_COMPOSITOR

widget/nsIGfxInfo.idl

+1-3
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,8 @@ interface nsIGfxInfo : nsISupports
187187
const long FEATURE_AV1_HW_DECODE = 45;
188188
/* Whether video overlay of software decoded video is supported, starting in 116. */
189189
const long FEATURE_VIDEO_SOFTWARE_OVERLAY = 46;
190-
/* Whether WebGL is allowed to use hardware rendering, otherwise software fallbacks. */
191-
const long FEATURE_WEBGL_USE_HARDWARE = 47;
192190
/* the maximum feature value. */
193-
const long FEATURE_MAX_VALUE = FEATURE_WEBGL_USE_HARDWARE;
191+
const long FEATURE_MAX_VALUE = FEATURE_VIDEO_SOFTWARE_OVERLAY;
194192

195193
/*
196194
* A set of return values from GetFeatureStatus

0 commit comments

Comments
 (0)