Bug 495167 - Frame rate drops with Night Light and changing brightness
Summary: Frame rate drops with Night Light and changing brightness
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (show other bugs)
Version: 6.2.1
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-22 02:56 UTC by player one
Modified: 2025-01-30 21:03 UTC (History)
8 users (show)

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


Attachments
Video with frame rate drops with Night Light (1.89 MB, video/mp4)
2024-10-22 02:56 UTC, player one
Details

Note You need to log in before you can comment on or make changes to this bug.
Description player one 2024-10-22 02:56:26 UTC
Created attachment 175099 [details]
Video with frame rate drops with Night Light

After update to plasma 6.2.1.1 and with night light I have frame rate drops.With plasma 6.2.0 no issue. 


STEPS TO REPRODUCE
1. Turn on  "Night light" 
2. Change the brightness

OBSERVED RESULT

The frame rate drops from 60 to 30 or from 120 to 40-50.


EXPECTED RESULT

No frame rate drops


SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 40
KDE Plasma Version: 6.2.1 (6.2.1.1)
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.2
Kernel Version: 6.11.3-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz
Memory: 38.9 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ASUS EXPERTBOOK B1400CEAEY_B1400CEAE
System Version: 1.0


ADDITIONAL INFORMATION
1. Connected to external monitor and have same issue
2. Used other ICC and have same issue
3. Created new user and have same issue
Comment 1 Zamundaaa 2024-10-26 01:29:49 UTC

*** This bug has been marked as a duplicate of bug 480799 ***
Comment 2 Zamundaaa 2024-10-26 01:32:40 UTC
oops, that was the wrong one. I didn't see the one I was actually thinking about, let's just track it here then.
Comment 3 Zamundaaa 2024-10-26 01:32:54 UTC
When the brightness stays constant, is performance okay?

> Used other ICC and have same issue
Does it also happen without an ICC profile?
Comment 4 player one 2024-10-26 06:15:52 UTC
Intresting(In reply to Zamundaaa from comment #3)
> When the brightness stays constant, is performance okay?
> 
> > Used other ICC and have same issue
> Does it also happen without an ICC profile?

I have no issues with the ICC profile. I had previously only tried the built-in one. I upgraded to Plasma 6.2.2 and still see the same problem. There is no frame drop if you don't change the brightness. Here are the results with the ICC profile:

So I have the following behavior:

1. Without ICC - No night mode - Brightness change - no frame drop
2. Without ICC - With night mode - Brightness change - frame drop

3. With built-in ICC - No night mode - Brightness change - No frame drop
4. With built-in ICC - With night mode - brightness change - frame drop


5. With any ICC - No night mode - Brightness change - No drop

6. With ICC sRGB - With night mode - Brightness change - no frame drop

7. With ICC AdobeRGB1998 - With night mode - Brightness change - no frame drop

8. With ICC Bluish - With night mode - Brightness change - no frame drop

9. With ICC Rec709 - With night mode - Brightness change - No frame drop

10. With ICC SMPTE-C-RGB - With night mode - Brightness change - no frame drop

!!! 11. With ICC x11-colors.icc - With night mode - Brightness change - frame drop
Comment 5 Zamundaaa 2024-10-29 23:25:19 UTC
Okay, I can confirm that there are some frame drops. It's not very pronounced here, but still measurable.
It's almost certainly caused by calculating or by programming lookup tables - if you set an ICC profile that KWin successfully loads, then a shader is used instead, so it doesn't happen there.
Comment 6 Nate Graham 2024-11-05 22:10:44 UTC
I can also reproduce this issue on my device:

Processors: 16 × AMD Ryzen 7 7840U w/ Radeon™ 780M Graphics
Memory: 14.9 GB of RAM
Graphics Processor: AMD Radeon 780M

When I change the brightness via keyboard button during the night light transition period, it does not respond smoothly.
Comment 7 Zamundaaa 2024-12-19 01:38:38 UTC
*** Bug 496316 has been marked as a duplicate of this bug. ***
Comment 8 Zamundaaa 2024-12-19 01:54:30 UTC
I looked into this a bit more, and my theory was correct - it takes consistently less than 200µs to do a commit for normal presentation, but with LUT changes it takes 1-2ms instead, making KWin miss the deadline for the frame. I'm not sure if this is a bug in amdgpu or if it's just how long the hardware takes to respond, but either way we can improve the situation by measuring how much time we spend in the kernel and adjusting the safety margin accordingly.
Comment 9 Sander Lindeman 2024-12-19 08:41:07 UTC
Same experience on my system:

Operating System: Fedora Linux 41
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.1
Kernel Version: 6.12.4-200.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics
Memory: 58.5 GiB of RAM
Graphics Processor: AMD Radeon 780M
Comment 10 medin 2024-12-19 14:42:08 UTC
(In reply to Zamundaaa from comment #8)

> I'm not sure if this is a bug in amdgpu

This started to happen direclty after upgrading to 6.2 on laptops without any AMD graphics. Night Light cannot be used at all.
Comment 11 Zamundaaa 2024-12-22 23:41:47 UTC
Right, yours is a different case, I shouldn't have marked that as a duplicate.
Comment 12 martin-kokos 2025-01-30 20:58:18 UTC
I also have this issue. Toggling Night light in the systray Brightness and color poppup, the kwin_wayland process is pegged at 100% during the transition.

Plasma 6.2.5
Comment 13 martin-kokos 2025-01-30 21:03:44 UTC
Can reproduce regardless of ICC profile (none, ICC profile, built-in)
Intel graphics.