Bug 460082

Summary: black screen waking up from sleep - kwin_wayland_drm errors
Product: [Plasma] kwin Reporter: Pawel <bednarczyk.pawel>
Component: platform-drmAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: nate, xaver.hugl
Priority: NOR Keywords: wayland-only
Version First Reported In: 5.25.90   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Pawel 2022-10-07 06:50:46 UTC
I have a single monitor and since updating to kernel 6.0 on Arch, the monitor does not comeback to life after waking up from sleep. Journal is spammed with the below 3 lines:

Oct 07 08:15:35 arch-Bednar kwin_wayland[1609]: kwin_wayland_drm: Failed to find a working setup for new outputs!
Oct 07 08:15:35 arch-Bednar kwin_wayland[1609]: kwin_wayland_drm: Atomic commit failed! Invalid argument
Oct 07 08:15:35 arch-Bednar kwin_wayland[1609]: kwin_wayland_drm: Presentation failed! Invalid argument

There is no coredump or anything. 

Operating System: Arch Linux
KDE Plasma Version: 5.25.90
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Kernel Version: 6.0.0-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 3700X 8-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 6800 XT

KWin Support Information:
The following information should be used when requesting support on e.g. https://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 https://paste.kde.org instead of pasting into support threads.

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

Version
=======
KWin version: 5.25.90
Qt Version: 5.15.6
Qt compile version: 5.15.6
XCB compile version: 1.15

Operation Mode: Xwayland

Build Options
=============
KWIN_BUILD_DECORATIONS: yes
KWIN_BUILD_TABBOX: yes
KWIN_BUILD_ACTIVITIES: yes
HAVE_X11_XCB: yes
HAVE_EPOXY_GLX: yes
HAVE_WAYLAND_EGL: yes

X11
===
Vendor: The X.Org Foundation
Vendor Release: 12201003
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: 
Plugin recommends border size: None
onAllDesktopsAvailable: true
alphaChannelSupported: true
closeOnDoubleClickOnMenu: false
decorationButtonsLeft: 0, 2
decorationButtonsRight: 6, 3, 4, 5
borderSize: 0
gridUnit: 10
font: Lato Semibold,10,-1,5,50,0,0,0,0,0
smallSpacing: 2
largeSpacing: 10

Platform
==========
Name: DRM
Active: true
Atomic Mode Setting on GPU 0: true

Cursor
======
themeName: breeze_cursors
themeSize: 24

Options
=======
focusPolicy: 0
xwaylandCrashPolicy: 
xwaylandMaxCrashCount: 3
nextFocusPrefersMouse: false
clickRaise: true
autoRaise: false
autoRaiseInterval: 0
delayFocusInterval: 0
shadeHover: false
shadeHoverInterval: 250
separateScreenFocus: false
activeMouseScreen: true
placement: 
activationDesktopPolicy: 0
focusPolicyIsReasonable: true
borderSnapZone: 10
windowSnapZone: 10
centerSnapZone: 0
snapOnlyWhenOverlapping: false
rollOverDesktops: false
focusStealingPreventionLevel: 1
operationTitlebarDblClick: 5000
operationMaxButtonLeftClick: 5000
operationMaxButtonMiddleClick: 5015
operationMaxButtonRightClick: 5014
commandActiveTitlebar1: 0
commandActiveTitlebar2: 28
commandActiveTitlebar3: 2
commandInactiveTitlebar1: 4
commandInactiveTitlebar2: 28
commandInactiveTitlebar3: 2
commandWindow1: 7
commandWindow2: 8
commandWindow3: 8
commandWindowWheel: 28
commandAll1: 10
commandAll2: 3
commandAll3: 14
keyCmdAllModKey: 16777250
condensedTitle: false
electricBorderMaximize: true
electricBorderTiling: true
electricBorderCornerRatio: 0.15000000596046448
borderlessMaximizedWindows: false
killPingTimeout: 5000
hideUtilityWindowsForInactive: true
compositingMode: 1
useCompositing: true
hiddenPreviews: 1
glSmoothScale: 0
glStrictBinding: false
glStrictBindingFollowsDriver: true
glPreferBufferSwap: 101
glPlatformInterface: 2
windowsBlockCompositing: true
latencyPolicy: 
renderTimeEstimator: 

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

Screens
=======
Active screen follows mouse:  yes
Number of Screens: 1

Screen 0:
---------
Name: DP-1
Enabled: 1
Geometry: 0,0,2560x1440
Scale: 1
Refresh Rate: 143999
Adaptive Sync: automatic

Compositing
===========
Compositing is active
Compositing Type: OpenGL
OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon RX 6800 XT (navi21, LLVM 14.0.6, DRM 3.48, 6.0.0-arch1-1)
OpenGL version string: 4.6 (Core Profile) Mesa 22.2.0
OpenGL platform interface: EGL
OpenGL shading language version string: 4.60
Driver: Unknown
GPU class: Unknown
OpenGL version: 4.6
GLSL version: 4.60
Mesa version: 22.2
Linux kernel version: 6.0
Direct rendering: Requires strict binding: no
GLSL shaders:  yes
Texture NPOT support:  yes
Virtual Machine:  no
OpenGL 2 Shaders are used

Loaded Effects:
---------------
kwin4_effect_morphingpopups
kwin4_effect_login
kwin4_effect_logout
kwin4_effect_scale
kwin4_effect_sessionquit
kwin4_effect_maximize
kwin4_effect_frozenapp
kwin4_effect_fadingpopups
kwin4_effect_dialogparent
kwin4_effect_fullscreen
kwin4_effect_windowaperture
kwin4_effect_squash
colorpicker
outputlocator
blendchanges
screenshot
screenedge
zoom
slidingpopups
slide
desktopgrid
highlightwindow
overview
windowview
blur
contrast
startupfeedback
kscreen
screentransform

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

Effect Settings:
----------------
kwin4_effect_morphingpopups:
pluginId: kwin4_effect_morphingpopups
isActiveFullScreenEffect: false

kwin4_effect_login:
pluginId: kwin4_effect_login
isActiveFullScreenEffect: false

kwin4_effect_logout:
pluginId: kwin4_effect_logout
isActiveFullScreenEffect: false

kwin4_effect_scale:
pluginId: kwin4_effect_scale
isActiveFullScreenEffect: false

kwin4_effect_sessionquit:
pluginId: kwin4_effect_sessionquit
isActiveFullScreenEffect: false

kwin4_effect_maximize:
pluginId: kwin4_effect_maximize
isActiveFullScreenEffect: false

kwin4_effect_frozenapp:
pluginId: kwin4_effect_frozenapp
isActiveFullScreenEffect: false

kwin4_effect_fadingpopups:
pluginId: kwin4_effect_fadingpopups
isActiveFullScreenEffect: false

kwin4_effect_dialogparent:
pluginId: kwin4_effect_dialogparent
isActiveFullScreenEffect: false

kwin4_effect_fullscreen:
pluginId: kwin4_effect_fullscreen
isActiveFullScreenEffect: false

kwin4_effect_windowaperture:
pluginId: kwin4_effect_windowaperture
isActiveFullScreenEffect: false

kwin4_effect_squash:
pluginId: kwin4_effect_squash
isActiveFullScreenEffect: false

colorpicker:

outputlocator:

blendchanges:

screenshot:

screenedge:

zoom:
zoomFactor: 1.2
mousePointer: 0
mouseTracking: 0
focusTrackingEnabled: false
textCaretTrackingEnabled: false
focusDelay: 350
moveFactor: 20
targetZoom: 1

slidingpopups:
slideInDuration: 150
slideOutDuration: 250

slide:
horizontalGap: 45
verticalGap: 20
slideDocks: false
slideBackground: true

desktopgrid:
activeView: 
gridRows: 1
gridColumns: 2
animationDuration: 300
layout: 1
partialActivationFactor: 0
gestureInProgress: false
showAddRemove: true
desktopNameAlignment: 0
desktopLayoutMode: 0
customLayoutRows: 2

highlightwindow:

overview:
activeView: 
animationDuration: 300
layout: 1
ignoreMinimized: false
blurBackground: true
partialActivationFactor: 0
gestureInProgress: false

windowview:
activeView: 
animationDuration: 300
layout: 1
ignoreMinimized: false
mode: 0
partialActivationFactor: 0
gestureInProgress: false
searchText: 

blur:

contrast:

startupfeedback:
type: 1

kscreen:

screentransform:


Loaded Plugins:
---------------
kwin5_plugin_buttonrebinds
kwin5_plugin_colord
kwin5_plugin_krunner
kwin5_plugin_nightcolor
kwin5_plugin_screencast

Available Plugins:
------------------
kwin5_plugin_buttonrebinds
kwin5_plugin_colord
kwin5_plugin_krunner
kwin5_plugin_nightcolor
kwin5_plugin_screencast
Comment 1 Vlad Zahorodnii 2022-10-07 08:42:09 UTC
If it works with linux 5.12, it seems like a driver bug.
Comment 2 Pawel 2022-10-07 11:58:31 UTC
(In reply to Vlad Zahorodnii from comment #1)
> If it works with linux 5.12, it seems like a driver bug.

I will try linux-lts  5.15.72 and report back.
Comment 3 Pawel 2022-10-10 12:16:08 UTC
(In reply to Pawel from comment #2)
> (In reply to Vlad Zahorodnii from comment #1)
> > If it works with linux 5.12, it seems like a driver bug.
> 
> I will try linux-lts  5.15.72 and report back.

works fine on 5.15.72, so it looks like a kernel 6.0 issue. No idea how to debug whatsoever. What do you want to do with this bug report?
Comment 4 Nate Graham 2022-10-10 16:56:19 UTC
Regardless of what we do in KWin, you should report this at https://bugzilla.kernel.org.

We might also be able to put in a workaround for this, but no guarantees, and I'll let the KWin folks make that decision.
Comment 5 Pawel 2022-10-10 18:04:06 UTC
since kernel 6.0 is still in testing I opened a topic in the testing forums:

https://bbs.archlinux.org/viewtopic.php?pid=2061483#p2061483

Additional information:

Oct 10 19:31:32 arch-Bednar kwin_wayland[1597]: kwin_wayland_drm: Atomic commit failed! Invalid argument
Oct 10 19:31:32 arch-Bednar kwin_wayland[1597]: kwin_wayland_drm: Presentation failed! Invalid argument
Oct 10 19:31:32 arch-Bednar kwin_wayland[1597]: kwin_wayland_drm: Failed to find a working setup for new outputs!
Oct 10 19:31:32 arch-Bednar kwin_wayland[1597]: kwin_wayland_drm: Failed to find a working setup for new outputs!

but right before we have this:

Oct 10 19:31:32 arch-Bednar kernel: amdgpu: Move buffer fallback to memcpy unavailable
Oct 10 19:31:32 arch-Bednar kernel: amdgpu 0000:0e:00.0: amdgpu: 0000000094037003 pin failed
Oct 10 19:31:32 arch-Bednar kernel: amdgpu 0000:0e:00.0: amdgpu: (-19) kernel bo pin failed
Oct 10 19:31:32 arch-Bednar kernel: amdgpu 0000:0e:00.0: amdgpu: DTM: Failed to initialize DTM
Oct 10 19:31:32 arch-Bednar kernel: amdgpu: Move buffer fallback to memcpy unavailable
Oct 10 19:31:32 arch-Bednar kernel: amdgpu 0000:0e:00.0: amdgpu: 0000000094037003 pin failed
Oct 10 19:31:32 arch-Bednar kernel: amdgpu 0000:0e:00.0: amdgpu: (-19) kernel bo pin failed
Oct 10 19:31:32 arch-Bednar kernel: amdgpu 0000:0e:00.0: amdgpu: RAP: Failed to initialize RAP
Oct 10 19:31:32 arch-Bednar kernel: amdgpu 0000:0e:00.0: amdgpu: SECUREDISPLAY: securedisplay ta ucode is not available
Oct 10 19:31:32 arch-Bednar kernel: amdgpu 0000:0e:00.0: amdgpu: SMU is resuming...
Oct 10 19:31:32 arch-Bednar kernel: amdgpu 0000:0e:00.0: amdgpu: smu driver if version = 0x00000040, smu fw if version = 0x00000041, smu fw program = 0, version = 0x003a5400 (58.84.0)
Oct 10 19:31:32 arch-Bednar kernel: amdgpu 0000:0e:00.0: amdgpu: SMU driver if version not matched
Oct 10 19:31:32 arch-Bednar kernel: amdgpu 0000:0e:00.0: amdgpu: use vbios provided pptable
Oct 10 19:31:32 arch-Bednar kernel: amdgpu 0000:0e:00.0: amdgpu: SMU is resumed successfully!
Oct 10 19:31:32 arch-Bednar kernel: [drm] DMUB hardware initialized: version=0x02020013

and

Oct 10 19:31:32 arch-Bednar kernel: amdgpu: Move buffer fallback to memcpy unavailable
Oct 10 19:31:32 arch-Bednar kernel: amdgpu 0000:0e:00.0: amdgpu: 0000000036fd7a68 pin failed
Oct 10 19:31:32 arch-Bednar kernel: [drm:dm_plane_helper_prepare_fb [amdgpu]] *ERROR* Failed to pin framebuffer with error -19

full log:

https://gist.github.com/Bednar87/c97c41 … dd0f01b899
Comment 6 Zamundaaa 2022-10-11 18:41:05 UTC
It's definitely a driver bug; most likely the same as https://gitlab.freedesktop.org/drm/amd/-/issues/2164
Comment 7 Pawel 2022-10-11 18:49:01 UTC
yep, agreed. Thanks, I have subscribed to the gitlab issue.