Bug 385655

Summary: Multiscreen is broken on Wayland
Product: [Plasma] kwin Reporter: Kamil Piwowarski <9luty1992>
Component: platform-drmAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: 9luty1992, simonandric5
Priority: NOR    
Version: 5.11.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: kscreen-console (afret starting session)
kscreen-doctor -o (after starting session)
kscreen-console (after change)
kscreen-doctor -o (afterchange)
Screenshot (after starting session)
Screenshon (after change)
Photo of VGA output (right)
Photo of LVDS output (center)
Photo of HDMI output (left)
Firefox on all screens (HDMI & LVDS)
Firefox on all screens (LVDS & VGA)
qdbus org.kde.KWin /KWin supportInformation
Desktop Effects (broken window)

Description Kamil Piwowarski 2017-10-12 13:32:50 UTC
Created attachment 108299 [details]
kscreen-console (afret starting session)

Tested on KDE neon 5.11 live session.

Hardware:
CPU: Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
GPU: 3rd Gen Core processor Graphics Controller

STEPS:
1. Run live session of KDE neon user edition
2. Install plasma-workspace-wayland and kscreen-doctor
3. Logout and login to wayland session
4. Almost everything is ok (welcome splash screen is broken - displays only on LVDS-1 and part of it on HDMI)
5. Attachments: kscreen-doctor.1.txt kscreen-console.1.txt
6. Open Displays Setting, move HDMI to the left and aling LVDS-1 to bottom. Apply settings.
7. LVDS-1 is broken - black offset at the top, desktop is displayed at the bottom of the screen. Mouse pointer is moving normally, and the same is with input (attached video).
8. Attachments: kscreen-doctor.2.txt kscreen-console.2.txt
Comment 1 Kamil Piwowarski 2017-10-12 13:34:36 UTC
Created attachment 108300 [details]
kscreen-doctor -o (after starting session)
Comment 2 Kamil Piwowarski 2017-10-12 13:36:45 UTC
Created attachment 108301 [details]
kscreen-console (after change)
Comment 3 Kamil Piwowarski 2017-10-12 13:37:09 UTC
Created attachment 108302 [details]
kscreen-doctor -o (afterchange)
Comment 4 Kamil Piwowarski 2017-10-12 13:39:45 UTC
Created attachment 108303 [details]
Screenshot (after starting session)
Comment 5 Kamil Piwowarski 2017-10-12 13:40:56 UTC
Created attachment 108304 [details]
Screenshon (after change)
Comment 6 Kamil Piwowarski 2017-10-12 13:49:31 UTC
Created attachment 108305 [details]
Photo of VGA output (right)
Comment 7 Kamil Piwowarski 2017-10-12 13:50:12 UTC
Created attachment 108306 [details]
Photo of LVDS output (center)
Comment 8 Kamil Piwowarski 2017-10-12 13:50:49 UTC
Created attachment 108307 [details]
Photo of HDMI output (left)
Comment 9 Kamil Piwowarski 2017-10-12 13:53:03 UTC
Videos: https://photos.app.goo.gl/2B0CYEpTdxqDAaLX2
Comment 10 Kamil Piwowarski 2017-10-12 13:55:23 UTC
Created attachment 108308 [details]
Firefox on all screens (HDMI & LVDS)
Comment 11 Kamil Piwowarski 2017-10-12 13:55:50 UTC
Created attachment 108309 [details]
Firefox on all screens (LVDS & VGA)
Comment 12 Martin Flöser 2017-10-12 16:22:15 UTC
could you please provide the output of:
qdbus org.kde.KWin /KWin supportInformation

for when it is broken? In KWin we don't have any use of the KScreen log.
Comment 13 Kamil Piwowarski 2017-10-12 16:38:35 UTC
It's broken for me from the time when first time I was trying to run wayland session (Plasma 5.8 on KDE Neon). I didn't report that, but today I downloaded latest Plasma and I've tested that again and I've finally submitted that bug report. I will add that output later today - now I am far away from home and I can't plug external displays. I will also report next bugs (disabling screen also is broken and welcome splash screen has wrong size and is displayed only on one screen).
Comment 14 Kamil Piwowarski 2017-10-12 18:42:05 UTC
Created attachment 108315 [details]
qdbus org.kde.KWin /KWin supportInformation
Comment 15 Martin Flöser 2017-10-12 19:09:12 UTC
Could you try to disable blur and contrast effect?
Comment 16 Martin Flöser 2017-10-12 19:10:37 UTC
> welcome splash screen has wrong size and is displayed only on one screen).

No need to report: I just created a patch for it: https://phabricator.kde.org/D8268
Comment 17 Kamil Piwowarski 2017-10-12 19:28:06 UTC
Created attachment 108319 [details]
Desktop Effects (broken window)

I've disabled effects (bg contrast and blur) and the problem is still there. When you align all screens to top everything is ok.

(In new settings Desktop Effects module is broken when you resize window - attachment).

I've submitted next bug report here about identifying displays: https://bugs.kde.org/show_bug.cgi?id=385672
Comment 18 Martin Flöser 2017-10-13 04:21:20 UTC
Ok, looks like the viewport gets wrong. I hope I can reproduce this with my two screens.
Comment 19 Kamil Piwowarski 2017-10-15 18:13:38 UTC
(In reply to Martin Flöser from comment #18)
> Ok, looks like the viewport gets wrong. I hope I can reproduce this with my
> two screens.

Let me know if I can help in any way with that (kwin debug). I know C++ very little, but I can compile kwin myself and use some qDebug().
Comment 20 David Edmundson 2017-10-25 22:14:22 UTC
Git commit 5d7e22e5dcf8981f9ba65088b81c1c6d456efef3 by David Edmundson.
Committed on 25/10/2017 at 22:13.
Pushed by davidedmundson into branch 'Plasma/5.11'.

Fix viewport on vertically stacked monitors

Summary:
We want to translate by the monitor position, so that needs to be
the negative of the position.

But Kwin/KScreen treats 0 as the top of all monitors. GL treats 0 as
bottom, so that all needs inverting.

Hence this should be a positive y value for the viewport.
Related: bug 386099

Test Plan:
Had two monitors
Side by side was - fine
Stacked vertically - still fine

Modded X code to extend in y instead of x.
3 monitors worked fine.

Nested wayland only seems to support one screen?

Reviewers: #plasma

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8479

M  +1    -1    plugins/platforms/drm/egl_gbm_backend.cpp
M  +1    -1    plugins/platforms/x11/windowed/egl_x11_backend.cpp

https://commits.kde.org/kwin/5d7e22e5dcf8981f9ba65088b81c1c6d456efef3