Bug 476060

Summary: Setting resolution to anything less than native resolution causes screen area to be reduced, rather than content to become blurry
Product: [Plasma] kwin Reporter: Nate Graham <nate>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: alex, xaver.hugl
Priority: NOR Keywords: qt6
Version: master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: It doesn't fill
drm_info

Description Nate Graham 2023-10-24 19:19:50 UTC
Created attachment 162546 [details]
It doesn't fill

Plasma 6 Wayland from git master with a 4K screen normally run at 200% scale. Ran into this while testing Bug 476002.


STEPS TO REPRODUCE
1. Have a 4K screen normally run at 200% scale
2. Right-click on desktop > Configure Display Settings
3. Set resolution to 1080p and scale to 100%


OBSERVED RESULT
Screen area is reduced to a one-quarter sized rectangle in the top-left corner of the physical screen. See attached screenshot.


EXPECTED RESULT
Screen area fills the entire physical screen, and content is slightly blurry due to the reduced resolution.


ADDITIONAL INFORMATION
Rebooting does not resolve the issue.
Comment 1 Zamundaaa 2023-10-27 15:55:34 UTC
On my laptop at least, KWin is doing everything correctly; the driver has some bugs with KWin-generated modes, but those are driver bugs.

Can you attach your drm_info while in a lower resolution mode, so that we can check if it's also a driver bug in your case?
Comment 2 Nate Graham 2023-10-27 20:22:14 UTC
Created attachment 162601 [details]
drm_info
Comment 3 Zamundaaa 2023-10-27 20:58:18 UTC
> │   ├───CRTC 0
> │   │   ├───Object ID: 51
> │   │   ├───Legacy info
> │   │   │   ├───Mode: 3840x2160@60.00 preferred driver phsync nvsync 

Interestingly, in your case the display mode is still 4k, so from a driver perspective, the result you're seeing is correct. Now we just need to find out why KWin doesn't set the correct mode... on my laptop it gets set correctly.
One possibility could be that the Intel driver doesn't require ALLOW_MODESET to change the mode on your display. If that's the case, then https://invent.kde.org/plasma/kwin/-/merge_requests/4495 should fix this
Comment 4 Nate Graham 2023-10-30 18:03:52 UTC
Yup, that fixes it for me.
Comment 5 Zamundaaa 2023-11-01 21:37:48 UTC
Git commit ff2bc0798fe659f6388cf54b6bf3ed0a26785b40 by Xaver Hugl.
Committed on 01/11/2023 at 22:29.
Pushed by zamundaaa into branch 'master'.

backends/drm: fix properties not being applied when a modeset is not needed

When testing whether or not a modeset is needed, all that gets tested is
whether or not the kernel would allow the commit to happen without the ALLOW_MODESET
flag. If there's properties that are only changed in DrmPipeline::prepareAtomicModeset,
we need to apply those in the next commit, regardless of whether or not
the ALLOW_MODESET flag is necessary.

M  +33   -19   src/backends/drm/drm_pipeline.cpp
M  +2    -0    src/backends/drm/drm_pipeline.h

https://invent.kde.org/plasma/kwin/-/commit/ff2bc0798fe659f6388cf54b6bf3ed0a26785b40
Comment 6 Nate Graham 2023-11-03 21:21:09 UTC
*** Bug 476470 has been marked as a duplicate of this bug. ***