From 7c09d4b7afaf58716494028ddded1dde8e49bcb6 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 7 Jun 2019 21:45:46 +0000 Subject: [PATCH] Bug 1557658 - [Wayland] Don't use developers version of libdrm.so and libgbm.so, r=jhorak Differential Revision: https://phabricator.services.mozilla.com/D34146 --HG-- extra : moz-landing-system : lando --- widget/gtk/nsWaylandDisplay.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp index cfe51c6ab09b..71263f5ec8f3 100644 --- a/widget/gtk/nsWaylandDisplay.cpp +++ b/widget/gtk/nsWaylandDisplay.cpp @@ -10,6 +10,9 @@ namespace mozilla { namespace widget { +#define GBMLIB_NAME "libgbm.so.1" +#define DRMLIB_NAME "libdrm.so.2" + // nsWaylandDisplay needs to be created for each calling thread(main thread, // compositor thread and render thread) #define MAX_DISPLAY_CONNECTIONS 3 @@ -366,8 +369,11 @@ bool nsGbmLib::Load() { if (!sGbmLibHandle && !sLibLoaded) { sLibLoaded = true; - sGbmLibHandle = dlopen("libgbm.so", RTLD_LAZY | RTLD_LOCAL); + sGbmLibHandle = dlopen(GBMLIB_NAME, RTLD_LAZY | RTLD_LOCAL); if (!sGbmLibHandle) { + NS_WARNING(nsPrintfCString("Failed to load %s, dmabuf isn't available.\n", + GBMLIB_NAME) + .get()); return false; } @@ -389,10 +395,16 @@ bool nsGbmLib::Load() { sGbmLibHandle, "gbm_bo_get_stride_for_plane"); sGetOffset = (GetOffsetFunc)dlsym(sGbmLibHandle, "gbm_bo_get_offset"); - sXf86DrmLibHandle = dlopen("libdrm.so", RTLD_LAZY | RTLD_LOCAL); + sXf86DrmLibHandle = dlopen(DRMLIB_NAME, RTLD_LAZY | RTLD_LOCAL); if (sXf86DrmLibHandle) { sDrmPrimeHandleToFD = (DrmPrimeHandleToFDFunc)dlsym(sXf86DrmLibHandle, "drmPrimeHandleToFD"); + if (!sDrmPrimeHandleToFD) { + NS_WARNING(nsPrintfCString( + "Failed to load %s, gbm modifiers are not available.\n", + DRMLIB_NAME) + .get()); + } } }