Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8f0a69f19a28c47e66872db4e623b0bc9afbc39d
      
https://github.com/WebKit/WebKit/commit/8f0a69f19a28c47e66872db4e623b0bc9afbc39d
  Author: Fujii Hironori <[email protected]>
  Date:   2026-10-07 (Wed, 07 Oct 2026)

  Changed paths:
    M Source/WebKit/UIProcess/XR/openxr/OpenXRGraphicsBindingOpenGLES.cpp

  Log Message:
  -----------
  [GLib][WebXR] Prefer the GBM display on the DRM main device over the 
surfaceless display for OpenXR
https://bugs.webkit.org/show_bug.cgi?id=326256

Reviewed by Carlos Garcia Campos.

OpenXRGraphicsBindingOpenGLES::initializeDisplay() used the surfaceless Mesa 
display first, as
long as it supports EGL_MESA_image_dma_buf_export. With libglvnd, that display 
comes from the
first vendor that accepts it, which can be a different GPU than the one used by 
the rest of
WebKit on multi-GPU systems. In that case the web process and the OpenXR 
runtime use the other
GPU, so the OpenXR swapchain images can't be imported and nothing is rendered.

Create the GBM display on the DRM main device first, and fall back to the 
surfaceless display
only when the GBM display can't be created, e.g. when the DRM main device is 
unknown. Reset
m_gbmDevice when the GBM display creation fails, so that a fallback to the 
surfaceless display
doesn't leave a GBM device behind that is not backing the EGL display. Testing 
keeps using the
surfaceless display only, because it doesn't depend on the DRM main device of 
the machine.

The GBM display can now support EGL_MESA_image_dma_buf_export as well. In that 
case
exportTexture2D() prefers the DMA-BUF export, which exports the swapchain image 
directly and
doesn't create a separate texture in m_exportedTexturesMap. Therefore, 
m_gbmDevice being set no
longer implies that there is an exported texture to blit from, and 
blitTextureIfNeeded() must
also skip the blit when the display supports EGL_MESA_image_dma_buf_export. 
Otherwise, it
asserts on !exportedTexture, and blits from texture 0 in release builds.

* Source/WebKit/UIProcess/XR/openxr/OpenXRGraphicsBindingOpenGLES.cpp:
(WebKit::OpenXRGraphicsBindingOpenGLES::initializeDisplay): Try the GBM display 
before the
surfaceless display.
(WebKit::OpenXRGraphicsBindingOpenGLES::blitTextureIfNeeded): Skip the blit 
when the display
supports EGL_MESA_image_dma_buf_export.

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



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

Reply via email to