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. Is it possible that it is somehow related to 8304825? could be the layer created "during display sleep" and that might be in "sleep" more that 5 seconds? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25342#issuecomment-2899764689