diff -Nru webkit2gtk-2.44.1/debian/changelog webkit2gtk-2.44.1/debian/changelog --- webkit2gtk-2.44.1/debian/changelog 2024-04-09 14:09:50.000000000 +0200 +++ webkit2gtk-2.44.1/debian/changelog 2024-05-15 11:07:44.000000000 +0200 @@ -1,3 +1,12 @@ +webkit2gtk (2.44.1-1ubuntu1) oracular; urgency=medium + + * Convert disable-dmabuf-nvidia.patch to disable-dmabuf.patch, + adding detection for Broadcom to work around corruption and crashes + occurring in Raspberry Pi X11 sessions. (LP: #2037015, LP: #2062146) + * debian/control: Change Maintainer to Ubuntu Developers. + + -- Daniel van Vugt Wed, 15 May 2024 11:07:44 +0200 + webkit2gtk (2.44.1-1) unstable; urgency=medium * New upstream release. diff -Nru webkit2gtk-2.44.1/debian/control webkit2gtk-2.44.1/debian/control --- webkit2gtk-2.44.1/debian/control 2024-04-09 14:09:50.000000000 +0200 +++ webkit2gtk-2.44.1/debian/control 2024-05-15 11:05:42.000000000 +0200 @@ -2,7 +2,7 @@ Source: webkit2gtk Priority: optional Section: web -Maintainer: Debian WebKit Maintainers +Maintainer: Ubuntu Developers Uploaders: Gustavo Noronha Silva , Emilio Pozuelo Monfort , Alberto Garcia diff -Nru webkit2gtk-2.44.1/debian/control.in webkit2gtk-2.44.1/debian/control.in --- webkit2gtk-2.44.1/debian/control.in 2024-04-09 14:09:50.000000000 +0200 +++ webkit2gtk-2.44.1/debian/control.in 2024-05-15 11:05:42.000000000 +0200 @@ -1,7 +1,7 @@ Source: webkit2gtk Priority: optional Section: web -Maintainer: Debian WebKit Maintainers +Maintainer: Ubuntu Developers Uploaders: Gustavo Noronha Silva , Emilio Pozuelo Monfort , Alberto Garcia diff -Nru webkit2gtk-2.44.1/debian/patches/disable-dmabuf-nvidia.patch webkit2gtk-2.44.1/debian/patches/disable-dmabuf-nvidia.patch --- webkit2gtk-2.44.1/debian/patches/disable-dmabuf-nvidia.patch 2024-04-09 14:09:50.000000000 +0200 +++ webkit2gtk-2.44.1/debian/patches/disable-dmabuf-nvidia.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,65 +0,0 @@ -From: Carlos Garcia Campos -Subject: Disable DMABuf renderer for NVIDIA proprietary drivers -Bug: https://bugs.webkit.org/show_bug.cgi?id=262607 -Bug-Debian: https://bugs.debian.org/1039720 -Origin: https://github.com/WebKit/WebKit/pull/18614 -Index: webkitgtk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp -=================================================================== ---- webkitgtk.orig/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp -+++ webkitgtk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp -@@ -37,6 +37,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -44,6 +45,7 @@ - #include - - #if USE(GBM) -+#include - #include - #include - -@@ -58,6 +60,29 @@ static constexpr uint64_t s_dmabufInvali - - namespace WebKit { - -+static bool isNVIDIA() -+{ -+ const char* forceDMABuf = getenv("WEBKIT_FORCE_DMABUF_RENDERER"); -+ if (forceDMABuf && strcmp(forceDMABuf, "0")) -+ return false; -+ -+ std::unique_ptr platformDisplay; -+#if USE(GBM) -+ const char* disableGBM = getenv("WEBKIT_DMABUF_RENDERER_DISABLE_GBM"); -+ if (!disableGBM || !strcmp(disableGBM, "0")) { -+ if (auto* device = WebCore::PlatformDisplay::sharedDisplay().gbmDevice()) -+ platformDisplay = WebCore::PlatformDisplayGBM::create(device); -+ } -+#endif -+ if (!platformDisplay) -+ platformDisplay = WebCore::PlatformDisplaySurfaceless::create(); -+ -+ WebCore::GLContext::ScopedGLContext glContext(WebCore::GLContext::createOffscreen(platformDisplay ? *platformDisplay : WebCore::PlatformDisplay::sharedDisplay())); -+ if (strstr(reinterpret_cast(glGetString(GL_VENDOR)), "NVIDIA")) -+ return true; -+ return false; -+} -+ - OptionSet AcceleratedBackingStoreDMABuf::rendererBufferMode() - { - static OptionSet mode; -@@ -73,6 +98,9 @@ OptionSet Acce - return; - } - -+ if (isNVIDIA()) -+ return; -+ - mode.add(DMABufRendererBufferMode::SharedMemory); - - const char* forceSHM = getenv("WEBKIT_DMABUF_RENDERER_FORCE_SHM"); diff -Nru webkit2gtk-2.44.1/debian/patches/disable-dmabuf.patch webkit2gtk-2.44.1/debian/patches/disable-dmabuf.patch --- webkit2gtk-2.44.1/debian/patches/disable-dmabuf.patch 1970-01-01 01:00:00.000000000 +0100 +++ webkit2gtk-2.44.1/debian/patches/disable-dmabuf.patch 2024-05-15 11:04:41.000000000 +0200 @@ -0,0 +1,98 @@ +From: Carlos Garcia Campos +Date: Mon, 22 Apr 2024 17:28:26 +0800 +Subject: Conditionally toggle DMABuf support for some drivers + +Origin: https://github.com/WebKit/WebKit/pull/18614 +Modified by: Daniel van Vugt + +NVIDIA - Default to WEBKIT_DISABLE_DMABUF_RENDERER=1 +Bug: https://bugs.webkit.org/show_bug.cgi?id=262607 +Bug-Debian: https://bugs.debian.org/1039720 + +Broadcom - Default to WEBKIT_DMABUF_RENDERER_FORCE_SHM=1 for X11 +Bug: https://bugs.webkit.org/show_bug.cgi?id=272827 +Bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11033 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/2037015 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/2062146 + +=================================================================== +--- + .../gtk/AcceleratedBackingStoreDMABuf.cpp | 35 +++++++++++++++++++--- + 1 file changed, 31 insertions(+), 4 deletions(-) + +diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp +index 6bd656b..26ef76d 100644 +--- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp ++++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -44,6 +45,7 @@ + #include + + #if USE(GBM) ++#include + #include + #include + +@@ -58,26 +60,51 @@ static constexpr uint64_t s_dmabufInvalidModifier = ((1ULL << 56) - 1); + + namespace WebKit { + ++static const char* getGLVendor() ++{ ++ std::unique_ptr platformDisplay; ++#if USE(GBM) ++ const char* disableGBM = getenv("WEBKIT_DMABUF_RENDERER_DISABLE_GBM"); ++ if (!disableGBM || !strcmp(disableGBM, "0")) { ++ if (auto* device = WebCore::PlatformDisplay::sharedDisplay().gbmDevice()) ++ platformDisplay = WebCore::PlatformDisplayGBM::create(device); ++ } ++#endif ++ if (!platformDisplay) ++ platformDisplay = WebCore::PlatformDisplaySurfaceless::create(); ++ ++ WebCore::GLContext::ScopedGLContext glContext(WebCore::GLContext::createOffscreen(platformDisplay ? *platformDisplay : WebCore::PlatformDisplay::sharedDisplay())); ++ return reinterpret_cast(glGetString(GL_VENDOR)); ++} ++ + OptionSet AcceleratedBackingStoreDMABuf::rendererBufferMode() + { + static OptionSet mode; + static std::once_flag onceFlag; + std::call_once(onceFlag, [] { +- const char* disableDMABuf = getenv("WEBKIT_DISABLE_DMABUF_RENDERER"); +- if (disableDMABuf && strcmp(disableDMABuf, "0")) +- return; +- + const char* platformExtensions = eglQueryString(nullptr, EGL_EXTENSIONS); + if (!WebCore::GLContext::isExtensionSupported(platformExtensions, "EGL_KHR_platform_gbm") + && !WebCore::GLContext::isExtensionSupported(platformExtensions, "EGL_MESA_platform_surfaceless")) { + return; + } + ++ auto vendor = getGLVendor(); ++ ++ const char* disableDMABuf = getenv("WEBKIT_DISABLE_DMABUF_RENDERER"); ++ if (disableDMABuf && strcmp(disableDMABuf, "0")) ++ return; ++ if (!disableDMABuf && vendor && !strcmp(vendor, "NVIDIA")) ++ return; ++ + mode.add(DMABufRendererBufferMode::SharedMemory); + + const char* forceSHM = getenv("WEBKIT_DMABUF_RENDERER_FORCE_SHM"); + if (forceSHM && strcmp(forceSHM, "0")) + return; ++ auto& display = WebCore::PlatformDisplay::sharedDisplay(); ++ if (!forceSHM && vendor && !strcmp(vendor, "Broadcom") && ++ display.type() == WebCore::PlatformDisplay::Type::X11) ++ return; + + const auto& eglExtensions = WebCore::PlatformDisplay::sharedDisplay().eglExtensions(); + if (eglExtensions.KHR_image_base && eglExtensions.EXT_image_dma_buf_import) diff -Nru webkit2gtk-2.44.1/debian/patches/series webkit2gtk-2.44.1/debian/patches/series --- webkit2gtk-2.44.1/debian/patches/series 2024-04-09 14:09:50.000000000 +0200 +++ webkit2gtk-2.44.1/debian/patches/series 2024-05-15 11:05:30.000000000 +0200 @@ -4,5 +4,5 @@ dont-detect-sse2.patch reduce-memory-overheads.patch fix-ftbfs-hurd.patch -disable-dmabuf-nvidia.patch +disable-dmabuf.patch fix-ftbfs-riscv64.patch