Title: [290118] trunk/Source
Revision
290118
Author
commit-qu...@webkit.org
Date
2022-02-18 00:48:24 -0800 (Fri, 18 Feb 2022)

Log Message

[GTK][WPE] Don't use ANGLE's GBM-based display
https://bugs.webkit.org/show_bug.cgi?id=236772

Patch by Zan Dobersek <zdober...@igalia.com> on 2022-02-18
Reviewed by Alejandro G. Castro.

Source/ThirdParty/ANGLE:

With DisplayGbm functionality not necessary anymore, we can stop
building the associated code and linking against libgbm and libdrm at
the ANGLE level. These two libraries are still dependencies that have
since become necessary in WebCore.

* CMakeLists.txt:
* PlatformGTK.cmake:
* PlatformWPE.cmake:

Source/WebCore:

ANGLE's DisplayGbm implementation adds unnecessary overhead for how we
would want to use ANGLE. We don't need a connection to the DRM display
device or the ability for the display to provide pre-allocated buffer
objects that are then displayed on that device. Instead we have to
control our own GBM buffers and have options in terms of how we want
those buffers to be handled and presented.

We can live with the DisplayEGL implementation instead. To be able to
utilize it, we have to switch to using the EGL_GetPlatformDisplayEXT
entrypoint, along with a display attribute list that selects the
OpenGLES as the display's GL target (matching what we've used with
DisplayGBM so far) and EGL as the device type. Additionally, we
specify surfaceless as the native platform type, even when right now
this doesn't seem to have any effect.

* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp:
(Nicosia::GCGLANGLELayer::ANGLEContext::createContext):

Modified Paths

Diff

Modified: trunk/Source/ThirdParty/ANGLE/CMakeLists.txt (290117 => 290118)


--- trunk/Source/ThirdParty/ANGLE/CMakeLists.txt	2022-02-18 08:16:54 UTC (rev 290117)
+++ trunk/Source/ThirdParty/ANGLE/CMakeLists.txt	2022-02-18 08:48:24 UTC (rev 290118)
@@ -9,7 +9,6 @@
     set(angle_is_winuwp FALSE)
 elseif (UNIX)
     set(is_linux TRUE)
-    set(ozone_platform_gbm TRUE)
 endif ()
 
 include(Compiler.cmake)

Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (290117 => 290118)


--- trunk/Source/ThirdParty/ANGLE/ChangeLog	2022-02-18 08:16:54 UTC (rev 290117)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog	2022-02-18 08:48:24 UTC (rev 290118)
@@ -1,3 +1,19 @@
+2022-02-18  Zan Dobersek  <zdober...@igalia.com>
+
+        [GTK][WPE] Don't use ANGLE's GBM-based display
+        https://bugs.webkit.org/show_bug.cgi?id=236772
+
+        Reviewed by Alejandro G. Castro.
+
+        With DisplayGbm functionality not necessary anymore, we can stop
+        building the associated code and linking against libgbm and libdrm at
+        the ANGLE level. These two libraries are still dependencies that have
+        since become necessary in WebCore.
+
+        * CMakeLists.txt:
+        * PlatformGTK.cmake:
+        * PlatformWPE.cmake:
+
 2022-02-18  Saam Barati  <sbar...@apple.com>
 
         Add LC_SOURCE_VERSION to compile targets

Modified: trunk/Source/ThirdParty/ANGLE/PlatformGTK.cmake (290117 => 290118)


--- trunk/Source/ThirdParty/ANGLE/PlatformGTK.cmake	2022-02-18 08:16:54 UTC (rev 290117)
+++ trunk/Source/ThirdParty/ANGLE/PlatformGTK.cmake	2022-02-18 08:48:24 UTC (rev 290118)
@@ -25,21 +25,10 @@
 
     list(APPEND ANGLE_DEFINITIONS
         ANGLE_ENABLE_OPENGL
-        ANGLE_USE_GBM
     )
 
-    find_package(LibDRM REQUIRED)
-    find_package(GBM REQUIRED)
-
-    list(APPEND ANGLE_PRIVATE_INCLUDE_DIRECTORIES
-        ${LIBDRM_INCLUDE_DIR}
-        ${GBM_INCLUDE_DIR}
-    )
-
     list(APPEND ANGLEGLESv2_LIBRARIES
         ${CMAKE_DL_LIBS}
-        ${LIBDRM_LIBRARIES}
-        ${GBM_LIBRARIES}
         Threads::Threads
     )
 

Modified: trunk/Source/ThirdParty/ANGLE/PlatformWPE.cmake (290117 => 290118)


--- trunk/Source/ThirdParty/ANGLE/PlatformWPE.cmake	2022-02-18 08:16:54 UTC (rev 290117)
+++ trunk/Source/ThirdParty/ANGLE/PlatformWPE.cmake	2022-02-18 08:48:24 UTC (rev 290118)
@@ -25,22 +25,11 @@
 
     list(APPEND ANGLE_DEFINITIONS
         ANGLE_ENABLE_OPENGL
-        ANGLE_USE_GBM
         USE_SYSTEM_EGL
     )
 
-    find_package(LibDRM REQUIRED)
-    find_package(GBM REQUIRED)
-
-    list(APPEND ANGLE_PRIVATE_INCLUDE_DIRECTORIES
-        ${LIBDRM_INCLUDE_DIR}
-        {GBM_INCLUDE_DIR}
-    )
-
     list(APPEND ANGLEGLESv2_LIBRARIES
         ${CMAKE_DL_LIBS}
-        ${LIBDRM_LIBRARIES}
-        ${GBM_LIBRARIES}
         Threads::Threads
     )
 

Modified: trunk/Source/WebCore/ChangeLog (290117 => 290118)


--- trunk/Source/WebCore/ChangeLog	2022-02-18 08:16:54 UTC (rev 290117)
+++ trunk/Source/WebCore/ChangeLog	2022-02-18 08:48:24 UTC (rev 290118)
@@ -1,3 +1,28 @@
+2022-02-18  Zan Dobersek  <zdober...@igalia.com>
+
+        [GTK][WPE] Don't use ANGLE's GBM-based display
+        https://bugs.webkit.org/show_bug.cgi?id=236772
+
+        Reviewed by Alejandro G. Castro.
+
+        ANGLE's DisplayGbm implementation adds unnecessary overhead for how we
+        would want to use ANGLE. We don't need a connection to the DRM display
+        device or the ability for the display to provide pre-allocated buffer
+        objects that are then displayed on that device. Instead we have to
+        control our own GBM buffers and have options in terms of how we want
+        those buffers to be handled and presented.
+
+        We can live with the DisplayEGL implementation instead. To be able to
+        utilize it, we have to switch to using the EGL_GetPlatformDisplayEXT
+        entrypoint, along with a display attribute list that selects the
+        OpenGLES as the display's GL target (matching what we've used with
+        DisplayGBM so far) and EGL as the device type. Additionally, we
+        specify surfaceless as the native platform type, even when right now
+        this doesn't seem to have any effect.
+
+        * platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp:
+        (Nicosia::GCGLANGLELayer::ANGLEContext::createContext):
+
 2022-02-18  Saam Barati  <sbar...@apple.com>
 
         Add LC_SOURCE_VERSION to compile targets

Modified: trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp (290117 => 290118)


--- trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp	2022-02-18 08:16:54 UTC (rev 290117)
+++ trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp	2022-02-18 08:48:24 UTC (rev 290118)
@@ -123,7 +123,13 @@
 
 std::unique_ptr<GCGLANGLELayer::ANGLEContext> GCGLANGLELayer::ANGLEContext::createContext(bool isForWebGL2)
 {
-    EGLDisplay display = EGL_GetDisplay(EGL_DEFAULT_DISPLAY);
+    Vector<EGLint> displayAttributes {
+        EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE,
+        EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE,
+        EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE, EGL_PLATFORM_SURFACELESS_MESA,
+        EGL_NONE,
+    };
+    EGLDisplay display = EGL_GetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, displayAttributes.data());
     if (display == EGL_NO_DISPLAY)
         return nullptr;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to