Bug 487268 - Less contrast when using balanced or power saving mode on AMD integrated GPU
Summary: Less contrast when using balanced or power saving mode on AMD integrated GPU
Status: RESOLVED NOT A BUG
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-20 07:00 UTC by Bacteria
Modified: 2024-05-23 03:45 UTC (History)
2 users (show)

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


Attachments
Less Contrast - Power Saving & Balanced Mode (845.31 KB, image/png)
2024-05-21 14:47 UTC, Bacteria
Details
More Contrast - Performance Mode (875.21 KB, image/png)
2024-05-21 14:47 UTC, Bacteria
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bacteria 2024-05-20 07:00:41 UTC
This is a weird one. When I am using Power Saving mode, the contrast seems to go down. Since KDE is doing a lot of work related to HDR and color profiles, I wonder if my non-HDR display is trying to do HDR. I am not sure how to find out if some color profile is being applied. The screen recorder is not able to catch the issue and I don't have a good camera to record the slight change.

When I switch to Performance mode, the UI feels more contrasty like it used to before, when I switch back to power saving, slowly the contrast goes away.

Also, when I plug in my laptop the colors go back to normal on all modes. Unplugging with power saving mode selected again results in a less contrast output.

Theme: Breeze Dark
GPU: AMD iGPU renoir
CPU: AMD Ryzen 5500U
Plasma Version: 6.0.4
Graphics: Wayland
Frameworks: 6.2.0
Qt: 6.7.0
Kernel: 6.9.1
Comment 1 Aru Sahni 2024-05-20 16:42:07 UTC
I'm encountering this, too, but with a non-HDR display.

Theme: Breeze Dark
Operating System: EndeavourOS 
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0
Kernel Version: 6.9.1-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7840U w/ Radeon 780M Graphics
Memory: 30.7 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: Framework
Product Name: Laptop 13 (AMD Ryzen 7040Series)
System Version: A7
Comment 2 Bacteria 2024-05-21 05:20:20 UTC
Just to clarify my display is also not HDR.

I have another laptop with an AMD iGPU renoir. It does not support amd_pstate and that's why it has no power profiles. The issue is also not reproducible.

So it seems power profiles is messing up with the color profiles?
Comment 3 Bacteria 2024-05-21 14:47:01 UTC
Created attachment 169677 [details]
Less Contrast - Power Saving & Balanced Mode
Comment 4 Bacteria 2024-05-21 14:47:28 UTC
Created attachment 169678 [details]
More Contrast - Performance Mode
Comment 5 Bacteria 2024-05-21 14:48:29 UTC
Managed to portray the issue in the above two pics. Put them side by side and you will notice the issue. Note that there was no change in brightness.
Comment 6 Aru Sahni 2024-05-23 01:37:48 UTC
After some investigation, I don't think this is a KDE bug: it's a Linux 6.9 + Power Profiles Daemon 0.20 feature.

* Kernel 6.9 introduced the `panel_power_savings` sysfs entry for AMD graphics (see https://lore.kernel.org/amd-gfx/0b94b25a-9ffa-41a5-b931-ad84e1892d36@amd.com/T/#m079d7c357626cf3a80cd9ba6239b3fe4fcf8937e )
* PPD 0.20 added support for this: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/commit/41ed5d33a82b0ceb7b6d473551eb2aa62cade6bc

The values range from 0 (no power savings) to 4 (extreme power savings). PPD itself writes 0 for performance, 1 for balanced, and 3 for power save. (https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/blob/main/src/ppd-action-amdgpu-panel-power.c?ref_type=heads#L148-159)

By writing `1` or `0` to the sysfs entry you should be able to restore the previous visual fidelity. I'm not yet sure how to make this the default, but this is now tolerable.
Comment 7 Aru Sahni 2024-05-23 01:54:26 UTC
Ah, found it by RTFM.

I can disable the backlight management feature altogether adding the `amdgpu.abmlevel=0` kernel parameter: https://www.kernel.org/doc/html/v6.9/gpu/amdgpu/module-parameters.html
Comment 8 Bacteria 2024-05-23 03:45:40 UTC
Hi, thanks for the info! This is extremely helpful. I also found it documented in PPD repo: https://gitlab.freedesktop.org/upower/power-profiles-daemon#panel-power-savings

Closing this issue as it is not a KDE issue. There appears to be no way to configure values for ABM in PPD. I feel 3 is very aggressive and 2 would be more usable.