Bug 1561859 - [Wayland] Expose active DRM on Wayland in about:support & telemetry, r=kats
☠☠ backed out by 6e562ac5f996 ☠ ☠
authorMartin Stransky <stransky@redhat.com>
Mon, 01 Jul 2019 13:44:14 +0000
changeset 543641 6e378fbef555113f365ba7f7f79f9ab0e661004e
parent 543640 4402726debae46e14c5a814014afdb7a8997df83
child 543642 ea121152fa96f3df1ae0aaec78c367b5fd001cf2
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1561859
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1561859 - [Wayland] Expose active DRM on Wayland in about:support & telemetry, r=kats Differential Revision: https://phabricator.services.mozilla.com/D36248
toolkit/crashreporter/CrashAnnotations.yaml
widget/GfxInfoX11.cpp
widget/GfxInfoX11.h
widget/moz.build
--- a/toolkit/crashreporter/CrashAnnotations.yaml
+++ b/toolkit/crashreporter/CrashAnnotations.yaml
@@ -468,16 +468,21 @@ IsGarbageCollecting:
   type: boolean
   ping: true
 
 IsWayland:
   description: >
     If true then the Wayland windowing system was in use.
   type: boolean
 
+IsWaylandDRM:
+  description: >
+    If true then the Wayland DRM backend was in use.
+  type: boolean
+
 JavaStackTrace:
   description: >
     Java stack trace, only present on Firefox for Android if we encounter an
     uncaught Java exception.
   type: string
 
 JSLargeAllocationFailure:
   description: >
--- a/widget/GfxInfoX11.cpp
+++ b/widget/GfxInfoX11.cpp
@@ -15,16 +15,19 @@
 #include "nsICrashReporter.h"
 #include "prenv.h"
 #include "nsPrintfCString.h"
 #include "nsWhitespaceTokenizer.h"
 
 #include "GfxInfoX11.h"
 
 #include <gdk/gdkx.h>
+#ifdef MOZ_WAYLAND
+#  include "mozilla/widget/nsWaylandDisplay.h"
+#endif
 
 #ifdef DEBUG
 bool fire_glxtest_process();
 #endif
 
 namespace mozilla {
 namespace widget {
 
@@ -38,30 +41,33 @@ pid_t glxtest_pid = 0;
 
 nsresult GfxInfo::Init() {
   mGLMajorVersion = 0;
   mGLMinorVersion = 0;
   mHasTextureFromPixmap = false;
   mIsMesa = false;
   mIsAccelerated = true;
   mIsWayland = false;
+  mIsWaylandDRM = false;
   return GfxInfoBase::Init();
 }
 
 void GfxInfo::AddCrashReportAnnotations() {
   CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::AdapterVendorID,
                                      mVendorId);
   CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::AdapterDeviceID,
                                      mDeviceId);
   CrashReporter::AnnotateCrashReport(
       CrashReporter::Annotation::AdapterDriverVendor, mDriverVendor);
   CrashReporter::AnnotateCrashReport(
       CrashReporter::Annotation::AdapterDriverVersion, mDriverVersion);
   CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::IsWayland,
                                      mIsWayland);
+  CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::IsWaylandDRM,
+                                     mIsWaylandDRM);
 }
 
 void GfxInfo::GetData() {
   // to understand this function, see bug 639842. We retrieve the OpenGL driver
   // information in a separate process to protect against bad drivers.
 
   // if glxtest_pipe == -1, that means that we already read the information
   if (glxtest_pipe == -1) return;
@@ -288,18 +294,22 @@ void GfxInfo::GetData() {
   if (mVendorId.IsEmpty()) {
     mVendorId.Assign(glVendor.get());
   }
   if (mDeviceId.IsEmpty()) {
     mDeviceId.Assign(glRenderer.get());
   }
 
   mAdapterDescription.Assign(glRenderer);
+#ifdef MOZ_WAYLAND
   mIsWayland = !GDK_IS_X11_DISPLAY(gdk_display_get_default());
-
+  if (mIsWayland) {
+    mIsWaylandDRM = nsWaylandDisplay::IsDMABufEnabled();
+  }
+#endif
   AddCrashReportAnnotations();
 }
 
 const nsTArray<GfxDriverInfo>& GfxInfo::GetGfxDriverInfo() {
   if (!sDriverInfo->Length()) {
     // Mesa 10.0 provides the GLX_MESA_query_renderer extension, which allows us
     // to query device IDs backing a GL context for blacklisting.
     APPEND_TO_DRIVER_BLOCKLIST(
@@ -446,17 +456,21 @@ GfxInfo::GetDWriteVersion(nsAString& aDw
 NS_IMETHODIMP
 GfxInfo::GetCleartypeParameters(nsAString& aCleartypeParams) {
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 GfxInfo::GetWindowProtocol(nsAString& aWindowProtocol) {
   if (mIsWayland) {
-    aWindowProtocol.AssignLiteral("wayland");
+    if (mIsWaylandDRM) {
+      aWindowProtocol.AssignLiteral("wayland (drm)");
+    } else {
+      aWindowProtocol.AssignLiteral("wayland");
+    }
     return NS_OK;
   }
 
   aWindowProtocol.AssignLiteral("x11");
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/widget/GfxInfoX11.h
+++ b/widget/GfxInfoX11.h
@@ -76,16 +76,17 @@ class GfxInfo final : public GfxInfoBase
   nsCString mAdapterRAM;
   nsCString mOS;
   nsCString mOSRelease;
   bool mHasTextureFromPixmap;
   unsigned int mGLMajorVersion, mGLMinorVersion;
   bool mIsMesa;
   bool mIsAccelerated;
   bool mIsWayland;
+  bool mIsWaylandDRM;
 
   void AddCrashReportAnnotations();
 };
 
 }  // namespace widget
 }  // namespace mozilla
 
 #endif /* __GfxInfoX11_h__ */
--- a/widget/moz.build
+++ b/widget/moz.build
@@ -330,8 +330,10 @@ LOCAL_INCLUDES += [
     '/widget/%s' % widget_dir,
 ]
 FINAL_LIBRARY = 'xul'
 
 if CONFIG['MOZ_ENABLE_D3D10_LAYER']:
     DEFINES['MOZ_ENABLE_D3D10_LAYER'] = True
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
+if CONFIG['MOZ_WAYLAND']:
+    CXXFLAGS += CONFIG['MOZ_WAYLAND_CFLAGS']