summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/moz-patch-stack/0086.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /third_party/libwebrtc/moz-patch-stack/0086.patch
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/moz-patch-stack/0086.patch')
-rw-r--r--third_party/libwebrtc/moz-patch-stack/0086.patch77
1 files changed, 77 insertions, 0 deletions
diff --git a/third_party/libwebrtc/moz-patch-stack/0086.patch b/third_party/libwebrtc/moz-patch-stack/0086.patch
new file mode 100644
index 0000000000..b43f8bb151
--- /dev/null
+++ b/third_party/libwebrtc/moz-patch-stack/0086.patch
@@ -0,0 +1,77 @@
+From: Jan Grulich <jgrulich@redhat.com>
+Date: Fri, 10 Mar 2023 09:21:00 +0000
+Subject: Bug 1819035 - get EGL display based on the used platform in the
+ browser r=webrtc-reviewers,ng
+
+Because of a possible misconfiguration or a possible driver issue it
+might happen that the browser will use a different driver on X11 and
+end up using yet another one for wayland/gbm, which might lead to not
+working screen sharing in the better case, but also to a crash in the
+other driver (Nvidia). This adds a check for platform the browser runs
+on, if it's XWayland or Wayland and based on that query EGL display for
+that specific platform, rather than going for the Wayland one only.
+
+Differential Revision: https://phabricator.services.mozilla.com/D171858
+Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/c8606497de1f461a6352456e0e511c2ae498d526
+---
+ .../linux/wayland/egl_dmabuf.cc | 30 +++++++++++++++++--
+ 1 file changed, 28 insertions(+), 2 deletions(-)
+
+diff --git a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc
+index 5bbd5d7aba..80da597e29 100644
+--- a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc
++++ b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc
+@@ -13,6 +13,7 @@
+ #include <asm/ioctl.h>
+ #include <dlfcn.h>
+ #include <fcntl.h>
++#include <gdk/gdk.h>
+ #include <libdrm/drm_fourcc.h>
+ #include <linux/types.h>
+ #include <spa/param/video/format-utils.h>
+@@ -200,6 +201,26 @@ static void CloseLibrary(void* library) {
+ }
+ }
+
++static bool IsWaylandDisplay() {
++ static auto sGdkWaylandDisplayGetType =
++ (GType (*)(void))dlsym(RTLD_DEFAULT, "gdk_wayland_display_get_type");
++ if (!sGdkWaylandDisplayGetType) {
++ return false;
++ }
++ return (G_TYPE_CHECK_INSTANCE_TYPE ((gdk_display_get_default()),
++ sGdkWaylandDisplayGetType()));
++}
++
++static bool IsX11Display() {
++ static auto sGdkX11DisplayGetType =
++ (GType (*)(void))dlsym(RTLD_DEFAULT, "gdk_x11_display_get_type");
++ if (!sGdkX11DisplayGetType) {
++ return false;
++ }
++ return (G_TYPE_CHECK_INSTANCE_TYPE ((gdk_display_get_default()),
++ sGdkX11DisplayGetType()));
++}
++
+ static void* g_lib_egl = nullptr;
+
+ RTC_NO_SANITIZE("cfi-icall")
+@@ -331,8 +352,13 @@ EglDmaBuf::EglDmaBuf() {
+ return;
+ }
+
+- egl_.display = EglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR,
+- (void*)EGL_DEFAULT_DISPLAY, nullptr);
++ if (IsWaylandDisplay()) {
++ egl_.display = EglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR,
++ (void*)EGL_DEFAULT_DISPLAY, nullptr);
++ } else if (IsX11Display()) {
++ egl_.display = EglGetPlatformDisplay(EGL_PLATFORM_X11_KHR,
++ (void*)EGL_DEFAULT_DISPLAY, nullptr);
++ }
+
+ if (egl_.display == EGL_NO_DISPLAY) {
+ RTC_LOG(LS_ERROR) << "Failed to obtain default EGL display: "
+--
+2.34.1
+