Bug 107521

Summary: XWayland misrendering when switching from gui applications from maximized to half screen
Product: xorg Reporter: Mark Janes <mark.a.janes>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED MOVED QA Contact: Xorg Project Team <xorg-team>
Severity: blocker    
Priority: medium CC: daniel, jason, mark.a.janes
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
tiling corruption video
none
Patch none

Description Mark Janes 2018-08-07 21:47:37 UTC
Created attachment 141005 [details]
tiling corruption video

Reproduced with:

 - firefox and firefox-esr
 - thunderbird
 - konsole
 - emacs

When running Gnome on XWayland, tiling corruption can be seen by rapidly switching the windowing position from "maximize" to "view split on left" and "view split on right"

With default Gnome shortcuts, launch Firefox, and rapidly press super-up / super-left / super-down / super-right.  As the window moves around the screen, you should soon see mis-rendered tiled pixels all over the screen.

My setup is Debian testing on SKL GT2:
xwayland/testing,now 2:1.20.0-3
lib*-mesa/testing,now 18.1.4-1

I also tested with mesa master
ba1ebf2ee12 python: Specify the template output encoding

No corruption is seen when running with X instead of XWayland.
Comment 1 Daniel Stone 2018-08-07 21:52:32 UTC
Jason, any bright ideas? I don't really know the relevant codepaths at all.
Comment 2 Denis 2018-08-08 16:48:32 UTC
Hi. I also can reproduce the issue on this configuration (quite similar to your):

CPU model name: Intel(R) Core(TM) i7-7700U CPU @ 4.20GHz
HD Graphics 620 (Kaby Lake GT2)
Operating System: Debian GNU/Linux buster/sid
Kernel: Linux 4.17.0-1-amd64
GNOME Shell 3.28.3
xwayland 1.20
Mesa 18.1.5

In addition to provided list checked and chromium - it behaves at the most crazy way - you need to put it to the windows mode (somewhere in the middle of the screen) and drag with mouse - you will see big black parts on it, or same corruptions, which were provided by Mark)
Comment 3 vadym 2018-08-08 16:49:58 UTC
Able to reproduce this on KBL as well. But for me same issue is also reproducible with the llvmpipe:

LIBGL_ALWAYS_SOFTWARE=true /usr/bin/firefox
Comment 4 vadym 2018-08-09 10:14:18 UTC
Bug is reproduced only with apps which are using XWayland. Otherwise if app using Wayland natively bug is not reproduced.

With XWayland downgraded to 1.19.2-1 version issue is gone. So looks like this is a regression in Xwayland.
Comment 5 vadym 2018-08-09 16:05:41 UTC
Created attachment 141025 [details] [review]
Patch
Comment 6 vadym 2018-08-09 16:09:15 UTC
Issue bisected in Xserver:

726839459cb887a60361cb4779f9871c03f372b1 is the first bad commit
commit 726839459cb887a60361cb4779f9871c03f372b1
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Mar 28 16:11:18 2018 -0400

    autotools: Derive xkb configuration from xkbcomp.pc
    
    ... if available, falling back to the current heuristics otherwise. This
    _finally_ gets me to being able to run util/modular/release.sh without
    overriding $prefix.
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>


Problem is that bindir variable is absent in /usr/share/pkgconfig/xkbcomp.pc.
And this case is handled incorrectly in configure file in the following line:

pkg-config --variable bindir xkbcomp || echo ${bindir}

Patch with fix is attached.
Comment 7 Denis 2018-08-09 16:21:47 UTC
Applied the patch and build Xwayland using this manual https://wayland.freedesktop.org/ubuntu16.04.html

Upd - after exchanging your original Xwayland with a new one - need to reboot - log off will not work.
I couldn’t reproduce the issue then.

Video with patch available in link below:

https://drive.google.com/open?id=1SMJD14e7E1FGKNGp-TMHZjLVHsdrQFvC
Comment 8 Adam Jackson 2018-08-09 17:16:44 UTC
Applied the above xkbcomp patch, for what it's worth; I don't claim to know whether this bug is fixed though, and I'm seriously baffled how xkbcomp could be responsible.
Comment 9 GitLab Migration User 2018-12-13 22:40:34 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/545.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.