Files
marfrit-packages/arch/chromium-fourier/patches/wayland-allow-direct-egl-gles2.patch
T
marfrit 8756ce38be
build and publish packages / distcc-avahi-aarch64 (push) Successful in 46s
build and publish packages / lmcp-any (push) Successful in 9s
build and publish packages / lmcp-debian (push) Successful in 4s
build and publish packages / claude-his-any (push) Successful in 7s
build and publish packages / ffmpeg-v4l2-request-aarch64 (push) Successful in 12m8s
build and publish packages / claude-his-debian (push) Successful in 5s
chromium-fourier r2 + firefox-fourier 150.0.1 + KWIN_PIVOT.md
chromium-fourier:
- patch 3/3 nv12-external-oes-on-modifier-external-only.patch — adds
  NativePixmapEGLBinding::ModifierRequiresExternalOES helper, extends
  OzoneImageGLTexturesHolder::GetBinding to honor EGL external_only
  flag for NV12 dmabufs on panfrost / panthor. Validated on ohm
  (RK3566 hantro mainline 6.19.10): bbb_1080p30_h264.mp4 plays at
  34.7 % combined CPU vs ~131 % pre-patch baseline (~3.8x).
- PKGBUILD pkgrel 1->2, source array + sha256sums + prepare() hook for
  patch 4, patch numbering 1/2,2/2 -> 1/3,2/3,3/3.
- NEXT.md appended with 2026-04-28 section: patch 4 design, validation
  log, KWin GL_ALPHA bug pinpoint (preexisting since 2026-03-06,
  affects every wayland video client; unrelated to chromium-fourier),
  device-renumbering note (/dev/video1 = encoder post-reboot).
- KWIN_PIVOT.md: 4-phase plan to identify and patch KWin's
  glTexImage2D(internalFormat=GL_ALPHA) site, ohm-only test plan,
  scope discipline.
- patches/ now tracked (compiler-rt-adjust-paths, enable-v4l2,
  wayland-allow-direct-egl-gles2, nv12-external-oes); the dead-end
  chromeos-pipeline-bypass.patch removed.

firefox-fourier:
- 4 patches (gfxinfo v4l2 stateless fourccs, libwrapper hwdevice ctx,
  ffmpegvideo v4l2-request route, prefs v4l2-request default).
- PKGBUILD bumped to firefox 150.0.1, Arch toolchain glue patches
  layered in, mozconfig with --without-wasm-sandboxed-libraries for
  ALARM, package() launcher fix (rm -f symlink before cat > to avoid
  ENOENT through the dangling /usr/local symlink mach install drops).
- 150.0.1-1-aarch64.pkg.tar.zst built on boltzmann (95 MB), pending
  fresnel power-on for V4L2 stateless validation on RK3399.
2026-04-28 12:02:18 +00:00

58 lines
2.7 KiB
Diff

From: Markus Fritsche <mfritsche@reauktion.de>
Subject: ozone/wayland: re-allow direct EGL/GLES2 path (no ANGLE shim)
Date: 2026-04-26
Background
----------
On Wayland-only ozone builds the surface factory currently advertises only
ANGLE-mediated GL implementations (`kOpenGL`, `kOpenGLES`, `kSwiftShader`,
`kVulkan`). Anything driving `--use-gl=egl` (the historical
`kGLImplementationEGLGLES2`) is rejected at startup with
Requested GL implementation (gl=egl-gles2,angle=none) not found in
allowed implementations: [(gl=egl-angle,angle=opengl|opengles|...)]
The downstream switch already handles `kGLImplementationEGLGLES2` in
`GetGLOzone`, so the dispatcher is wired -- it's the *advertisement* that
got tightened.
The cost of that tightening on RK3566 hantro / panfrost is real: with
ANGLE in the path, chrome's display-side EGL is ANGLE's own EGL. ANGLE's
GLES backend on Linux does not propagate
`EGL_EXT_image_dma_buf_import` through to the chrome GL display, so
`gpu_feature_info.supports_nv12_gl_native_pixmap` ends up false. That in
turn forces the V4L2-decoded NV12 frames through the
NV12-to-AR24 VPP conversion path before they hit the compositor, costing
~85 % CPU at 1080p30 even though the hantro VPU is doing the actual
decode for free.
Allowing the direct EGL/GLES2 path back means chrome's EGL is panfrost's
EGL (via mesa), which exposes the dmabuf-import extensions natively, and
the zero-copy NV12 native pixmap path lights up.
Fix
---
Add `kGLImplementationEGLGLES2` to the head of the allowed list; ANGLE
remains the default fallback and is still selected when the user passes
`--use-gl=angle ...`. The position is deliberate: on a USE_V4L2_CODEC
hardware-decode build the user almost always wants the dmabuf-capable
direct path; ANGLE is still there for browsers that need its conformance
fixups.
This does not affect non-Wayland ozone backends.
diff --git a/ui/ozone/platform/wayland/gpu/wayland_surface_factory.cc b/ui/ozone/platform/wayland/gpu/wayland_surface_factory.cc
--- a/ui/ozone/platform/wayland/gpu/wayland_surface_factory.cc
+++ b/ui/ozone/platform/wayland/gpu/wayland_surface_factory.cc
@@ -223,6 +223,10 @@ std::vector<gl::GLImplementationParts>
WaylandSurfaceFactory::GetAllowedGLImplementations() {
std::vector<gl::GLImplementationParts> impls;
if (egl_implementation_) {
+ // chromium-fourier: keep the direct EGL/GLES2 path available so
+ // panfrost's EGL_EXT_image_dma_buf_import surfaces to chrome's GL
+ // display layer. See patch header for rationale.
+ impls.emplace_back(gl::GLImplementationParts(gl::kGLImplementationEGLGLES2));
impls.emplace_back(gl::ANGLEImplementation::kOpenGL);
impls.emplace_back(gl::ANGLEImplementation::kOpenGLES);
impls.emplace_back(gl::ANGLEImplementation::kSwiftShader);