Bug 444298

Summary: Show an error message when applying the output configuration failed
Product: [Plasma] KScreen Reporter: Battler624
Component: commonAssignee: kscreen-bugs-null <kscreen-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: jean, xaver.hugl
Priority: NOR    
Version First Reported In: master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.3.0
Sentry Crash Report:
Attachments: drm_info as requested
wayland-session.log

Description Battler624 2021-10-23 23:08:07 UTC
SUMMARY
240hz refresh rate isn't being applied.

STEPS TO REPRODUCE
1. Open display configuration
2. Select 240 Hz
3. Press Apply

OBSERVED RESULT
Nothing Happens

EXPECTED RESULT
Refresh rate becomes 240hz


Linux/KDE Plasma: Arch
KDE Plasma Version: 5.23.1
KDE Frameworks Version: 5.87
Qt Version: 5.15
Kernel Version: 5.14.14-zen1-1-zen
Wayland

ADDITIONAL INFORMATION
It works fine on windows, didn't test on on any other DE or distros
If needed, I'll provide a phone recorded video showing the problem.
Comment 1 Vlad Zahorodnii 2021-10-25 07:07:11 UTC
How do you measure the frame rate? and what do you expect to see

> OBSERVED RESULT
> Nothing Happens
Comment 2 Battler624 2021-10-25 07:22:45 UTC
(In reply to Vlad Zahorodnii from comment #1)
> How do you measure the frame rate? and what do you expect to see
> 
> > OBSERVED RESULT
> > Nothing Happens

Easiest way for me is to simply look at the Monitor OSD
For example the currently the display info shows the following:
Model
Input
Current: 2560x1440, 200Hz
Maximum: 2560x1440, 240Hz.

Every refresh rate changes the current (if I choose 144hz the current will change) except 240hz which does nothing at all.
Comment 3 Vlad Zahorodnii 2021-10-25 15:48:55 UTC
It might be a bandwidth limitation. Can you please check wayland session logs after changing the refresh rate? the logs can be found at ~/.local/share/sddm/wayland-session.log (please remove any sensitive information before attaching it to the bug report)

Also, it will be helpful to have the output of `drm_info` (https://github.com/ascent12/drm_info). Most distros don't ship it, you would need to build it from source code or install from AUR if you use Arch. `drm_info` will print the actual mode set by kwin.
Comment 4 Battler624 2021-10-25 17:13:12 UTC
Created attachment 142858 [details]
drm_info as requested
Comment 5 Battler624 2021-10-25 17:13:26 UTC
Created attachment 142859 [details]
wayland-session.log
Comment 6 Battler624 2021-10-25 17:13:48 UTC
(In reply to Vlad Zahorodnii from comment #3)
> It might be a bandwidth limitation. Can you please check wayland session
> logs after changing the refresh rate? the logs can be found at
> ~/.local/share/sddm/wayland-session.log (please remove any sensitive
> information before attaching it to the bug report)
> 
> Also, it will be helpful to have the output of `drm_info`
> (https://github.com/ascent12/drm_info). Most distros don't ship it, you
> would need to build it from source code or install from AUR if you use Arch.
> `drm_info` will print the actual mode set by kwin.

I've done just that.
Comment 7 Vlad Zahorodnii 2021-10-26 06:23:29 UTC
Based on drm_info output

│   ├───CRTC 0
│   │   ├───Object ID: 53
│   │   ├───Mode: 2560x1440@199.99 driver phsync nvsync
│   │   ├───Gamma size: 256
│   │   └───Properties
│   │       ├───"ACTIVE" (atomic): range [0, 1] = 1
│   │       ├───"MODE_ID" (atomic): blob = 114
│   │       │   └───2560x1440@199.99 driver phsync nvsync


and wayland session log

  kwin_wayland_drm: crtc 53
  kwin_wayland_drm: 	"MODE_ID": 114->108

it indeed looks like kwin tries to change the mode with refresh rate of 199.99Hz to (I guess) 244Hz, but the atomic test only commit fails (perhaps due to bandwidth limitation?). Can you try unplugging the other output?
Comment 8 Vlad Zahorodnii 2021-10-26 06:29:39 UTC
Another thing that's worth testing is whether it's due to kwin not using modifiers. Can you add

  KWIN_DRM_USE_MODIFIERS=1

to your /etc/environment and reboot the computer?
Comment 9 Battler624 2021-10-26 11:19:33 UTC
(In reply to Vlad Zahorodnii from comment #7)
> Based on drm_info output
> 
> │   ├───CRTC 0
> │   │   ├───Object ID: 53
> │   │   ├───Mode: 2560x1440@199.99 driver phsync nvsync
> │   │   ├───Gamma size: 256
> │   │   └───Properties
> │   │       ├───"ACTIVE" (atomic): range [0, 1] = 1
> │   │       ├───"MODE_ID" (atomic): blob = 114
> │   │       │   └───2560x1440@199.99 driver phsync nvsync
> 
> 
> and wayland session log
> 
>   kwin_wayland_drm: crtc 53
>   kwin_wayland_drm: 	"MODE_ID": 114->108
> 
> it indeed looks like kwin tries to change the mode with refresh rate of
> 199.99Hz to (I guess) 244Hz, but the atomic test only commit fails (perhaps
> due to bandwidth limitation?). Can you try unplugging the other output?

Disconnecting the second monitor alone doesn't work, I was able to get it to work after disconnecting the second monitor and restarting then setting it to 240hz.

I guess its as you say, a bandwidth limitation, i'm running an RX580 on the PCIE16X_3 slot on the asus x570 dark hero which for some odd reason defaults to x4 according to the bios.
Comment 10 Vlad Zahorodnii 2021-10-26 12:28:40 UTC
Have you tried setting KWIN_DRM_USE_MODIFIERS to 1? This may result in framebuffers having compressed modifier, which is good in terms of bandwidth.
Comment 11 Battler624 2021-10-26 12:32:42 UTC
(In reply to Vlad Zahorodnii from comment #10)
> Have you tried setting KWIN_DRM_USE_MODIFIERS to 1? This may result in
> framebuffers having compressed modifier, which is good in terms of bandwidth.

Yea I tried that but it absolutely didn't do anything. (I just added it to the environment file directly as written, unless there is something else I need to do)
Comment 12 Bug Janitor Service 2021-11-10 04:39:24 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 13 Bug Janitor Service 2021-11-25 04:39:00 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 14 jean 2023-02-09 04:42:49 UTC
Hi, I have been having the same issue. I have a 2560x1440@240hz monitor, which KDE limits to 144hz. It may be a bandwidth issue, but it would be good for KDE to show that rather than showing a 'successful' switch to 240hz until I click out and back into the displays page.
Comment 15 Zamundaaa 2024-06-07 17:28:43 UTC
We unfortunately don't have enough information to show anything more than "failed", but we should at least show that
Comment 16 Zamundaaa 2025-01-10 16:22:35 UTC
This is fixed in Plasma 6.3, with https://invent.kde.org/plasma/kscreen/-/merge_requests/329