Bug 340862 - Screen flicker when opening certain windows, like Okular or YaST
Summary: Screen flicker when opening certain windows, like Okular or YaST
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 4.11.11
Platform: openSUSE Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-11 21:18 UTC by Angelos Skembris
Modified: 2014-11-13 20:35 UTC (History)
0 users

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


Attachments
output of "qdbus org.kde.KWin /KWin supportInformation" (4.76 KB, text/plain)
2014-11-11 23:01 UTC, Angelos Skembris
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Angelos Skembris 2014-11-11 21:18:03 UTC
I just upgraded from OpenSUSE 13.1 to 13.2 using the distribution upgrade mechanism, no issues there. 
After the upgrade, when I open certain windows like YaST or Okular, my primary monitor (out of 2) will do a momentary flicker before opening the window. This happens for particular windows (these two are just examples), while others (e.g. Mozilla, Chromium, LibreOffice, dolphin) do not cause the flicker. 

Also, when opening Okular the screen will flicker only when actually loading a PDF file - if I just open Okular's window with no file, the flicker does not happen. Also, opening a file with okular on the second screen will still cause the primary screen to flicker (the secondary does not).

I have tried creating a new user to check whether this happens with KDE's default settings and the flicker is still there. Disabling desktop effects made absolutely no difference. 



Reproducible: Always

Steps to Reproduce:
1. Open a YaST window or any PDF file with Okular
2.
3.

Actual Results:  
Window opens after a momentary flicker of the primary screen.

Expected Results:  
Window should open without any flicker

Using KDE 4.14.2 on OpenSUSE 13.2 with an ATI 4870 with the Radeon driver.
Comment 1 Thomas Lübking 2014-11-11 22:27:15 UTC
please attach the output of "qdbus org.kde.KWin /KWin supportInformation"

> Disabling desktop effects made absolutely no difference. 
This reads "suspending the compositor"? (press SHIFT+Alt+F12)
Comment 2 Angelos Skembris 2014-11-11 23:01:49 UTC
Created attachment 89547 [details]
output of "qdbus org.kde.KWin /KWin supportInformation"
Comment 3 Angelos Skembris 2014-11-11 23:12:05 UTC
(In reply to Thomas Lübking from comment #1)
> please attach the output of "qdbus org.kde.KWin /KWin supportInformation"
> 

I attached the output of the file.

> > Disabling desktop effects made absolutely no difference. 
> This reads "suspending the compositor"? (press SHIFT+Alt+F12)

That's right, suspending desktop effects either using the keyboard shortcut or using Configure Desktop  -> Desktop effects -> Enable desktop effects at startup makes no difference, the problem still occurs. 

If it makes any difference, I also have a laptop with Intel graphics that uses the latest" tumbleweed" version (again with KDE 4.14.2) with the same KDE theme and window decorations (but with a different pointer theme) and everything works fine. 

Also, my secondary monitor is rotated by 90 degrees (again, not sure if it makes any difference).
Comment 4 Thomas Lübking 2014-11-11 23:52:41 UTC
> That's right, suspending desktop effects either using the keyboard shortcut or using Configure Desktop  -> Desktop effects -> Enable desktop effects at startup makes no difference, the problem still occurs. 

It's not in the compositor then for sure.
Since you also have "kwin4_effect_fade" in the composited case, we can be pretty sure that the flicker is not related to "the window briefly showed up on one screen and then move to the other" (also the compositor waits a few miliseconds before displaying the window for this matter)

=> it's likely a driver issue, but unrelated to KWin or compositing.

- Are you using glamor acceleration? ("grep -i glamor /var/log/Xorg.0.log")
- The okular thing makes me wonder whether it's OpenGL (in the client) related - what about gwenview or something very simple as "glxgears"?
- Anything else special about yast + okular? (Fullscreen, maximized, just "huge")?
- What for a non rotated screen?
Comment 5 Angelos Skembris 2014-11-12 21:57:52 UTC
> => it's likely a driver issue, but unrelated to KWin or compositing.

Well, that seems reasonable. If you point me in the right direction, I'd be happy to submit a new bug report to whoever handles driver problems (openSUSE's bugzilla?)

> 
> - Are you using glamor acceleration? ("grep -i glamor /var/log/Xorg.0.log")

I don't think so, Xorg.0.log does not mention glamor (grep returns nothing), there is no relevant package installed and I haven't done anything manually (e.g. create a Xorg.conf file).  
 

> - The okular thing makes me wonder whether it's OpenGL (in the client)
> related - what about gwenview or something very simple as "glxgears"?

Well, gwenview and glxgears behave just fine. Both open without problems and no flicker is visible.


> - Anything else special about yast + okular? (Fullscreen, maximized, just
> "huge")?
Nothing I can think of, they are in windowed mode with no special settings (not fullscreen, not maximized, not really large or anything.

> - What for a non rotated screen?

That may be closer to the target When I open "Display configuration" from "Desktop Settings", I get the flicker. No other window in "Desktop Settings" will do that, only "Display configuration". 

Also, the second monitor's rotation is not reported correctly. It is shown in "Normal" orientation, not rotated as it should be. Setting it to rotated does nothing in particular except show the miniature screen in rotated mode (i.e. nothing changes), but if I close and reopen the "Display configuration", it is again shown in "normal" orientation. 

I have also tried the following:
* The "Unify inputs" option
* Disabling the monitor (using the tick box option)
* Other screen orientations

In all cases, the flicker was still there when opening YaST. Just to clarify, the flicker appears when the actual YaST window appears, not when the first window asking for the root password appears.

I am going to try rebooting with the second monitor disconnected after posting this, see if there is any difference. 

Could it be that Okular or YaST do some sort of screen polling to determine screen settings and that's when the flicker takes place? It would be consistent with the flicker appearing in the case of "Display Configuration".
Comment 6 Angelos Skembris 2014-11-12 22:07:26 UTC
Disabling the second monitor altogether (i.e. unplugging it while the computer is powered down) made no difference at all, the flicker is still there.
Comment 7 Angelos Skembris 2014-11-12 22:18:15 UTC
We are getting there. Every time I open one of the flicker-causing windows, Xorg.0.log gets updated with the following lines:

[   589.231] (II) RADEON(0): EDID vendor "GSM", prod id 19157
[   589.231] (II) RADEON(0): Using hsync ranges from config file
[   589.231] (II) RADEON(0): Using vrefresh ranges from config file
[   589.231] (II) RADEON(0): Printing DDC gathered Modelines:
[   589.231] (II) RADEON(0): Modeline "1280x1024"x0.0  108.00  1280 1328 1440 1688  1024 1025 1028 1066 +hsync +vsync (64.0 kHz eP)
[   589.231] (II) RADEON(0): Modeline "800x600"x0.0   40.00  800 840 968 1056  600 601 605 628 +hsync +vsync (37.9 kHz e)
[   589.231] (II) RADEON(0): Modeline "640x480"x0.0   31.50  640 656 720 840  480 481 484 500 -hsync -vsync (37.5 kHz e)
[   589.231] (II) RADEON(0): Modeline "640x480"x0.0   25.18  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz e)
[   589.231] (II) RADEON(0): Modeline "720x400"x0.0   28.32  720 738 846 900  400 412 414 449 -hsync +vsync (31.5 kHz e)
[   589.231] (II) RADEON(0): Modeline "1024x768"x0.0   78.75  1024 1040 1136 1312  768 769 772 800 +hsync +vsync (60.0 kHz e)
[   589.231] (II) RADEON(0): Modeline "1024x768"x0.0   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync (48.4 kHz e)
[   589.231] (II) RADEON(0): Modeline "832x624"x0.0   57.28  832 864 928 1152  624 625 628 667 -hsync -vsync (49.7 kHz e)
[   589.231] (II) RADEON(0): Modeline "800x600"x0.0   49.50  800 816 896 1056  600 601 604 625 +hsync +vsync (46.9 kHz e)
[   589.231] (II) RADEON(0): Modeline "1152x864"x0.0  108.00  1152 1216 1344 1600  864 865 868 900 +hsync +vsync (67.5 kHz e)

This only happens with the offending windows, other windows do not cause the log file to be updated. They seem indeed to be related to the second monitor, as that is the one with the 1280x1024 max resolution (the other one is 1680x1050).

Any ideas?
Comment 8 Angelos Skembris 2014-11-12 22:20:25 UTC
The same lines are added to Xorg.0.log (and the flicker happens) when I run xrandr -q from a terminal window.
Comment 9 Thomas Lübking 2014-11-12 23:06:44 UTC
"1280x1024"x0.0
Your screen is running at 0Hz  ;-)

To be sure: what's the output of "xrandr -q"?

Also see https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/147073 resp. https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/134365
Do you have a zombie Tv connector in the ouptut?
Comment 10 Angelos Skembris 2014-11-13 19:13:03 UTC
Output of xrandr -q:

Screen 0: minimum 320 x 200, current 2704 x 1280, maximum 8192 x 8192
DVI-0 connected primary 1680x1050+0+0 (normal left inverted right x axis y axis) 474mm x 296mm
   1680x1050     59.95*+
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1152x864      75.00  
   1024x768      75.08    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   640x480       75.00    72.81    66.67    60.00  
   720x400       70.08  
DIN disconnected (normal left inverted right x axis y axis)
DVI-1 connected 1024x1280+1680+0 left (normal left inverted right x axis y axis) 376mm x 301mm
   1280x1024     60.02*+
   1152x864      75.00  
   1024x768      75.08    75.03    60.00                                                                    
   832x624       74.55  
   800x600       75.00    60.32  
   640x480       75.00    60.00  
   720x400       70.08  

It does have a DIN connector, which I think outputs a TV out signal. 
I will try disabling it using xorg.conf (if possible, I will have to search around and see how to do that) and report any results.
Comment 11 Angelos Skembris 2014-11-13 19:48:09 UTC
Success! The flicker gone! Thank you very much for all your help!

For the benefit of search engine (and, like myself, not terribly experienced  users), I modified /etc/X11/xorg.conf.d/50-monitor.conf as follows:

# Having multiple "Monitor" sections is known to be problematic. Make
# sure you don't have in use another one laying around e.g. in another
# xorg.conf.d file or even a generic xorg.conf file. More details can
# be found in https://bugs.freedesktop.org/show_bug.cgi?id=32430.
#

Section "Monitor"
  Identifier "DIN"
  Option "Ignore" "True"

EndSection

Last question: Should I report the problem with xrandr to anyone so that they may have a look at it - update the list with the "quirky" chipsets I read in the other bug reports you pointed out? 

Thank you again!
Comment 12 Thomas Lübking 2014-11-13 20:35:42 UTC
Many thanks for the feedback.
The linked bugs will likely only cause a workaround (in ubuntu) - if at all (simply ignoring TVs or other outputs would likely cause more bugreports...)

The actual bug would either be in libxrandr, the radeon driver (though there're apparently intel reports as well, the bad code could just be duplicated) or kernel module.

You'd be best of to file a bug against libxrandr (https://bugs.freedesktop.org/) and have them wire it down to the driver/kernel module in case.

xrandr is just an innocent client binary, like systemsettings, yast or okular.
(Latter has some feature to display presentations on a specific screen, it probably checks for attached projectors or TVs or similar)