Bug 500365 - Night color causes degraded graphics performance
Summary: Night color causes degraded graphics performance
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: night color (other bugs)
Version First Reported In: unspecified
Platform: postmarketOS Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-19 03:11 UTC by Devin Lin
Modified: 2025-08-17 03:46 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
video (2.51 MB, video/mp4)
2025-02-19 03:12 UTC, Devin Lin
Details
drm_info of google-krane (22.80 KB, application/octet-stream)
2025-02-19 17:11 UTC, Devin Lin
Details
drm_info on Plasma Mobile 6.4.1 on Google-Krane (25.92 KB, text/x-log)
2025-07-02 17:14 UTC, Julian Groß
Details
`kscreen-doctor -o` on Plasma Mobile 6.4.1 on Google-Krane (802 bytes, text/x-log)
2025-07-02 17:15 UTC, Julian Groß
Details
drm-debug log while enabling night light (322.46 KB, application/gzip)
2025-07-02 17:56 UTC, Julian Groß
Details
add some logging to kwin (3.82 KB, patch)
2025-07-03 15:54 UTC, Zamundaaa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Lin 2025-02-19 03:11:43 UTC
SUMMARY

Downstream issue: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/3271

We tend to use a lot of lower end devices when testing Plasma Mobile, and so any graphics performance degradation becomes quite noticeable. Night color especially appears to cause much lower fps with animations which is noticeable when we interact and scroll widgets using touch.

Suspected to have started happening in Plasma 6.2, but I haven't confirmed for myself, only the reporter of the downstream issue had caught it then. I can confirm the issue on Plasma 6.3

STEPS TO REPRODUCE
1. Enable night color (either through the kcm, or in the Plasma Mobile quicksettings which does the same thing)
2. Scroll webpages in firefox, or interact with the shell
3. Disable night color
4. Scroll webpages in firefox, or interact with the shell

OBSERVED RESULT
There is a lot of frames dropped when night color is enabled.

EXPECTED RESULT
The performance when night color is enabled matches the performance when night color is disabled.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: postmarketOS edge
KDE Plasma Version: 6.3.0
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Comment 1 Devin Lin 2025-02-19 03:12:50 UTC
Created attachment 178561 [details]
video
Comment 2 Zamundaaa 2025-02-19 17:01:38 UTC
Does that device have a CTM and/or GAMMA_LUT? You can check with drm_info if they're supported, and while night light is on, if they're also actually used
Comment 3 Devin Lin 2025-02-19 17:10:58 UTC
(In reply to Zamundaaa from comment #2)
> Does that device have a CTM and/or GAMMA_LUT? You can check with drm_info if
> they're supported, and while night light is on, if they're also actually used

It appears so, I attached the output of drm_info for google-krane (Lenovo Chromebook Duet)
Comment 4 Devin Lin 2025-02-19 17:11:19 UTC
Created attachment 178598 [details]
drm_info of google-krane
Comment 5 Zamundaaa 2025-03-05 00:19:22 UTC
hmm, did you get that drm_info output while night light is active? If so, KWin neither used the gamma lut (it's size is only 512, so that's expected - though we should probably relax that requirement a bit) nor the CTM, which would clearly explain the performance difference.

If you could re-test on 6.3.2, that would also be good. There were some fixes for KMS offloading in there.
Comment 6 Bug Janitor Service 2025-03-20 03:47:03 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Bug Janitor Service 2025-04-04 03:46:48 UTC
🐛🧹 This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.
Comment 8 Julian Groß 2025-06-29 12:54:25 UTC
(In reply to Zamundaaa from comment #5)
> If you could re-test on 6.3.2, that would also be good. There were some
> fixes for KMS offloading in there.

The issue persists on Plasma Mobile 6.3.5.
Comment 9 Zamundaaa 2025-07-02 16:48:52 UTC
Alright. Please attach the output of both drm_info and kscreen-doctor -o while night light is enabled.

If KWin is now using KMS offloading (like it should), then this could just be the GPU being so severely slow that the few additional shader instructions kill performance. I'm not sure there's a whole lot that can be done in that case...
If it's still not using KMS offloading though, then that should be much easier to fix.
Comment 10 Julian Groß 2025-07-02 17:14:46 UTC
Created attachment 182871 [details]
drm_info on Plasma Mobile 6.4.1 on Google-Krane
Comment 11 Julian Groß 2025-07-02 17:15:23 UTC
Created attachment 182872 [details]
`kscreen-doctor -o` on Plasma Mobile 6.4.1 on Google-Krane
Comment 12 Julian Groß 2025-07-02 17:17:21 UTC
(In reply to Zamundaaa from comment #9)
> Please attach the output of both drm_info and kscreen-doctor -o
> while night light is enabled.

Both of them should now be attached to this issue.
Comment 13 Zamundaaa 2025-07-02 17:45:07 UTC
> │   │       ├───"CTM": blob = 0
> │   │       ├───"GAMMA_LUT": blob = 0
Alright, still no KMS offloading, and no option is enabled that would prevent it. That explains the performance problems.

Maybe the driver is rejecting our config? Please follow https://invent.kde.org/plasma/kwin/-/wikis/Debugging/Debugging-DRM-issues to get a drm debug log of enabling night light.
Comment 14 Julian Groß 2025-07-02 17:56:16 UTC
Created attachment 182873 [details]
drm-debug log while enabling night light
Comment 15 Zamundaaa 2025-07-03 15:54:13 UTC
Created attachment 182901 [details]
add some logging to kwin

Hmm, there's nothing relevant in there :/
Could you run with that patch, enable night light and then attach KWin's log here?
Comment 16 Bug Janitor Service 2025-07-18 03:47:06 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 17 Julian Groß 2025-07-18 08:35:16 UTC
(In reply to Zamundaaa from comment #15)
> Created attachment 182901 [details]
> add some logging to kwin
> 
> Hmm, there's nothing relevant in there :/
> Could you run with that patch, enable night light and then attach KWin's log
> here?

Ah, I forgot about this after holidays.
I can't really run a patch for a component such a KWin. Last time I tried building KDE software, it was extremely complicated and didn't work in the end. And even if I was to get it to build, I wouldn't know how to run it.

Maybe Devin Lin would be up for testing it? (I have no idea how to ping someone here.) They are a Plasma Mobile developer, so I assume they have experience building KWin and running it on postmarketOS.
Comment 18 Bug Janitor Service 2025-08-02 03:46:27 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 19 Bug Janitor Service 2025-08-17 03:46:27 UTC
🐛🧹 This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.