Bug 346235 - Kwin+intel makes a mess in screen on resolution change or double monitor is connected
Summary: Kwin+intel makes a mess in screen on resolution change or double monitor is c...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: git master
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL: https://drive.google.com/file/d/0B_Dg...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-15 19:47 UTC by André M
Modified: 2015-04-23 17:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 6d31775ee80b4afee09473c134cc68aabe48f57c


Attachments
glxinfo -l (25.82 KB, text/plain)
2015-04-16 14:11 UTC, André M
Details
output of xrandr -q --verbose (3.35 KB, text/plain)
2015-04-16 16:07 UTC, André M
Details
screenshot of glitch without screenshot module loaded (179.03 KB, image/png)
2015-04-16 21:19 UTC, André M
Details

Note You need to log in before you can comment on or make changes to this bug.
Description André M 2015-04-15 19:47:32 UTC
<Links for screenshot and glxinfo.txt in the end>
Regions of screen/texture are overlapping, a lot of artifacts and glitches, just some parts of screen are updated when e.g. moving window or alt-tab'ing. See attached screenshot for better understanding.
In this case, I changed resolution from 1366x768 to 1024x768, then took the screenshot. Note that screenshot size is 1366x768, while my screen was set to 1024x768. Region of monitor used in smaller resolution is limited to right resolution (i.e. black borders from both sides, image on center), but central region is in this state. 
- I tried all possible combinations of GLX/EGL and OpenGL 2/3.1. Same result.
- Going back (blindly) to original resolution makes the screen go normal again.
- Quitting plasma session while in small resolution and logging in again makes kwin use just the smaller area of the screen, in the right resolution (so is a resolution change problem).
- Connecting an external monitor also triggers the problem.
- It isn't a problem with intel driver only, tried changing resolution in enlightenment+opengl compositing and everything gone as expected (desktop functional, smaller desktop resolution in center of screen).

Reproducible: Always

Steps to Reproduce:
1. Open Display dialog (kscreen)
2. Change resolution
3. Apply

Actual Results:  
Screen becomes a mess of textures and glitches, unusable (but responsible) desktop

Expected Results:  
Resolution changed, screen resized to new resolution, windows and desktops resized to fit new desktop size.

Screenshot: https://drive.google.com/file/d/0B_Dgt6nSyjwgUlRrcXFhWVVZWjQ/view?usp=sharing
glxinfo: https://drive.google.com/file/d/0B_Dgt6nSyjwgMTB3YlJxcUJYams/view?usp=sharing

Arch Linux current, kernel x86_64 4.0.0-2, xf86-video-intel 2.99.917-5, mesa 10.5.3
kf5 git from this week, plasma5 git packages compiled yesterday (kwin 5.3.90 from git master from yesterday), but bug is present since at least 2 weeks ago (first time using kwin5 that tried changing resolution and faced this issue).
CPU Intel Core i5-3210M 3rd gen, graphic card from CPU.
Comment 1 Martin Flöser 2015-04-16 06:09:47 UTC
please provide output of:
qdbus org.kde.KWin /KWin supportInformation

ideally when the problem is present.
Comment 2 Thomas Lübking 2015-04-16 11:39:51 UTC
Also, if "git master" is correct, you may want to give https://bugs.kde.org/show_bug.cgi?id=345532#c2 a try. (Does it for me, but there may be different issues here)
Comment 3 André M 2015-04-16 13:30:37 UTC
(In reply to Martin Gräßlin from comment #1)
> please provide output of:
> qdbus org.kde.KWin /KWin supportInformation
> 
> ideally when the problem is present.

KWin Support Information:
The following information should be used when requesting support on e.g. http://forum.kde.org.
It provides information about the currently running instance, which options are used,
what OpenGL driver and which effects are running.
Please post the information provided underneath this introductory text to a paste bin service
like http://paste.kde.org instead of pasting into support threads.

==========================

Version
=======
KWin version: 5.3.90
Qt Version: 5.4.1
Qt compile version: 5.4.1
XCB compile version: 1.11

Operation Mode: X11 only

Build Options
=============
KWIN_BUILD_DECORATIONS: yes
KWIN_BUILD_TABBOX: yes
KWIN_BUILD_ACTIVITIES: yes
HAVE_WAYLAND: yes
HAVE_WAYLAND_EGL: yes
HAVE_WAYLAND_CURSOR: yes
HAVE_XKB: yes
HAVE_INPUT: yes
HAVE_XCB_CURSOR: yes
HAVE_XCB_SYNC: yes
HAVE_X11_XCB: yes

X11
===
Vendor: The X.Org Foundation
Vendor Release: 11701000
Protocol Version/Revision: 11/0
SHAPE: yes; Version: 0x11
RANDR: yes; Version: 0x14
DAMAGE: yes; Version: 0x11
Composite: yes; Version: 0x4
RENDER: yes; Version: 0xb
XFIXES: yes; Version: 0x50
SYNC: yes; Version: 0x31
GLX: yes; Version: 0x0

Decoration
==========
Plugin: org.kde.breeze
Theme: 
Blur: 0
onAllDesktopsAvailable: true
alphaChannelSupported: true
closeOnDoubleClickOnMenu: false
decorationButtonsLeft: 0, 9, 2
decorationButtonsRight: 6, 3, 4, 5
borderSize: 3
gridUnit: 10
font: Oxygen,10,-1,5,50,0,0,0,0,0
smallSpacing: 2
largeSpacing: 10

Options
=======
focusPolicy: 0
nextFocusPrefersMouse: false
clickRaise: true
autoRaise: false
autoRaiseInterval: 0
delayFocusInterval: 0
shadeHover: false
shadeHoverInterval: 250
separateScreenFocus: false
placement: 4
focusPolicyIsReasonable: true
borderSnapZone: 10
windowSnapZone: 10
centerSnapZone: 0
snapOnlyWhenOverlapping: false
rollOverDesktops: true
focusStealingPreventionLevel: 0
legacyFullscreenSupport: false
operationTitlebarDblClick: 5000
operationMaxButtonLeftClick: 5000
operationMaxButtonMiddleClick: 5015
operationMaxButtonRightClick: 5014
commandActiveTitlebar1: 0
commandActiveTitlebar2: 30
commandActiveTitlebar3: 2
commandInactiveTitlebar1: 4
commandInactiveTitlebar2: 30
commandInactiveTitlebar3: 2
commandWindow1: 4
commandWindow2: 8
commandWindow3: 8
commandWindowWheel: 31
commandAll1: 10
commandAll2: 3
commandAll3: 14
keyCmdAllModKey: 16777251
showGeometryTip: true
condensedTitle: false
electricBorderMaximize: true
electricBorderTiling: true
electricBorderCornerRatio: 0.25
borderlessMaximizedWindows: false
killPingTimeout: 5000
hideUtilityWindowsForInactive: false
inactiveTabsSkipTaskbar: false
autogroupSimilarWindows: false
autogroupInForeground: true
compositingMode: 1
useCompositing: true
compositingInitialized: true
hiddenPreviews: 1
unredirectFullscreen: false
glSmoothScale: 1
colorCorrected: false
xrenderSmoothScale: false
maxFpsInterval: 16666666
refreshRate: 0
vBlankTime: 6000000
glStrictBinding: false
glStrictBindingFollowsDriver: true
glCoreProfile: true
glPreferBufferSwap: 101
glPlatformInterface: 2

Screen Edges
============
desktopSwitching: false
desktopSwitchingMovingClients: false
cursorPushBackDistance: 1x1
timeThreshold: 150
reActivateThreshold: 350
actionTopLeft: 0
actionTop: 0
actionTopRight: 0
actionRight: 0
actionBottomRight: 0
actionBottom: 0
actionBottomLeft: 0
actionLeft: 0

Screens
=======
Multi-Head: no
Active screen follows mouse:  no
Number of Screens: 1
Screen 0 Geometry: 0,0,1024x768

Compositing
===========
Compositing is active
Compositing Type: OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile 
OpenGL version string: 3.3 (Core Profile) Mesa 10.5.3
OpenGL platform interface: EGL
OpenGL shading language version string: 3.30
Driver: Intel
GPU class: IvyBridge
OpenGL version: 3.3
GLSL version: 3.30
Mesa version: 10.5.3
X server version: 1.17.1
Linux kernel version: 4.0
Direct rendering: Requires strict binding: no
GLSL shaders:  yes
Texture NPOT support:  yes
Virtual Machine:  no
OpenGL 2 Shaders are used
Painting blocks for vertical retrace:  no

Loaded Effects:
---------------
zoom
slidingpopups
kwin4_effect_login
flipswitch
slide
screenshot
minimizeanimation
kwin4_effect_scalein
desktopgrid
kwin4_effect_translucency
coverswitch
kwin4_effect_maximize
kwin4_effect_fade
presentwindows
highlightwindow
kwin4_effect_dialogparent
blur
contrast
logout
dashboard
windowgeometry
startupfeedback
screenedge
kscreen

Currently Active Effects:
-------------------------
kwin4_effect_translucency
blur
contrast

Effect Settings:
----------------
zoom:
zoomFactor: 1.2
mousePointer: 0
mouseTracking: 0
enableFocusTracking: false
followFocus: true
focusDelay: 350
moveFactor: 20
targetZoom: 1

slidingpopups:
fadeInTime: 150
fadeOutTime: 250

kwin4_effect_login:

flipswitch:
tabBox: false
tabBoxAlternative: true
duration: 200
angle: 30
xPosition: 0.330000013113022
yPosition: 1
windowTitle: true

slide:

screenshot:

minimizeanimation:

kwin4_effect_scalein:

desktopgrid:
zoomDuration: 300
border: 10
desktopNameAlignment: 0
layoutMode: 0
customLayoutRows: 2
usePresentWindows: true

kwin4_effect_translucency:

coverswitch:
animationDuration: 200
animateSwitch: true
animateStart: true
animateStop: true
reflection: true
windowTitle: true
zPosition: 900
primaryTabBox: true
secondaryTabBox: false

kwin4_effect_maximize:

kwin4_effect_fade:

presentwindows:
layoutMode: 0
showCaptions: true
showIcons: true
doNotCloseWindows: false
ignoreMinimized: false
accuracy: 20
fillGaps: true
fadeDuration: 150
showPanel: false
leftButtonWindow: 1
rightButtonWindow: 2
middleButtonWindow: 0
leftButtonDesktop: 2
middleButtonDesktop: 0
rightButtonDesktop: 0

highlightwindow:

kwin4_effect_dialogparent:

blur:
blurRadius: 6
cacheTexture: true

contrast:

logout:
useBlur: true

dashboard:
brightness: 0.5
saturation: 0.5
blur: false

windowgeometry:
handlesMoves: true
handlesResizes: true

startupfeedback:
type: 1

screenedge:

kscreen:
Comment 4 André M 2015-04-16 13:39:36 UTC
Sorry for the long paste, I didn't pay attention to the size, should have posted to drive or pastebin instead.
Comment 5 André M 2015-04-16 14:11:09 UTC
Created attachment 92080 [details]
glxinfo -l

Patched kwin doesn't fix the issue. Same result, same corruption.
Not sure if same issue as #345532
Comment 6 Thomas Lübking 2015-04-16 14:24:02 UTC
Because the screenshot is 1366x768 while the resolution (as seen by KWin as well) is 1024x768, can you please dump the ouput of "xrandr -q" when this happens (and notice the expected resolution)
Comment 7 André M 2015-04-16 14:28:24 UTC
(In reply to Thomas Lübking from comment #6)
> Because the screenshot is 1366x768 while the resolution (as seen by KWin as
> well) is 1024x768, can you please dump the ouput of "xrandr -q" when this
> happens (and notice the expected resolution)

Original resolution was 1366x768. Changed to 1024x768 via kscreen dialog. Problem ocurred, screen area used reduced to 2nd resolution, but with this glitches. xrandr -q taken while bug was active:

Screen 0: minimum 8 x 8, current 1366 x 768, maximum 32767 x 32767
LVDS1 connected primary 1024x768+0+0 (normal left inverted right x axis y axis) 309mm x 173mm
   1366x768      59.98 +
   1024x768      60.00* 
   800x600       60.32    56.25  
   640x480       59.94  
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
Comment 8 Thomas Lübking 2015-04-16 14:40:27 UTC
There it's again...

xrandr --output LVDS1 --auto
xrandr --output LVDS1 --mode 1024x768

Does that lead to
a) a consistent resolution ("current" being 1024x768 as well)
b) graphical corruption?
Comment 9 André M 2015-04-16 14:43:44 UTC
(In reply to Thomas Lübking from comment #8)
> There it's again...
> 
> xrandr --output LVDS1 --auto
> xrandr --output LVDS1 --mode 1024x768
> 
> Does that lead to
> a) a consistent resolution ("current" being 1024x768 as well)
> b) graphical corruption?

First command did nothing. Second command led to the same corruption. Typed again with 1366x768 to come back to original resolution, and everything returned to work normally. E.g. xrandr led to same results as kscreen resolution changes.
Comment 10 Martin Flöser 2015-04-16 14:46:35 UTC
please switch to GLX an OpenGL 2. Both EGL and OpenGL 3 are known to have issues.
Comment 11 Thomas Lübking 2015-04-16 14:48:35 UTC
with the same "current" resolution of 1366x768?

please attach the output of "xrandr -q --verbose" in this condition (lvds1 == XGA but global resolution being WXGA)
Comment 12 André M 2015-04-16 16:07:35 UTC
Created attachment 92082 [details]
output of xrandr -q --verbose

GLX with OpenGL2. Same problem. Source resolution is 1366x768. Tried changing to 1024x768, corruption occurs. Attached requested output, during corruption.
Comment 13 Thomas Lübking 2015-04-16 20:46:43 UTC
Interestingly
> Screen 0: minimum 8 x 8, current 1024 x 768, maximum 32767 x 32767
the screen resolution is correct in this case

-> caused by xrandr invocation or kscreen?
Comment 14 André M 2015-04-16 20:59:13 UTC
(In reply to Thomas Lübking from comment #13)
> Interestingly
> > Screen 0: minimum 8 x 8, current 1024 x 768, maximum 32767 x 32767
> the screen resolution is correct in this case
> 
> -> caused by xrandr invocation or kscreen?

This test was with xrandr. But in all cases, when changing resolution to 1024x768, the "physical screen area" used was the right one, 1024x768, with black rectangles in both sides, as expected. But the central area, where should be a 1024x768 desktop, was this mess of textures and glitches, and in all cases, even with xrandr returning 1024x768, ksnapshot made a 1366x768 (previous resolution) image, with these corruptions.
Comment 15 Thomas Lübking 2015-04-16 21:14:04 UTC
(In reply to André Vitor de Lima Matos from comment #14)
> 1024x768, with black rectangles in both sides
That's the HW (the display) and irrelevant.

> all cases, even with xrandr returning 1024x768, ksnapshot made a 1366x768
> (previous resolution) image, with these corruptions.

Assuming that the 1024x768 refer to the screen resolution ("current"), please check

$ qdbus org.kde.KWin /Effects loadedEffects | grep screenshot
if it's loaded
$ qdbus org.kde.KWin /Effects unloadEffect screenshot
confirm
$ qdbus org.kde.KWin /Effects loadedEffects | grep screenshot

cause the problem and make a screenshot - is that XGA?
Comment 16 André M 2015-04-16 21:19:27 UTC
Created attachment 92090 [details]
screenshot of glitch without screenshot module loaded

Disabling screenshot module made the screenshot image get the right resolution, that is the screen resolution, 1024x768, and precisely what I see when the glitch occurs.
Comment 17 André M 2015-04-23 17:02:54 UTC
Just compiled today's version (6d31775ee80b4afee09473c134cc68aabe48f57c) and everything is working fine now. Marking as resolved. Thanks.