Bug 365799 - Graphical corruption and display stops updating when connecting external monitor through HDMI
Summary: Graphical corruption and display stops updating when connecting external moni...
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: glx (show other bugs)
Version: 5.7.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-18 05:20 UTC by Artur O.
Modified: 2016-08-17 06:55 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
mgraesslin: Intel+


Attachments
kwin system log (50.43 KB, text/plain)
2016-07-18 08:43 UTC, Artur O.
Details
Xrandr when running only laptop (803 bytes, text/plain)
2016-07-18 17:45 UTC, Artur O.
Details
xrandr with external screen (1.24 KB, text/plain)
2016-07-18 17:46 UTC, Artur O.
Details
kwin when screen corruption occur after unplugging external screen (3.06 KB, text/plain)
2016-07-18 17:48 UTC, Artur O.
Details
glxinfo for ref (24.62 KB, text/plain)
2016-07-19 20:29 UTC, Artur O.
Details
kwin system log (56.88 KB, text/plain)
2016-07-19 20:30 UTC, Artur O.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Artur O. 2016-07-18 05:20:34 UTC
Laptop: Asus Zenbok UX32VD

I cannot remember when it started but it was sometimes after the Plasma 2 (I think). When connecting an external display through HDMI the laptop screen stops updating while the second monitor works fine. 

Using Kwin_X11 --replace after connecting the second screen mostly fixes this however sometimes after a while i get weird graphical corruption, like an old TV monitor (CRT) from the 90's in horror movies that it flashes and weird visual screen noise occurring. Drop-down terminal that just flashes and shows partially. 

Doing an kwin replace fixes this, switching to another backend from GLX to EGL mitigates things ie, wont trigger the screen freeze on HDMI connection and also does not have those graphical corruptions but it dooes not update/repaint windows correctly all the time.

Reproducible: Always

Steps to Reproduce:
1. UX32VD ready
2. Connect something to HDMI
3. Laptop Screen freezes

Actual Results:  
Screen stops updating on laptop, and or graphical corruption...

Expected Results:  
working environment.
Comment 1 Martin Flöser 2016-07-18 05:51:13 UTC
could you please provide the output of: qdbus org.kde.KWin /KWin supportInformation

when the rendering is wrong and after restarting KWin. Please also provide the output of xrandr.
Comment 2 Artur O. 2016-07-18 08:43:29 UTC
Created attachment 100146 [details]
kwin system log
Comment 3 Martin Flöser 2016-07-18 09:02:10 UTC
Does the problem also happen if you use OpenGL 2 in Compositing settings?
Comment 4 Artur O. 2016-07-18 17:44:16 UTC
(In reply to Martin Gräßlin from comment #3)
> Does the problem also happen if you use OpenGL 2 in Compositing settings?

Yes, tried it now once more since i could not remember, it even kept the laptop screen frozen after unplugging once.

1: Plug in screen -> laptop screen freezes, while the plugged in screen works 
2: (kwin_x11 --replace)
3: now works
4: unplugg new screen
5: screen repaints, however visual flickering/corruption occurs
6: (kwin_x11 --replace
7: now works

Same for opengl 2.0, however in kwin console i see:
OpenGL version: 3.0 instead of 3.3 when running replace when using 2.0 compositor settings instead of 3.1.
Comment 5 Artur O. 2016-07-18 17:45:10 UTC
Created attachment 100155 [details]
Xrandr when running only laptop
Comment 6 Artur O. 2016-07-18 17:46:40 UTC
Created attachment 100156 [details]
xrandr with external screen
Comment 7 Artur O. 2016-07-18 17:48:45 UTC
Created attachment 100157 [details]
kwin when screen corruption occur after unplugging external screen
Comment 8 Artur O. 2016-07-18 17:51:10 UTC
(In reply to Artur O. from comment #7)
> Created attachment 100157 [details]
> kwin when screen corruption occur after unplugging external screen

most of these errors show up even after --replace and no visual errors occur. Only new in this one is;
QXcbConnection: XCB error: 3 (BadWindow), sequence: 10168, resource id: 35651862, major code: 15 (QueryTree), minor code: 0

But not sure if this is even related or just coincidence.
Comment 9 Artur O. 2016-07-18 17:54:47 UTC
Here is a link to the video corruption I'm talking about
https://www.youtube.com/watch?v=x8fBxuncT9k
Comment 10 Thomas Lübking 2016-07-19 08:17:27 UTC
The corruption looks very much like a driver bug, you see the buffer tiles which partially contain junk.
Could be a buffer_age issue - check glxinfo for general support and in case
KWIN_USE_BUFFER_AGE=0 kwin_x11 --replace &

https://community.kde.org/KWin/Environment_Variables#KWIN_USE_BUFFER_AGE

On
> laptop screen stops updating while the second monitor works fine

Can you please dump the supportInformation again, but this time after attaching the screen and when one screen is dead (given that kwin actually responds in this state)
Also, does restarting the compositor (SHIFT+Alt+F12, twice) resolve the state as well?

---
nb: this is on Qt 5.7.0 ...
Comment 11 Martin Flöser 2016-07-19 10:39:34 UTC
also give a try to use the (default) OpenGL 2 compositor. OpenGL 3 can create problems with Intel GPUs.
Comment 12 Artur O. 2016-07-19 20:25:03 UTC
(In reply to Thomas Lübking from comment #10)
> The corruption looks very much like a driver bug, you see the buffer tiles
> which partially contain junk.
> Could be a buffer_age issue - check glxinfo for general support and in case
> KWIN_USE_BUFFER_AGE=0 kwin_x11 --replace &
> 
> https://community.kde.org/KWin/Environment_Variables#KWIN_USE_BUFFER_AGE
> 
> On
> > laptop screen stops updating while the second monitor works fine
> 
> Can you please dump the supportInformation again, but this time after
> attaching the screen and when one screen is dead (given that kwin actually
> responds in this state)
> Also, does restarting the compositor (SHIFT+Alt+F12, twice) resolve the
> state as well?
> 
> ---
> nb: this is on Qt 5.7.0 ...

Well I  played with this at work today. 

* You can drag/move windows when its "frozen", mouse updates as usual when draging occurs just it won't update the screen/window position other than the mouse.

* When toggling compositing with with the combination the moment you turn compositing off the screen updates quickly as nothing has happend. The freeze will also only occur when compositing is enabled. Turning compositing off with the combination and then plugging in the external monitor just works.

* I tried the 'KWIN_USE_BUFFER_AGE=0 kwin_x11 --replace &' but the corruption still occurs.
Comment 13 Artur O. 2016-07-19 20:29:00 UTC
Created attachment 100182 [details]
glxinfo for ref

It supports bugger age it seems, but wanted to just include whole glxinfo just for ref.
Comment 14 Artur O. 2016-07-19 20:30:38 UTC
Created attachment 100183 [details]
kwin system log

The systemlog as requested (after the freezing occurs), but not sure if needed now that this seems to be a compositing issue?
Comment 15 Thomas Lübking 2016-07-19 22:42:40 UTC
I wanted to see KWin's opinion on the screen config ;-)

==> Did you try OpenGL 2.0?

Ftr, GLX_EXT_buffer_age is *not* supported (the listing in client extensions is insufficient, one would expect it in server and general extensions as well)
Comment 16 Artur O. 2016-08-16 20:32:51 UTC
(In reply to Thomas Lübking from comment #15)
> I wanted to see KWin's opinion on the screen config ;-)
> 
> ==> Did you try OpenGL 2.0?
> 
> Ftr, GLX_EXT_buffer_age is *not* supported (the listing in client extensions
> is insufficient, one would expect it in server and general extensions as
> well)

Well after playing around and searching i found some help in #archlinux channel. Uninstalling xf86-video-intel drivers solved my issues. No more corruption and no more freezing when connecting/disconnecting monitor.
Comment 17 Martin Flöser 2016-08-17 06:55:09 UTC
ok, we put it on the list of broken things with Intel xorg driver.