Title: [273700] trunk/Source

Diff

Modified: trunk/Source/WTF/ChangeLog (273699 => 273700)


--- trunk/Source/WTF/ChangeLog	2021-03-01 23:44:29 UTC (rev 273699)
+++ trunk/Source/WTF/ChangeLog	2021-03-01 23:53:27 UTC (rev 273700)
@@ -1,3 +1,16 @@
+2021-03-01  Truitt Savell  <[email protected]>
+
+        Unreviewed, reverting r273655.
+
+        Broke internal Mac
+
+        Reverted changeset:
+
+        "Set ownership of IOSurfaces from the GPUProcess instead of
+        the WebProcess"
+        https://bugs.webkit.org/show_bug.cgi?id=222391
+        https://commits.webkit.org/r273655
+
 2021-03-01  Sam Weinig  <[email protected]>
 
         Add alternate, non-named-getter based, implementation of CSSStyleDeclaration back into WebCore

Modified: trunk/Source/WTF/wtf/PlatformHave.h (273699 => 273700)


--- trunk/Source/WTF/wtf/PlatformHave.h	2021-03-01 23:44:29 UTC (rev 273699)
+++ trunk/Source/WTF/wtf/PlatformHave.h	2021-03-01 23:53:27 UTC (rev 273700)
@@ -305,13 +305,6 @@
 #define HAVE_IOSURFACE_SET_OWNERSHIP 1
 #endif
 
-#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000) \
-    || (((PLATFORM(IOS) && !PLATFORM(IOS_FAMILY_SIMULATOR)) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \
-    || (PLATFORM(WATCHOS) && !PLATFORM(IOS_FAMILY_SIMULATOR) && __WATCH_OS_VERSION_MIN_REQUIRED >= 80000) \
-    || (PLATFORM(APPLETV) && !PLATFORM(IOS_FAMILY_SIMULATOR) && __TV_OS_VERSION_MIN_REQUIRED >= 150000)
-#define HAVE_IOSURFACE_SET_OWNERSHIP_IDENTITY 1
-#endif
-
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 110300) \
     || (((PLATFORM(IOS) && !PLATFORM(IOS_FAMILY_SIMULATOR)) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500) \
     || (PLATFORM(WATCHOS) && !PLATFORM(IOS_FAMILY_SIMULATOR) && __WATCH_OS_VERSION_MAX_ALLOWED >= 70500) \

Modified: trunk/Source/WebCore/ChangeLog (273699 => 273700)


--- trunk/Source/WebCore/ChangeLog	2021-03-01 23:44:29 UTC (rev 273699)
+++ trunk/Source/WebCore/ChangeLog	2021-03-01 23:53:27 UTC (rev 273700)
@@ -1,3 +1,16 @@
+2021-03-01  Truitt Savell  <[email protected]>
+
+        Unreviewed, reverting r273655.
+
+        Broke internal Mac
+
+        Reverted changeset:
+
+        "Set ownership of IOSurfaces from the GPUProcess instead of
+        the WebProcess"
+        https://bugs.webkit.org/show_bug.cgi?id=222391
+        https://commits.webkit.org/r273655
+
 2021-03-01  Michael Catanzaro  <[email protected]>
 
         Unreviewed, fix unused variable warning

Modified: trunk/Source/WebCore/PAL/ChangeLog (273699 => 273700)


--- trunk/Source/WebCore/PAL/ChangeLog	2021-03-01 23:44:29 UTC (rev 273699)
+++ trunk/Source/WebCore/PAL/ChangeLog	2021-03-01 23:53:27 UTC (rev 273700)
@@ -1,3 +1,16 @@
+2021-03-01  Truitt Savell  <[email protected]>
+
+        Unreviewed, reverting r273655.
+
+        Broke internal Mac
+
+        Reverted changeset:
+
+        "Set ownership of IOSurfaces from the GPUProcess instead of
+        the WebProcess"
+        https://bugs.webkit.org/show_bug.cgi?id=222391
+        https://commits.webkit.org/r273655
+
 2021-03-01  Chris Dumez  <[email protected]>
 
         Set ownership of IOSurfaces from the GPUProcess instead of the WebProcess

Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/IOSurfaceSPI.h (273699 => 273700)


--- trunk/Source/WebCore/PAL/pal/spi/cocoa/IOSurfaceSPI.h	2021-03-01 23:44:29 UTC (rev 273699)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/IOSurfaceSPI.h	2021-03-01 23:53:27 UTC (rev 273700)
@@ -102,10 +102,6 @@
 IOReturn IOSurfaceSetOwnership(IOSurfaceRef buffer, task_t newOwner, int newLedgerTag, uint32_t newLedgerOptions);
 #endif // HAVE(IOSURFACE_SET_OWNERSHIP)
 
-#if HAVE(IOSURFACE_SET_OWNERSHIP_IDENTITY)
-kern_return_t IOSurfaceSetOwnershipIdentity(IOSurfaceRef buffer, mach_port_t task_id_token, int newLedgerTag, uint32_t newLedgerOptions);
-#endif
-
 WTF_EXTERN_C_END
 
 #endif

Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h (273699 => 273700)


--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h	2021-03-01 23:44:29 UTC (rev 273699)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h	2021-03-01 23:53:27 UTC (rev 273700)
@@ -161,9 +161,7 @@
     WEBCORE_EXPORT static void convertToFormat(std::unique_ptr<WebCore::IOSurface>&& inSurface, Format, WTF::Function<void(std::unique_ptr<WebCore::IOSurface>)>&&);
 #endif // HAVE(IOSURFACE_ACCELERATOR)
 
-#if HAVE(IOSURFACE_SET_OWNERSHIP_IDENTITY)
-    WEBCORE_EXPORT void setOwnershipIdentity(task_id_token_t newOwner);
-#endif
+    WEBCORE_EXPORT void setOwnership(task_t newOwner);
 
     void migrateColorSpaceToProperties();
 

Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm (273699 => 273700)


--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm	2021-03-01 23:44:29 UTC (rev 273699)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm	2021-03-01 23:53:27 UTC (rev 273700)
@@ -504,14 +504,19 @@
 
 #endif // HAVE(IOSURFACE_ACCELERATOR)
 
-#if HAVE(IOSURFACE_SET_OWNERSHIP_IDENTITY)
-void IOSurface::setOwnershipIdentity(task_id_token_t newOwner)
+void IOSurface::setOwnership(task_t newOwner)
 {
-    auto result = IOSurfaceSetOwnershipIdentity(m_surface.get(), newOwner, kIOSurfaceMemoryLedgerTagGraphics, 0);
+#if HAVE(IOSURFACE_SET_OWNERSHIP)
+    if (!m_surface)
+        return;
+
+    auto result = IOSurfaceSetOwnership(m_surface.get(), newOwner, kIOSurfaceMemoryLedgerTagGraphics, 0);
     if (result != kIOReturnSuccess)
-        RELEASE_LOG_ERROR(IOSurface, "IOSurface::setOwnershipIdentity: Failed to claim ownership of IOSurface %p, newOwner: %d, error: %d", m_surface.get(), (int)newOwner, result);
+        RELEASE_LOG_ERROR(IOSurface, "IOSurface::setOwnership: Failed to claim ownership of IOSurface %p. Error: %d", m_surface.get(), result);
+#else
+    UNUSED_PARAM(newOwner);
+#endif
 }
-#endif
 
 void IOSurface::migrateColorSpaceToProperties()
 {

Modified: trunk/Source/WebKit/ChangeLog (273699 => 273700)


--- trunk/Source/WebKit/ChangeLog	2021-03-01 23:44:29 UTC (rev 273699)
+++ trunk/Source/WebKit/ChangeLog	2021-03-01 23:53:27 UTC (rev 273700)
@@ -1,3 +1,16 @@
+2021-03-01  Truitt Savell  <[email protected]>
+
+        Unreviewed, reverting r273655.
+
+        Broke internal Mac
+
+        Reverted changeset:
+
+        "Set ownership of IOSurfaces from the GPUProcess instead of
+        the WebProcess"
+        https://bugs.webkit.org/show_bug.cgi?id=222391
+        https://commits.webkit.org/r273655
+
 2021-03-01  Chris Dumez  <[email protected]>
 
         Crash under WebProcessPool::pageBeginUsingWebsiteDataStore()

Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp (273699 => 273700)


--- trunk/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp	2021-03-01 23:44:29 UTC (rev 273699)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp	2021-03-01 23:53:27 UTC (rev 273700)
@@ -72,14 +72,8 @@
 {
     m_context->prepareForDisplay();
     MachSendRight sendRight;
-    if (auto* surface = m_swapChain.displayBuffer().surface.get()) {
-#if HAVE(IOSURFACE_SET_OWNERSHIP_IDENTITY)
-        // Mark the IOSurface as being owned by the WebProcess even though it was constructed by the GPUProcess so that Jetsam knows which process to kill.
-        if (m_gpuConnectionToWebProcess)
-            surface->setOwnershipIdentity(m_gpuConnectionToWebProcess->webProcessIdentityToken());
-#endif
+    if (auto* surface = m_swapChain.displayBuffer().surface.get())
         sendRight = surface->createSendRight();
-    }
     completionHandler(WTFMove(sendRight));
 }
 

Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteImageBuffer.h (273699 => 273700)


--- trunk/Source/WebKit/GPUProcess/graphics/RemoteImageBuffer.h	2021-03-01 23:44:29 UTC (rev 273699)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteImageBuffer.h	2021-03-01 23:53:27 UTC (rev 273700)
@@ -65,14 +65,6 @@
             context().restore();
     }
 
-#if HAVE(IOSURFACE_SET_OWNERSHIP_IDENTITY)
-    void setProcessOwnership(task_id_token_t newOwner)
-    {
-        if (m_backend)
-            m_backend->setProcessOwnership(newOwner);
-    }
-#endif
-
 private:
     bool apply(WebCore::DisplayList::ItemHandle item, WebCore::GraphicsContext& context) override
     {

Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp (273699 => 273700)


--- trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp	2021-03-01 23:44:29 UTC (rev 273699)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp	2021-03-01 23:53:27 UTC (rev 273700)
@@ -147,15 +147,8 @@
 
     RefPtr<ImageBuffer> imageBuffer;
 
-    if (renderingMode == RenderingMode::Accelerated) {
-        if (auto acceleratedImageBuffer = AcceleratedRemoteImageBuffer::create(logicalSize, resolutionScale, colorSpace, pixelFormat, *this, renderingResourceIdentifier)) {
-#if HAVE(IOSURFACE_SET_OWNERSHIP_IDENTITY)
-            // Mark the IOSurface as being owned by the WebProcess even though it was constructed by the GPUProcess so that Jetsam knows which process to kill.
-            acceleratedImageBuffer->setProcessOwnership(m_gpuConnectionToWebProcess->webProcessIdentityToken());
-#endif
-            imageBuffer = WTFMove(acceleratedImageBuffer);
-        }
-    }
+    if (renderingMode == RenderingMode::Accelerated)
+        imageBuffer = AcceleratedRemoteImageBuffer::create(logicalSize, resolutionScale, colorSpace, pixelFormat, *this, renderingResourceIdentifier);
 
     if (!imageBuffer)
         imageBuffer = UnacceleratedRemoteImageBuffer::create(logicalSize, resolutionScale, colorSpace, pixelFormat, *this, renderingResourceIdentifier);

Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp (273699 => 273700)


--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp	2021-03-01 23:44:29 UTC (rev 273699)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp	2021-03-01 23:53:27 UTC (rev 273700)
@@ -93,6 +93,9 @@
     }
     auto displayBuffer = IOSurface::createFromSendRight(WTFMove(displayBufferSendRight), sRGBColorSpaceRef());
     if (displayBuffer) {
+        // Claim in the WebProcess ownership of the IOSurface constructed by the GPUProcess so that Jetsam knows which processes to kill.
+        displayBuffer->setOwnership(mach_task_self());
+
         auto& sc = platformSwapChain();
         sc.recycleBuffer();
         sc.present({ WTFMove(displayBuffer), nullptr });

Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp (273699 => 273700)


--- trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp	2021-03-01 23:44:29 UTC (rev 273699)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp	2021-03-01 23:53:27 UTC (rev 273700)
@@ -69,6 +69,9 @@
     if (!surface)
         return nullptr;
 
+    // Claim in the WebProcess ownership of the IOSurface constructed by the GPUProcess so that Jetsam knows which processes to kill.
+    surface->setOwnership(mach_task_self());
+
     return makeUnique<ImageBufferShareableMappedIOSurfaceBackend>(parameters, WTFMove(surface));
 }
 
@@ -77,14 +80,6 @@
     return ImageBufferBackendHandle(m_surface->createSendRight());
 }
 
-#if HAVE(IOSURFACE_SET_OWNERSHIP_IDENTITY)
-void ImageBufferShareableMappedIOSurfaceBackend::setProcessOwnership(task_id_token_t processIdentityToken)
-{
-    ASSERT(surface());
-    surface()->setOwnershipIdentity(processIdentityToken);
-}
-#endif
-
 } // namespace WebKit
 
 #endif // ENABLE(GPU_PROCESS) && HAVE(IOSURFACE)

Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.h (273699 => 273700)


--- trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.h	2021-03-01 23:44:29 UTC (rev 273699)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.h	2021-03-01 23:53:27 UTC (rev 273700)
@@ -45,10 +45,6 @@
     using WebCore::ImageBufferIOSurfaceBackend::ImageBufferIOSurfaceBackend;
 
     ImageBufferBackendHandle createImageBufferBackendHandle() const;
-
-#if HAVE(IOSURFACE_SET_OWNERSHIP_IDENTITY)
-    void setProcessOwnership(task_id_token_t);
-#endif
 };
 
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to