Bug 460288 - second monitor image distorted on Wayland nouveau output, but pointer OK
Summary: second monitor image distorted on Wayland nouveau output, but pointer OK
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (show other bugs)
Version: 5.25.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2022-10-12 09:27 UTC by Vojtěch Látal
Modified: 2024-05-24 14:36 UTC (History)
3 users (show)

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


Attachments
photo of monitors (1.66 MB, image/jpeg)
2022-10-12 09:27 UTC, Vojtěch Látal
Details
software screenshot (1.53 MB, image/png)
2022-10-12 09:28 UTC, Vojtěch Látal
Details
drm_info output (124.13 KB, application/json)
2022-10-12 11:41 UTC, Vojtěch Látal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vojtěch Látal 2022-10-12 09:27:22 UTC
Created attachment 152733 [details]
photo of monitors

SUMMARY
Image produced by KWin on Wayland on nouveau output is distorted in kind of "interlaced way". See attached screenshot and photo of monitors.
Note the mouse cursor/pointer is rendered OK. While background and windows are not.

With Sway WM, it works flawlessly. The same with Wayfire. Plasma/X11 started kernel panicking (no Magic SysRq working) lately, before it was OK.

KWin/Wayland worked for me several months ago with just a little bug:
It appeared the same as now upon startup, but to correct the second output I had to do the following procedure:
1) Changing resolution to lower and then back to FullHD.
2) Move window from First screen to the second.
3) Voila! the output is corrected.

The procedure no longer fixes the output.

I have also tried attaching another monitor to another ouput of nouveau, the image there was distorted the same way.

What I have tried and found the bug is not in:
* Plasma/X11 works even with second monitor
* Sway/Wayland & Wayfire/Wayland works even with second monitor
* Plasma/Wayland with only internal display (possibly Intel output) works

STEPS TO REPRODUCE
1. Have nvidia card with nouveau driver.
2. Start the "Plasma (Wayland)" through DM (SDDM).
3. Observer result.

OBSERVED RESULT
Distorted image produced on second and following outputs in kind of "interlaced way". See attachments.

EXPECTED RESULT
Correct image produced on all outputs.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux up-to-date 
Operating System: Arch Linux
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6+kde+r177
Kernel Version: 5.19.13-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-2760QM CPU @ 2.40GHz
Memory: 23,4 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 3000
Manufacturer: LENOVO
Product Name: 4282CL7
System Version: ThinkPad W520

ADDITIONAL INFORMATION
$ lsmod | grep "nouv\|i915"
i915                 3387392  63
drm_buddy              20480  1 i915
intel_gtt              28672  1 i915
nouveau              2904064  5
mxm_wmi                16384  1 nouveau
drm_ttm_helper         16384  1 nouveau
ttm                    98304  3 drm_ttm_helper,i915,nouveau
drm_display_helper    192512  2 i915,nouveau
cec                    90112  2 drm_display_helper,i915
wmi                    40960  4 wmi_bmof,think_lmi,mxm_wmi,nouveau
video                  61440  3 thinkpad_acpi,i915,nouveau

$ lspci | grep VGA            
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GF108GLM [Quadro 1000M] (rev a1)

$ xrandr --listmonitors 
Monitors: 2
 0: +*XWAYLAND0 1920/340x1080/190+0+0  XWAYLAND0
 1: +XWAYLAND1 1920/510x1080/290+1920+0  XWAYLAND1
                                                                                        
$ xrandr --listproviders 
Providers: number : 0

Feel free to ask for more details. I would love to help with that.
Comment 1 Vojtěch Látal 2022-10-12 09:28:49 UTC
Created attachment 152734 [details]
software screenshot
Comment 2 Vlad Zahorodnii 2022-10-12 09:32:06 UTC
Can you check whether the issue is gone after setting KWIN_DRM_USE_MODIFIERS=0 envvar?
Comment 3 Vojtěch Látal 2022-10-12 09:53:10 UTC
(In reply to Vlad Zahorodnii from comment #2)
> Can you check whether the issue is gone after setting
> KWIN_DRM_USE_MODIFIERS=0 envvar?

Unfortunately has no positive impact.
Comment 4 Vojtěch Látal 2022-10-12 10:01:08 UTC
Other potentially related env variables.
$ env | grep -E -i "QT|KDE|PLASMA|KWIN|WAYLAND|WL|NVI|NOU|X11"
DESKTOP_SESSION=plasmawayland
KDE_APPLICATIONS_AS_SCOPE=1
KDE_FULL_SESSION=true
KDE_SESSION_UID=1000
KDE_SESSION_VERSION=5
KWIN_DRM_USE_MODIFIERS=0
PLASMA_USE_QT_SCALING=1
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_WAYLAND_FORCE_DPI=96
WAYLAND_DISPLAY=wayland-0
XDG_ACTIVATION_TOKEN=kwin-3
XDG_CONFIG_DIRS=/home/gary/.config/kdedefaults:/etc/xdg
XDG_CURRENT_DESKTOP=KDE
XDG_SESSION_DESKTOP=KDE
XDG_SESSION_TYPE=wayland
Comment 5 Zamundaaa 2022-10-12 10:50:24 UTC
Please attach the output of drm_info (https://github.com/ascent12/drm_info)
Can you also try with KWIN_DRM_PREFER_COLOR_DEPTH=24?
Comment 6 Vojtěch Látal 2022-10-12 11:41:00 UTC
(In reply to Zamundaaa from comment #5)
> Please attach the output of drm_info (https://github.com/ascent12/drm_info)
> Can you also try with KWIN_DRM_PREFER_COLOR_DEPTH=24?

Even this has no positive impact.
Comment 7 Vojtěch Látal 2022-10-12 11:41:25 UTC
Created attachment 152741 [details]
drm_info output
Comment 8 Vojtěch Látal 2022-10-13 11:49:14 UTC
Unfortunately no positive impact with:
KDE Plasma Version: 5.26
Comment 9 Vojtěch Látal 2022-10-16 09:47:46 UTC
The bug is present also in downgraded KWin 5.25.1 .
5.25.0 has black screen for me. And 5.24.5 needs further packages downgraded, which I haven't  done.

Are you sure it is the KWin package bug?
Are there any logs that could help to fix the bug?
Comment 10 Zamundaaa 2022-10-17 11:30:27 UTC
> Are you sure it is the KWin package bug?
I think if Plasma/X11 causes a kernel panic, and downgrading KWin doesn't change anything, you're almost certainly looking at a kernel bug (or multiple).
Comment 11 Vojtěch Látal 2022-10-17 17:26:20 UTC
Update: I'm back on Plasma/X11 since yesterday. So far it works right /knock knock/.
Nevertheless I'm ready to help with Plasma/Wayland, once something is needed.
Comment 12 Zamundaaa 2024-05-24 14:36:51 UTC
There's been significant improvements in the multi gpu handling in Plasma 6, so this is most likely fixed. In case you're still experiencing glitches, please reopen this