Bug 1557265 - [Wayland] Require libdrm to build Wayland backend, r=glandium
authorMartin Stransky <stransky@redhat.com>
Thu, 20 Jun 2019 21:51:15 +0000
changeset 479790 54f8d7c37934272ac097e53e1bcda0deba29d202
parent 479789 d4f9f1628d1f5fe3a5f461c760a0a7eac5027171
child 479791 add34d86fd69d265f2313cac624e65ab3ede770c
push id88279
push usercsabou@mozilla.com
push dateFri, 21 Jun 2019 00:47:44 +0000
treeherderautoland@757d55658592 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1557265
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 1557265 - [Wayland] Require libdrm to build Wayland backend, r=glandium Differential Revision: https://phabricator.services.mozilla.com/D33918
toolkit/moz.configure
widget/gtk/WaylandDMABufSurface.cpp
widget/gtk/nsGtkKeyUtils.cpp
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -245,17 +245,17 @@ def toolkit_gtk(toolkit):
 
 set_config('MOZ_X11', True, when=toolkit_gtk)
 set_define('MOZ_X11', True, when=toolkit_gtk)
 add_old_configure_assignment('MOZ_X11', True, when=toolkit_gtk)
 
 # Wayland support
 # ==============================================================
 wayland_headers = pkg_check_modules(
-    'MOZ_WAYLAND', 'gtk+-wayland-3.0 >= 3.10 xkbcommon >= 0.4.1',
+    'MOZ_WAYLAND', 'gtk+-wayland-3.0 >= 3.10 xkbcommon >= 0.4.1 libdrm > 2.4',
     allow_missing=depends(full_toolkit)(lambda t: t == 'cairo-gtk3'),
     when=depends(full_toolkit)(lambda t: t in ('cairo-gtk3', 'cairo-gtk3-wayland')))
 
 
 @depends(wayland_headers, toolkit_gtk, artifact_builds)
 def wayland_headers(wayland, toolkit_gtk, artifacts):
     if toolkit_gtk and artifacts:
         return True
--- a/widget/gtk/WaylandDMABufSurface.cpp
+++ b/widget/gtk/WaylandDMABufSurface.cpp
@@ -117,54 +117,49 @@ bool WaylandDMABufSurface::Create(int aW
 
   nsWaylandDisplay* display = WaylandDisplayGet();
   mGmbFormat = display->GetGbmFormat(aHasAlpha);
   if (!mGmbFormat) {
     // Requested DRM format is not supported.
     return false;
   }
 
-#ifdef HAVE_GBM_MODIFIERS
   if (nsGbmLib::IsModifierAvailable() && mGmbFormat->mModifiersCount > 0) {
     mGbmBufferObject = nsGbmLib::CreateWithModifiers(
         display->GetGbmDevice(), mWidth, mHeight, mGmbFormat->mFormat,
         mGmbFormat->mModifiers, mGmbFormat->mModifiersCount);
     if (mGbmBufferObject) {
       mBufferModifier = nsGbmLib::GetModifier(mGbmBufferObject);
     }
   }
-#endif
 
   if (!mGbmBufferObject) {
     mGbmBufferObject =
         nsGbmLib::Create(display->GetGbmDevice(), mWidth, mHeight,
                          mGmbFormat->mFormat, GBM_BO_USE_RENDERING);
   }
 
   if (!mGbmBufferObject) {
     return false;
   }
 
-#ifdef HAVE_GBM_MODIFIERS
   if (nsGbmLib::IsModifierAvailable() && display->GetGbmDeviceFd() != -1) {
     mBufferPlaneCount = nsGbmLib::GetPlaneCount(mGbmBufferObject);
     for (int i = 0; i < mBufferPlaneCount; i++) {
       uint32_t handle = nsGbmLib::GetHandleForPlane(mGbmBufferObject, i).u32;
       int ret = nsGbmLib::DrmPrimeHandleToFD(display->GetGbmDeviceFd(), handle,
                                              0, &mDmabufFds[i]);
       if (ret < 0 || mDmabufFds[i] < 0) {
         Release();
         return false;
       }
       mStrides[i] = nsGbmLib::GetStrideForPlane(mGbmBufferObject, i);
       mOffsets[i] = nsGbmLib::GetOffset(mGbmBufferObject, i);
     }
-  } else
-#endif
-  {
+  } else {
     mBufferPlaneCount = 1;
     mStrides[0] = nsGbmLib::GetStride(mGbmBufferObject);
     mDmabufFds[0] = nsGbmLib::GetFd(mGbmBufferObject);
     if (mDmabufFds[0] < 0) {
       Release();
       return false;
     }
   }
--- a/widget/gtk/nsGtkKeyUtils.cpp
+++ b/widget/gtk/nsGtkKeyUtils.cpp
@@ -8,16 +8,17 @@
 #include "mozilla/Logging.h"
 
 #include "nsGtkKeyUtils.h"
 
 #include <gdk/gdkkeysyms.h>
 #include <algorithm>
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
+#include <dlfcn.h>
 #ifdef MOZ_WIDGET_GTK
 #  include <gdk/gdkkeysyms-compat.h>
 #endif
 #include <X11/XKBlib.h>
 #include "IMContextWrapper.h"
 #include "WidgetUtils.h"
 #include "keysym2ucs.h"
 #include "nsContentUtils.h"