Issue 8331 in angleproject: Support EGL_MESA_platform_surfaceless

60 views
Skip to first unread message

phanq… via monorail

unread,
Aug 29, 2023, 11:14:27 AM8/29/23
to angleproj...@googlegroups.com
Status: Started
Owner: phanq...@gmail.com
Components: API>EGL
OS: Chrome Linux
Priority: Low
Renderer: GLES Vulkan DesktopGL SwiftShader
Type: Enhancement

New issue 8331 by phanq...@gmail.com: Support EGL_MESA_platform_surfaceless
https://bugs.chromium.org/p/angleproject/issues/detail?id=8331

Currently ANGLE's EGL implementation does not support requesting a surfaceless display directly. This means that:
1. ChromeOS has to resort to setting the `EGL_PLATFORM=surfaceless` environment variable in `login_manager` before starting chrome.
2. Linux's Ozone/Wayland and Ozone/Headless backends has no way to request an actual surfaceless display, which results in them trying to connect to an X server (which will fail if sandboxed) even when X is not used by the backend.

Ideally, we want any users who don't need to or don't want to connect to a integrate with a windowing system to be able to simply use the EGL_PLATFORM_SURFACELESS_MESA platform type (specified in EGL_MESA_platform_surfaceless). This will simplify EGL display acquisition on Ozone/Wayland and Ozone/Headless by removing the hack of setting `EGL_PLATFORM=wayland`[1] on Ozone/Wayland or having to hope that using `EGL_DEFAULT_DISPLAY` will allow obtaining a display without an X server running on Ozone/Headless. This also makes it possible to start working on restoring GPU sandbox support on Ozone/Wayland and Ozone/Headless where it would otherwise break due to trying to connect to an X server.

[1]: https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/wayland/gpu/wayland_surface_factory.cc;l=177;drc=c5d53fee6b737b66a323912f318c2edea70938c9

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

phanq… via monorail

unread,
Aug 29, 2023, 11:15:14 AM8/29/23
to angleproj...@googlegroups.com

Comment #1 on issue 8331 by phanq...@gmail.com: Support EGL_MESA_platform_surfaceless
https://bugs.chromium.org/p/angleproject/issues/detail?id=8331#c1


Currently ANGLE's EGL implementation does not support requesting a surfaceless display directly. This means that:
1. ChromeOS has to resort to setting the `EGL_PLATFORM=surfaceless` environment variable in `login_manager` before starting chrome.
2. Linux's Ozone/Wayland and Ozone/Headless backends has no way to request an actual surfaceless display, which results in them trying to connect to an X server (which will fail if sandboxed) even when X is not used by the backend.

Ideally, we want any users who don't need to or don't want to integrate with a windowing system to be able to simply use the EGL_PLATFORM_SURFACELESS_MESA platform type (specified in EGL_MESA_platform_surfaceless). This will simplify EGL display acquisition on Ozone/Wayland and Ozone/Headless by removing the hack of setting `EGL_PLATFORM=wayland`[1] on Ozone/Wayland or having to hope that using `EGL_DEFAULT_DISPLAY` will allow obtaining a display without an X server running on Ozone/Headless. This also makes it possible to start working on restoring GPU sandbox support on Ozone/Wayland and Ozone/Headless where it would otherwise break due to trying to connect to an X server.

Git Watcher via monorail

unread,
Aug 30, 2023, 9:44:13 AM8/30/23
to angleproj...@googlegroups.com

Comment #2 on issue 8331 by Git Watcher: Support EGL_MESA_platform_surfaceless
https://bugs.chromium.org/p/angleproject/issues/detail?id=8331#c2

The following revision refers to this bug:
https://chromium.googlesource.com/angle/angle/+/c8fe53ab0a535f609e6b22626cf8a30c8f000c0a

commit c8fe53ab0a535f609e6b22626cf8a30c8f000c0a
Author: Phan Quang Minh <phanquan...@gmail.com>
Date: Wed Aug 09 04:25:38 2023

egl: Fix device fallback if native display eglInitialize fails

Mesa's EGL implementation may return an EGLDisplay that fails to
initialize (e.g. an X11-backed EGLDisplay for `EGL_DEFAULT_DISPLAY` that
fails to eglInitialize if the X server is inaccessible). Handle this
case properly to ensure that ANGLE will properly fall back to using EGL
devices.

Bug: angleproject:8331
Change-Id: I629e95fc22f5618d10be082a3897857bcc79f890
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4749335
Reviewed-by: Shahbaz Youssefi <syou...@chromium.org>
Reviewed-by: Geoff Lang <geof...@chromium.org>
Commit-Queue: Shahbaz Youssefi <syou...@chromium.org>

[modify] https://crrev.com/c8fe53ab0a535f609e6b22626cf8a30c8f000c0a/src/libANGLE/renderer/gl/egl/FunctionsEGL.cpp

Git Watcher via monorail

unread,
Aug 30, 2023, 11:47:08 AM8/30/23
to angleproj...@googlegroups.com

Comment #3 on issue 8331 by Git Watcher: Support EGL_MESA_platform_surfaceless
https://bugs.chromium.org/p/angleproject/issues/detail?id=8331#c3


The following revision refers to this bug:

Author: Phan Quang Minh <phanquan...@gmail.com>
Date: Wed Aug 09 04:25:38 2023

Add support for EGL_MESA_platfrom_surfaceless extension

This adds support for the EGL_PLATFORM_SURFACELESS_MESA platform type to
allow applications to obtain an EGLDisplay that's independent of any
native windowing systems. This will be used in Ozone/Wayland to create
surfaceless EGLDisplays.

Bug: angleproject:8331
Change-Id: If2ae7a811cfa63ab9f49d54d78f5a3782c8c2fed
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4749337

Reviewed-by: Geoff Lang <geof...@chromium.org>
Commit-Queue: Shahbaz Youssefi <syou...@chromium.org>

phanq… via monorail

unread,
Aug 31, 2023, 8:44:47 AM8/31/23
to angleproj...@googlegroups.com
Updates:
Status: Fixed

Comment #4 on issue 8331 by phanq...@gmail.com: Support EGL_MESA_platform_surfaceless
https://bugs.chromium.org/p/angleproject/issues/detail?id=8331#c4

(No comment was entered for this change.)
Reply all
Reply to author
Forward
0 new messages