-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick d2f3169. rdar://problem/108642579
RemoteImageBufferProxyFlushState::waitForDidFlushOnSecondaryThread blocks on a task running on the main thread. https://bugs.webkit.org/show_bug.cgi?id=256073 <rdar://108642579> Reviewed by Simon Fraser. We attempt to wait for flushes of RemoteImageBufferProxy on a background thread, but the 'didFlush' IPC message is received on the main thread. This can mean it gets delayed (and we don't know the flush is completed) if the main thread is otherwise busy. This delays first-paint on CPLT. This change passes a Semphore across to the GPUP instead of the flush identifier, and we signal it when the flush is completed rather than sending a return 'didFlush' message. The WebProcess waits on each flush Semaphore in a background WorkQueue, and then processes the equivalent of 'didFlush' asynchronously and notifies the condition variable to wake any waiting threads. waitForDidFlushWithTimeout is removed, and all waiters now use the waitForDidFlushOnSecondaryThread code path (renamed) since all waiters are now 'secondary' WRT the flushing WorkQueue. Synchronous flushes now use a proper synchronous IPC message, rather than relying on async + wait. Adds a 0-delay asynchronous callOnMainThread hop when triggering the rendering update from RemoteLaterTreeDisplayRefreshMonitor::requestRefreshCallback. It appears that when doing the first requestRefreshCallback after idle, we currently just trigger a rendering update immediately, rather than waiting for displayDidRefresh. This differs from the non-GPUP code. This 0-delay step makes our behaviour more similar to the old code, but adding a proper displayDidRefresh wait would be preferable in the longer term. * Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::flushContext): (WebKit::RemoteDisplayListRecorder::flushContextSync): * Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h: * Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.messages.in: * Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::didFlush): Deleted. * Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h: * Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp: (WebKit::RemoteDisplayListRecorderProxy::sendSync): (WebKit::RemoteDisplayListRecorderProxy::flushContext): (WebKit::RemoteDisplayListRecorderProxy::flushContextSync): * Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h: * Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.cpp: (WebKit::RemoteImageBufferProxy::flushDrawingContext): (WebKit::RemoteImageBufferProxy::flushDrawingContextAsync): (WebKit::RemoteImageBufferProxyFlushState::waitForDidFlush): (WebKit::RemoteImageBufferProxy::waitForDidFlushWithTimeout): Deleted. (WebKit::RemoteImageBufferProxyFlushState::waitForDidFlushOnSecondaryThread): Deleted. * Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h: * Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp: (WebKit::RemoteRenderingBackendProxy::RemoteRenderingBackendProxy): (WebKit::RemoteRenderingBackendProxy::disconnectGPUProcess): (WebKit::RemoteRenderingBackendProxy::addPendingFlush): (WebKit::RemoteRenderingBackendProxy::waitForDidFlush): Deleted. (WebKit::RemoteRenderingBackendProxy::didFlush): Deleted. * Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h: * Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.messages.in: * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm: (WebKit::RemoteLayerTreeDisplayRefreshMonitor::requestRefreshCallback): Canonical link: https://commits.webkit.org/263993@main Identifier: 263769.46@safari-7616.1.14.10-branch
- Loading branch information
1 parent
3c53d4e
commit 20fd085
Showing
13 changed files
with
64 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters