Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6887c89d076270e7818d5494cae06f37b48dea71
      
https://github.com/WebKit/WebKit/commit/6887c89d076270e7818d5494cae06f37b48dea71
  Author: Nikolas Zimmermann <[email protected]>
  Date:   2026-04-22 (Wed, 22 Apr 2026)

  Changed paths:
    M Source/WebCore/PlatformGTK.cmake
    M Source/WebCore/PlatformWPE.cmake
    M Source/WebCore/platform/graphics/gbm/DMABufBuffer.cpp
    A Source/WebCore/platform/graphics/gbm/GBMUtilities.h
    M Source/WebCore/platform/graphics/gbm/GBMVersioning.h
    M Source/WebCore/platform/graphics/gbm/MemoryMappedGPUBuffer.cpp
    M Source/WebCore/platform/graphics/gbm/MemoryMappedGPUBuffer.h
    M Source/WebCore/platform/graphics/skia/SkiaPaintingEngine.cpp
    M Source/WebKit/Shared/glib/RenderProcessInfo.h
    M Source/WebKit/Shared/glib/RenderProcessInfo.serialization.in
    M Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp
    M Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp
    M Source/cmake/OptionsGTK.cmake
    M Source/cmake/OptionsWPE.cmake

  Log Message:
  -----------
  [GTK][WPE] Probe dma-buf+mmap capability before enabling 
MemoryMappedGPUBuffer path
https://bugs.webkit.org/show_bug.cgi?id=312782

Reviewed by Carlos Garcia Campos.

On some non-Mesa GBM stacks or older Mesa < 25.02, gbm_bo allocation and
dma-buf export succeed but mmap(PROT_WRITE) on the exported FD silently
returns an O_RDONLY mapping that SIGBUSes at first store. Run a one-shot
probe at session start -- in the Web process, where DRMDeviceManager is
initialized -- to pick between gbm_bo_get_fd_for_plane() and the manual
drmPrimeHandleToFD(DRM_RDWR) path, or disable the MemoryMappedGPUBuffer
code path entirely if neither yields a writable mapping.

Plumb the probe outcome through RenderProcessInfo so the webkit://gpu
diagnostic page can expose both the chosen export strategy and whether
memory-mapped GPU buffers are supported, in the "Render Process" section.
Emit the probe result via RELEASE_LOG on the GraphicsBuffer channel so
the decision is visible in release builds journal as well, when
WEBKIT_DEBUG=GraphicsBuffer is enabled.

Not testable in the CI.

* Source/WebCore/PlatformGTK.cmake:
* Source/WebCore/PlatformWPE.cmake:
* Source/WebCore/platform/graphics/gbm/DMABufBuffer.cpp:
(WebCore::DMABufBufferAttributes::fromGBMBufferObject):
* Source/WebCore/platform/graphics/gbm/GBMUtilities.h: Copied from 
Source/WebCore/platform/graphics/gbm/GBMVersioning.h.
(gbmExportPlaneFDWithExplicitReadWriteMapping):
* Source/WebCore/platform/graphics/gbm/GBMVersioning.h:
(gbm_bo_get_fd_for_plane):
* Source/WebCore/platform/graphics/gbm/MemoryMappedGPUBuffer.cpp:
(WebCore::strategyName):
(WebCore::probeReadWriteMappability):
(WebCore::runCapabilityProbe):
(WebCore::cachedExportCapabilities):
(WebCore::MemoryMappedGPUBuffer::isSupported):
(WebCore::MemoryMappedGPUBuffer::exportFDForPlane):
(WebCore::MemoryMappedGPUBuffer::exportStrategyDescription):
(WebCore::MemoryMappedGPUBuffer::create):
(WebCore::MemoryMappedGPUBuffer::createEGLImageFromDMABuf):
(WebCore::MemoryMappedGPUBuffer::performDMABufSyncSystemCall):
* Source/WebCore/platform/graphics/gbm/MemoryMappedGPUBuffer.h:
* Source/WebCore/platform/graphics/skia/SkiaPaintingEngine.cpp:
(WebCore::SkiaPaintingEngine::shouldUseDMABufAtlasTextures):
* Source/WebKit/Shared/glib/RenderProcessInfo.h:
* Source/WebKit/Shared/glib/RenderProcessInfo.serialization.in:
* Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp:
(WebKit::WebKitProtocolHandler::handleGPU):
* Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp:
(WebKit::WebPage::getRenderProcessInfo):
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Canonical link: https://commits.webkit.org/311802@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to