Created attachment 142685 [details]
With amdgpu.dc=1, there is stuttering in the moment when gamma adjustments are getting applied. This is not the case with amdgpu.dc=0, it is entirely free of stutter.
Both RedShift and Gnome night light in Xorg session show the very same behavior:
When "nightmode" is getting turned on with a transition effect, there is severe stuttering going on. The same is the case in the opposite direction when turning nightmode off again.
It's also very problematic that the stutter is ongoing, as tools like RedShift in dynamic mode constantly adjust color temperature as the night progresses. There is stutter happening every few seconds because of that.
To reproduce, simply start e.g. RedShift in dynamic mode with "redshift -t 4500:4500 -l 1:1".
The stutter can be easily observed when looking at the animation of www.vsynctester.com in Chromium, which should be absolutely free of stutter without gamma adjustment (perhaps set CPU clock governor to performance). But you should already notice that even moving windows etc. is stuttery, especially during transition effect.
As a workaround, one might want to use "oneshot" mode of RedShift, e.g. "redshift -O 4500". This applies a gamma adjustment just once and thus prevents further stuttering. But that's not how the usage of such tools usually is intended.
both modesetting and xf86-video-amdgpu-git 126.96.36.199 DDX driver
Created attachment 142686 [details]
Possibly the same issue as bug 106175.
(In reply to Alex Deucher from comment #2)
> Possibly the same issue as bug 106175.
Do you suspect the mouse cursor issue? That's not the case here: The gamma adjustment stutter also occurs without vsync or any other fullscreen vsync application running.
I will give a Wayland session a try this evening. Wouldn't be surprised if this issue is completely unrelated to Xorg specific things.
DC is atomic. gamma updates may go through a full atomic codepath similar to cursor. They may also need a similar fast path to avoid a full atomic update.
Thanks for the explanation, I misunderstood you.
So I've tested night colors in a KDE Plasma Wayland session: And indeed, it shows the same behavior as RedShift on Xorg (stutter with amdgpu.dc=1, no stutter with amdgpu.dc=0).
I suspect that Alex is right about this being similar to the cursor update issue - a large volume of color management changes through the full atomic commit codepath would likely be quite slow. The dc=1 to dc=0 comparison is good evidence supporting it as well.
Expanding the cursor path into a generalized plane update fast path would likely resolve the issue, but may be tricky to do right.
Can confirm that enabling redshift causes occasional stutters every 2-4 seconds with amdgpu.dc=1 with linux 5.0rc2. Without redshift everything (scrolling in browser, video playback)is buttery smooth. With amdgpu.dc=0 redshift doesn't introduce any hiccups.