On Wed, 21 May 2025 06:11:18 GMT, Jayathirth D V <j...@openjdk.org> wrote:
> In stress based scenarios it is observed that nothing is drawn in UI content > when display wakes up from sleep in Metal pipeline of macOS. Unfortunately i > am not able to reproduce it, but based on details in the bug it looks like we > are hitting a race condition. Call to CVDisplayLinkCreateWithActiveCGDisplays > is becoming a no-op as there are no active displays right after > NSWorkspaceScreensDidWakeNotification. Looks like if we continue to call > CVDisplayLinkCreateWithActiveCGDisplays after screen wakeup we are able to > get the list of ActiveDisplays and then able to create displayLink. > > So now the code is modified to check whether > CVDisplayLinkCreateWithActiveCGDisplays is successful or not. If not we will > try to call CVDisplayLinkCreateWithActiveCGDisplays for 5 instances each with > 1 second delay. There is no regression test for this change because it needs > a stress based test with display wakeup/sleep(As captured in JBS, i am not > able to reproduce this issue). > > I have tested this change for sanity by running animation examples from > SwingSet2 and continuously connecting/disconnecting external display. Also by > multiple display sleep and wakeup scenarios, i don't see any regressions. > Also whole clientlibs CI run is done with this patch and it is also green. > > While working on this bug also noticed that many functions of CVDisplayLink > is deprecated from macOS 14 and going forward we need to use > CADisplayLink/CAMetalDisplayLink. I have raised > [JDK-8357418](https://bugs.openjdk.org/browse/JDK-8357418) for the same. This pull request has now been integrated. Changeset: a50d3bee Author: Jayathirth D V <j...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/a50d3bee12cd2f528067bc15b404cf2289977af5 Stats: 24 lines in 2 files changed: 19 ins; 0 del; 5 mod 8312198: [macos] metal pipeline - window rendering stops after display sleep Reviewed-by: serb, avu, prr ------------- PR: https://git.openjdk.org/jdk/pull/25342