Title: [290987] trunk/Source/ThirdParty/ANGLE
Revision
290987
Author
[email protected]
Date
2022-03-08 05:42:11 -0800 (Tue, 08 Mar 2022)

Log Message

ANGLE display cache does not work with explicit device ids
https://bugs.webkit.org/show_bug.cgi?id=237522

Patch by Kimmo Kinnunen <[email protected]> on 2022-03-08
Reviewed by Kenneth Russell.
Add EGL_PLATFORM_ANGLE_DEVICE_ID_HIGH_ANGLE, EGL_PLATFORM_ANGLE_DEVICE_ID_LOW_ANGLE
to the display cache key, so that a request for a display with an explicit device does
not get resolved with a display without explicit device or with a display with another
explicit device.

WebKit tests will be added once this will be used.
ANGLE tests will be added once upstreamed.

* src/libANGLE/Display.cpp:
(egl::Display::GetDisplayFromNativeDisplay):
(egl::Display::~Display):

Modified Paths

Diff

Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (290986 => 290987)


--- trunk/Source/ThirdParty/ANGLE/ChangeLog	2022-03-08 13:31:32 UTC (rev 290986)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog	2022-03-08 13:42:11 UTC (rev 290987)
@@ -1,3 +1,21 @@
+2022-03-08  Kimmo Kinnunen  <[email protected]>
+
+        ANGLE display cache does not work with explicit device ids
+        https://bugs.webkit.org/show_bug.cgi?id=237522
+
+        Reviewed by Kenneth Russell.
+        Add EGL_PLATFORM_ANGLE_DEVICE_ID_HIGH_ANGLE, EGL_PLATFORM_ANGLE_DEVICE_ID_LOW_ANGLE
+        to the display cache key, so that a request for a display with an explicit device does
+        not get resolved with a display without explicit device or with a display with another
+        explicit device.
+
+        WebKit tests will be added once this will be used.
+        ANGLE tests will be added once upstreamed.
+
+        * src/libANGLE/Display.cpp:
+        (egl::Display::GetDisplayFromNativeDisplay):
+        (egl::Display::~Display):
+
 2022-03-02  Michael Saboff  <[email protected]>
 
         Copy WebKit frameworks and XPC processes to Secondary Path

Modified: trunk/Source/ThirdParty/ANGLE/src/libANGLE/Display.cpp (290986 => 290987)


--- trunk/Source/ThirdParty/ANGLE/src/libANGLE/Display.cpp	2022-03-08 13:31:32 UTC (rev 290986)
+++ trunk/Source/ThirdParty/ANGLE/src/libANGLE/Display.cpp	2022-03-08 13:42:11 UTC (rev 290987)
@@ -104,24 +104,28 @@
     ANGLEPlatformDisplay() = default;
 
     ANGLEPlatformDisplay(EGLNativeDisplayType nativeDisplayType)
-        : nativeDisplayType(nativeDisplayType),
-          powerPreference(EGL_LOW_POWER_ANGLE),
-          platformANGLEType(EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE)
+        : nativeDisplayType(nativeDisplayType)
     {}
 
     ANGLEPlatformDisplay(EGLNativeDisplayType nativeDisplayType,
                          EGLAttrib powerPreference,
-                         EGLAttrib platformANGLEType)
+                         EGLAttrib platformANGLEType,
+                         EGLAttrib deviceIdHigh,
+                         EGLAttrib deviceIdLow)
         : nativeDisplayType(nativeDisplayType),
           powerPreference(powerPreference),
-          platformANGLEType(platformANGLEType)
+          platformANGLEType(platformANGLEType),
+          deviceIdHigh(deviceIdHigh),
+          deviceIdLow(deviceIdLow)
     {}
 
-    auto tie() const { return std::tie(nativeDisplayType, powerPreference, platformANGLEType); }
+    auto tie() const { return std::tie(nativeDisplayType, powerPreference, platformANGLEType, deviceIdHigh, deviceIdLow); }
 
-    EGLNativeDisplayType nativeDisplayType;
-    EGLAttrib powerPreference;
-    EGLAttrib platformANGLEType;
+    EGLNativeDisplayType nativeDisplayType { EGL_DEFAULT_DISPLAY };
+    EGLAttrib powerPreference { EGL_LOW_POWER_ANGLE };
+    EGLAttrib platformANGLEType { EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE };
+    EGLAttrib deviceIdHigh { 0 };
+    EGLAttrib deviceIdLow { 0 };
 };
 
 inline bool operator<(const ANGLEPlatformDisplay &a, const ANGLEPlatformDisplay &b)
@@ -686,9 +690,11 @@
         updatedAttribMap.get(EGL_POWER_PREFERENCE_ANGLE, EGL_LOW_POWER_ANGLE);
     EGLAttrib platformANGLEType =
         updatedAttribMap.get(EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE);
+    EGLAttrib deviceIdHigh = updatedAttribMap.get(EGL_PLATFORM_ANGLE_DEVICE_ID_HIGH_ANGLE, 0);
+    EGLAttrib deviceIdLow  = updatedAttribMap.get(EGL_PLATFORM_ANGLE_DEVICE_ID_LOW_ANGLE, 0);
     ANGLEPlatformDisplayMap *displays = GetANGLEPlatformDisplayMap();
-    const auto &iter =
-        displays->find(ANGLEPlatformDisplay(nativeDisplay, powerPreference, platformANGLEType));
+    ANGLEPlatformDisplay displayKey(nativeDisplay, powerPreference, platformANGLEType, deviceIdHigh, deviceIdLow);
+    const auto &iter = displays->find(displayKey);
     if (iter != displays->end())
     {
         display = iter->second;
@@ -703,8 +709,7 @@
         }
 
         display = new Display(EGL_PLATFORM_ANGLE_ANGLE, nativeDisplay, nullptr);
-        displays->insert(std::make_pair(
-            ANGLEPlatformDisplay(nativeDisplay, powerPreference, platformANGLEType), display));
+        displays->insert(std::make_pair(displayKey, display));
     }
     // Apply new attributes if the display is not initialized yet.
     if (!display->isInitialized())
@@ -856,7 +861,9 @@
         ANGLEPlatformDisplayMap::iterator iter = displays->find(ANGLEPlatformDisplay(
             mState.displayId, mAttributeMap.get(EGL_POWER_PREFERENCE_ANGLE, EGL_LOW_POWER_ANGLE),
             mAttributeMap.get(EGL_PLATFORM_ANGLE_TYPE_ANGLE,
-                              EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE)));
+                              EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE),
+            mAttributeMap.get(EGL_PLATFORM_ANGLE_DEVICE_ID_HIGH_ANGLE, 0),
+            mAttributeMap.get(EGL_PLATFORM_ANGLE_DEVICE_ID_LOW_ANGLE, 0)));
         if (iter != displays->end())
         {
             displays->erase(iter);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to