Bug 499987 - ICC Prefer efficiency setting, worse performance on stable release, and artifacting.
Summary: ICC Prefer efficiency setting, worse performance on stable release, and artif...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: performance (show other bugs)
Version: 6.3.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
: 499962 500021 500058 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-02-13 13:25 UTC by Rean
Modified: 2025-02-18 18:52 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.3.1
Sentry Crash Report:


Attachments
Screenshot of window border shadows. (165.53 KB, image/png)
2025-02-13 13:25 UTC, Rean
Details
MyICC (2.71 KB, application/vnd.iccprofile)
2025-02-13 18:25 UTC, Rean
Details
Dots (115.18 KB, video/webm)
2025-02-13 20:11 UTC, Rean
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rean 2025-02-13 13:25:30 UTC
Created attachment 178276 [details]
Screenshot of window border shadows.

STEPS TO REPRODUCE
1. Set color accuracy to "Prefer efficiency"
2. Move a window with shadows around borders.

OBSERVED RESULT
Weird dotted artifacts.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 6.3.0
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.2


ADDICTIONAL INFORMATION
Other than  the dotted artifacts on shadows when moving windows with the preferred efficiency setting that was not there during the 6.3 beta. Now the prefer efficiency setting does not yield the same performance improvement it did in the 6.3 beta; it's slightly less efficient now on 6.3.0 stable, it's quite noticeable. This has to be a regression or something somewhere because during the beta I used this setting the entire time experienced literally no frame drops, but now I am.
Comment 1 Rean 2025-02-13 13:31:24 UTC
It was an amazing improvement over my laggy experience with ICC profiles compared to what I got in earlier plasma versions, but it only lasted for the beta period; hopefully it's not a huge deal to fix.
Comment 2 Zamundaaa 2025-02-13 17:33:18 UTC
Please attach the output of drm_info, once for when you're using "prefer efficiency" and once for "prefer color accuracy".

The only commit that *might* be relevant for this is https://invent.kde.org/plasma/kwin/-/commit/888deff8c65dd46bf6df9d00fb8022bc1779f793, and it could be a simple case of taking into account potential rounding errors. Could you test a patch to check if it's actually the case?
Comment 3 Zamundaaa 2025-02-13 17:34:26 UTC
Also, please attach the ICC profile you're using, maybe I can trigger the bug on my PC with it too
Comment 4 Rean 2025-02-13 18:25:27 UTC
Created attachment 178312 [details]
MyICC

By the way, a 1080p video in MPV now shows about 50% render usage with the prefer efficiency setting; if I exit and enter fullscreen, it spikes to 60%. I should have taken a screenshot in the beta, but I'm pretty sure it was only using 25% then.
Comment 5 Rean 2025-02-13 18:40:00 UTC
Actually, now that I compare, prefer accuracy and prefer efficiency; they are now closer to using the exact same render usage, which they weren't previously, because prefer accuracy uses 55% render with the 1080p video and prefer efficiency now uses about 50%. This definitely shouldn't be the case; from what I've seen before, the prefer efficiency setting should significantly reduce render usage compared to the prefer color accuracy setting, so this as well shows that the prefer efficiency setting is indeed way less efficient now than before. It's now almost the same performance drop as the prefer accuracy setting.
Comment 6 Zamundaaa 2025-02-13 20:07:15 UTC
I can't see any glitches, but I can confirm that the ICC profile causes a shadow buffer to be used.
Comment 7 Bug Janitor Service 2025-02-13 20:10:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7147
Comment 8 Rean 2025-02-13 20:11:26 UTC
Created attachment 178316 [details]
Dots

Here's a screen recording of the dots that appear.
Comment 9 Rean 2025-02-13 20:23:53 UTC
By the way, these dots are even more noticeable on a lower resolution display because I have a laptop with a 1366x768 screen, and I see it even more clearly. I also had the Plasma 6.3 beta on the laptop with the ICC profile set, and the dots were not there, so it was deffinitely something that changed release of 6.3.0 that's causing it.
Comment 10 Zamundaaa 2025-02-13 20:33:40 UTC
Do you remember if you used "prefer efficiency" or "prefer color accuracy" in the beta?

I have absolutely no explanation to how KWin could cause these dots with its actual rendering. We've seen really weird bugs with rarely used buffer formats before though, so it could be a driver bug with 16 bits per color formats (which gets used with "prefer color accuracy").

If you set https://invent.kde.org/plasma/kwin/-/wikis/Environment-Variables#kwin_drm_use_modifiers to 0, do the dots go away?
Comment 11 Rean 2025-02-13 20:46:52 UTC
Yes, I'm 100% sure I used the prefer efficiency setting, and it was not happening during the beta; it's happening on 2 laptops. My gaming laptop has a 1080p display, and my other laptop has a 1366x768 display. The 1366 display laptop's CPU is an Intel Ivy Bridge CPU, and the gaming laptop is an i5 Kaby Lake CPU. It does not happen with the prefer accuracy setting, though, but it definitely was not happening with the prefer efficiency setting previously. I'd have noticed it; it's pretty easy to notice without even zooming in.
Comment 12 Rean 2025-02-13 21:03:08 UTC
And the environment variable doesn't change anything still the same.
Comment 13 Zamundaaa 2025-02-14 12:49:36 UTC
Git commit 582ec868123f328eb83d03b2a6b59175d948808c by Xaver Hugl.
Committed on 14/02/2025 at 12:33.
Pushed by zamundaaa into branch 'master'.

backends/drm: be a little bit less strict about range checking

Rounding errors in floating point calculations can otherwise wrongly trigger the check and
prevent KMS offloading for no reason

M  +2    -1    src/backends/drm/drm_colorop.cpp

https://invent.kde.org/plasma/kwin/-/commit/582ec868123f328eb83d03b2a6b59175d948808c
Comment 14 Zamundaaa 2025-02-14 13:31:31 UTC
*** Bug 500021 has been marked as a duplicate of this bug. ***
Comment 15 Zamundaaa 2025-02-14 13:32:56 UTC
Git commit 7d9528edc46fcb4c49c853af5b95fc62d7b2c1ba by Xaver Hugl.
Committed on 14/02/2025 at 13:13.
Pushed by zamundaaa into branch 'Plasma/6.3'.

backends/drm: be a little bit less strict about range checking

Rounding errors in floating point calculations can otherwise wrongly trigger the check and
prevent KMS offloading for no reason


(cherry picked from commit 582ec868123f328eb83d03b2a6b59175d948808c)

Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>

M  +2    -1    src/backends/drm/drm_colorop.cpp

https://invent.kde.org/plasma/kwin/-/commit/7d9528edc46fcb4c49c853af5b95fc62d7b2c1ba
Comment 16 Rean 2025-02-14 21:47:58 UTC
Ok, this is marked as resolved, but I'm just going to add this information: I did a partial downgrade of KWin alone back to 6.2.91, which is the Plasma 6.3 beta version of KWin, the performance issues of the efficiency setting, and the weird dotted artifacts stopped happening. I forgot I didn't clear my pacman cache yet, so I was able to downgrade and do a quick test, seeing that this fixed the issues it 100%, guarantees that it's something odd in the latest version of Kwin 6.3.0.
Comment 17 Filip 2025-02-16 08:01:39 UTC
*** Bug 500058 has been marked as a duplicate of this bug. ***
Comment 18 cwo 2025-02-17 10:50:25 UTC
*** Bug 499962 has been marked as a duplicate of this bug. ***
Comment 19 Rean 2025-02-18 18:52:02 UTC
Ok, as of the 6.3.1 release, the artifacting issue is also gone, and performance is back to how it was in the beta.