Bug 448790 - 19c471405e7eb4b6026db24d776d205125dbc013 breaks the multi-monitor setup
Summary: 19c471405e7eb4b6026db24d776d205125dbc013 breaks the multi-monitor setup
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (other bugs)
Version First Reported In: git-stable-Plasma/5.24
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2022-01-19 19:35 UTC by Weng Xuetian
Modified: 2022-01-20 15:15 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Weng Xuetian 2022-01-19 19:35:28 UTC
SUMMARY
With 19c471405e7eb4b6026db24d776d205125dbc013,  my HDMI output though USB-C is not working.
My laptop is with intel + nvidia.

When trying to enabling systemsettings, it will crash kwin_wayland.


STEPS TO REPRODUCE
1. Disable HDMI (there's no actual output to this screen, but it's "enabled" in systemsettings)
2. Reenable it

OBSERVED RESULT
kwin_wayland crashes

EXPECTED RESULT
Output should be on and no crash 

SOFTWARE/OS VERSIONS
==========================

Version
=======
KWin version: 5.23.90
Qt Version: 5.15.2
Qt compile version: 5.15.2
XCB compile version: 1.14

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: 12101004
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
Blur: 0
onAllDesktopsAvailable: true
alphaChannelSupported: true
closeOnDoubleClickOnMenu: false
decorationButtonsLeft: 5, 4, 3, 0
decorationButtonsRight: 
borderSize: 0
gridUnit: 12
font: Sans Serif,8,-1,5,50,0,0,0,0,0
smallSpacing: 3
largeSpacing: 12

Platform
==========
Name: DRM
Active: true
Atomic Mode Setting on GPU 0: true
Atomic Mode Setting on GPU 1: 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: 6
focusPolicyIsReasonable: true
borderSnapZone: 10
windowSnapZone: 10
centerSnapZone: 0
snapOnlyWhenOverlapping: false
rollOverDesktops: true
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.25
borderlessMaximizedWindows: true
killPingTimeout: 5000
hideUtilityWindowsForInactive: true
compositingMode: 1
useCompositing: true
hiddenPreviews: 1
glSmoothScale: 1
glStrictBinding: false
glStrictBindingFollowsDriver: true
glPreferBufferSwap: 101
glPlatformInterface: 2
windowsBlockCompositing: true
latencyPolicy: 
renderTimeEstimator: 

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:  yes
Number of Screens: 2

Screen 0:
---------
Name: eDP-1
Geometry: 0,0,1536x864
Scale: 1.25
Refresh Rate: 144028
Adaptive Sync: incapable
Screen 1:
---------
Name: DP-1
Geometry: 1536,0,2048x1152
Scale: 1.25
Refresh Rate: 59951
Adaptive Sync: incapable

Compositing
===========
Compositing is active
Compositing Type: OpenGL
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) UHD Graphics 630 (CFL GT2)
OpenGL version string: 4.6 (Core Profile) Mesa 21.3.4
OpenGL platform interface: EGL
OpenGL shading language version string: 4.60
Driver: Intel
GPU class: Coffee Lake
OpenGL version: 4.6
GLSL version: 4.60
Mesa version: 21.3.4
Linux kernel version: 5.16.1
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_fullscreen
kwin4_effect_dialogparent
kwin4_effect_squash
kwin4_effect_login
kwin4_effect_maximize
kwin4_effect_scale
kwin4_effect_logout
kwin4_effect_sessionquit
kwin4_effect_morphingpopups
kwin4_effect_windowaperture
kwin4_effect_frozenapp
zoom
slidingpopups
colorpicker
desktopgrid
slide
screenshot
highlightwindow
presentwindows
blur
contrast
screenedge
startupfeedback
kscreen
screentransform

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

Effect Settings:
----------------
kwin4_effect_fullscreen:
pluginId: kwin4_effect_fullscreen
isActiveFullScreenEffect: false

kwin4_effect_dialogparent:
pluginId: kwin4_effect_dialogparent
isActiveFullScreenEffect: false

kwin4_effect_squash:
pluginId: kwin4_effect_squash
isActiveFullScreenEffect: false

kwin4_effect_login:
pluginId: kwin4_effect_login
isActiveFullScreenEffect: false

kwin4_effect_maximize:
pluginId: kwin4_effect_maximize
isActiveFullScreenEffect: false

kwin4_effect_scale:
pluginId: kwin4_effect_scale
isActiveFullScreenEffect: false

kwin4_effect_logout:
pluginId: kwin4_effect_logout
isActiveFullScreenEffect: false

kwin4_effect_sessionquit:
pluginId: kwin4_effect_sessionquit
isActiveFullScreenEffect: false

kwin4_effect_morphingpopups:
pluginId: kwin4_effect_morphingpopups
isActiveFullScreenEffect: false

kwin4_effect_windowaperture:
pluginId: kwin4_effect_windowaperture
isActiveFullScreenEffect: false

kwin4_effect_frozenapp:
pluginId: kwin4_effect_frozenapp
isActiveFullScreenEffect: false

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

slidingpopups:
slideInDuration: 150
slideOutDuration: 250

colorpicker:

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

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

screenshot:

highlightwindow:

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

blur:

contrast:

screenedge:

startupfeedback:
type: 1

kscreen:

screentransform:


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

Available Plugins:
------------------
kwin5_plugin_colord
kwin5_plugin_krunner
kwin5_plugin_nightcolor
kwin5_plugin_screencast


ADDITIONAL INFORMATION
Comment 1 Weng Xuetian 2022-01-19 19:38:28 UTC
Full stack strace from crashed kwin_wayland.

#0  0x00007f369801fd22 in raise () at /usr/lib/libc.so.6
#1  0x00007f369800990e in abort () at /usr/lib/libc.so.6
#2  0x00007f36987dbee4 in qt_assert(char const*, char const*, int) () at /usr/lib/libQt5Core.so.5
#3  0x00007f36987dbf44 in qt_assert_x(char const*, char const*, char const*, int) () at /usr/lib/libQt5Core.so.5
#4  0x00007f3691edf3d0 in KWin::EglGbmBackend::beginFrame(KWin::AbstractOutput*) (this=0x55a25a5d59a0, drmOutput=0x55a25a836ce0) at /home/csslayer/Develop/kwin/src/backends/drm/egl_gbm_backend.cpp:524
#5  0x00007f3691ee12f8 in KWin::EglGbmBackend::renderTestFrame(KWin::DrmAbstractOutput*) (this=0x55a25a5d59a0, output=0x55a25a836ce0) at /home/csslayer/Develop/kwin/src/backends/drm/egl_gbm_backend.cpp:770
#6  0x00007f3691ed4693 in KWin::DrmPipeline::checkTestBuffer() (this=0x55a25a6891b0) at /home/csslayer/Develop/kwin/src/backends/drm/drm_pipeline.cpp:323
#7  0x00007f3691ed2dea in KWin::DrmPipeline::commitPipelinesAtomic(QVector<KWin::DrmPipeline*> const&, KWin::DrmPipeline::CommitMode, QVector<KWin::DrmObject*> const&)
    (pipelines=..., mode=KWin::DrmPipeline::CommitMode::Test, unusedObjects=...) at /home/csslayer/Develop/kwin/src/backends/drm/drm_pipeline.cpp:131
#8  0x00007f3691ed2ae9 in KWin::DrmPipeline::commitPipelines(QVector<KWin::DrmPipeline*> const&, KWin::DrmPipeline::CommitMode, QVector<KWin::DrmObject*> const&)
    (pipelines=..., mode=KWin::DrmPipeline::CommitMode::Test, unusedObjects=...) at /home/csslayer/Develop/kwin/src/backends/drm/drm_pipeline.cpp:103
#9  0x00007f3691ec1253 in KWin::DrmGpu::testPipelines() (this=0x55a25a532cd0) at /home/csslayer/Develop/kwin/src/backends/drm/drm_gpu.cpp:427
#10 0x00007f3691ec098a in KWin::DrmGpu::checkCrtcAssignment(QVector<KWin::DrmConnector*>, QVector<KWin::DrmCrtc*>) (this=0x55a25a532cd0, connectors=..., crtcs=...)
    at /home/csslayer/Develop/kwin/src/backends/drm/drm_gpu.cpp:338
#11 0x00007f3691ec0c59 in KWin::DrmGpu::checkCrtcAssignment(QVector<KWin::DrmConnector*>, QVector<KWin::DrmCrtc*>) (this=0x55a25a532cd0, connectors=..., crtcs=...)
    at /home/csslayer/Develop/kwin/src/backends/drm/drm_gpu.cpp:365
#12 0x00007f3691ec0daa in operator()() const (__closure=0x7ffdfc4e63d0) at /home/csslayer/Develop/kwin/src/backends/drm/drm_gpu.cpp:398
#13 0x00007f3691ec1031 in KWin::DrmGpu::testPendingConfiguration(KWin::DrmGpu::TestMode) (this=0x55a25a532cd0, mode=KWin::DrmGpu::TestMode::TestWithCrtcReallocation)
    at /home/csslayer/Develop/kwin/src/backends/drm/drm_gpu.cpp:403
#14 0x00007f3691e98113 in KWin::DrmBackend::applyOutputChanges(KWin::WaylandOutputConfig const&) (this=0x55a25a46b690, config=...) at /home/csslayer/Develop/kwin/src/backends/drm/drm_backend.cpp:628
#15 0x00007f369abca146 in KWin::Platform::requestOutputsChange(KWaylandServer::OutputConfigurationV2Interface*) (this=0x55a25a46b690, config=0x55a25b3c42e0) at /home/csslayer/Develop/kwin/src/platform.cpp:133
#16 0x00007f369acb2c16 in operator()(KWaylandServer::OutputConfigurationV2Interface*) const (__closure=0x55a25a4680e0, config=0x55a25b3c42e0) at /home/csslayer/Develop/kwin/src/wayland_server.cpp:501
#17 0x00007f369acb81e6 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<KWaylandServer::OutputConfigurationV2Interface*>, void, KWin::WaylandServer::init(KWin::WaylandServer::InitializationFlags)::<lambda(KWaylandServer::OutputConfigurationV2Interface*)> >::call(struct {...} &, void **) (f=..., arg=0x7ffdfc4e67b0) at /usr/include/qt/QtCore/qobjectdefs_impl.h:146
#18 0x00007f369acb7c44 in QtPrivate::Functor<KWin::WaylandServer::init(KWin::WaylandServer::InitializationFlags)::<lambda(KWaylandServer::OutputConfigurationV2Interface*)>, 1>::call<QtPrivate::List<KWaylandServer::OutputConfigurationV2Interface*>, void>(struct {...} &, void *, void **) (f=..., arg=0x7ffdfc4e67b0) at /usr/include/qt/QtCore/qobjectdefs_impl.h:256
#19 0x00007f369acb710d in QtPrivate::QFunctorSlotObject<KWin::WaylandServer::init(KWin::WaylandServer::InitializationFlags)::<lambda(KWaylandServer::OutputConfigurationV2Interface*)>, 1, QtPrivate::List<KWaylandServer::OutputConfigurationV2Interface*>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1, this_=0x55a25a4680d0, r=0x55a25a3dfae0, a=0x7ffdfc4e67b0, ret=0x0)
    at /usr/include/qt/QtCore/qobjectdefs_impl.h:443
#20 0x00007f36989f85d3 in  () at /usr/lib/libQt5Core.so.5
#21 0x00007f369a71d2e4 in KWaylandServer::OutputManagementV2Interface::configurationChangeRequested(KWaylandServer::OutputConfigurationV2Interface*) () at /usr/lib/libKWaylandServer.so.5
#22 0x00007f369670fd4a in  () at /usr/lib/libffi.so.8
#23 0x00007f369670f267 in  () at /usr/lib/libffi.so.8
#24 0x00007f369791f323 in  () at /usr/lib/libwayland-server.so.0
#25 0x00007f369791a5cc in  () at /usr/lib/libwayland-server.so.0
#26 0x00007f369791d1ca in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
#27 0x00007f369a735b7b in KWaylandServer::Display::dispatchEvents() () at /usr/lib/libKWaylandServer.so.5
#28 0x00007f36989f85d3 in  () at /usr/lib/libQt5Core.so.5
#29 0x00007f36989fa294 in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) () at /usr/lib/libQt5Core.so.5
#30 0x00007f36989fa3df in QSocketNotifier::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#31 0x00007f36994811a6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#32 0x00007f36989c79ba in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#33 0x00007f3698a11924 in QEventDispatcherUNIXPrivate::activateSocketNotifiers() () at /usr/lib/libQt5Core.so.5
#34 0x00007f3698a12895 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#35 0x000055a259c5feb2 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
#36 0x00007f36989bfbab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
--Type <RET> for more, q to quit, c to continue without paging--
#37 0x00007f36989cb3e7 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#38 0x000055a259ae9808 in main(int, char**) (argc=14, argv=0x7ffdfc4e75f8) at /home/csslayer/Develop/kwin/src/main_wayland.cpp:727
Comment 2 Bug Janitor Service 2022-01-19 23:48:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1913
Comment 3 Weng Xuetian 2022-01-20 15:14:37 UTC
Git commit e64f60ce086cf2983e44b2815922c9fdd73e5d2b by Weng Xuetian.
Committed on 19/01/2022 at 23:46.
Pushed by ngraham into branch 'master'.

Fix force xrgb 8888

19c471405e7eb4b6026db24d776d205125dbc013 introduced a regression if
there are two gbm backend and the backend fail to choose drm format.

This fix does two things:
1. Current buffer format should not be reset after create new buffer,
   otherwise current.format may just be empty after resetOutput.
2. force xrgb 8888 need to be set on the primary backend.

M  +7    -1    src/backends/drm/egl_gbm_backend.cpp
M  +2    -0    src/backends/drm/egl_gbm_backend.h

https://invent.kde.org/plasma/kwin/commit/e64f60ce086cf2983e44b2815922c9fdd73e5d2b
Comment 4 Nate Graham 2022-01-20 15:15:01 UTC
Git commit 516a00be28495a60eb37675ceb5d2f45c968d019 by Nate Graham, on behalf of Weng Xuetian.
Committed on 20/01/2022 at 15:14.
Pushed by ngraham into branch 'Plasma/5.24'.

Fix force xrgb 8888

19c471405e7eb4b6026db24d776d205125dbc013 introduced a regression if
there are two gbm backend and the backend fail to choose drm format.

This fix does two things:
1. Current buffer format should not be reset after create new buffer,
   otherwise current.format may just be empty after resetOutput.
2. force xrgb 8888 need to be set on the primary backend.


(cherry picked from commit e64f60ce086cf2983e44b2815922c9fdd73e5d2b)

M  +7    -1    src/backends/drm/egl_gbm_backend.cpp
M  +2    -0    src/backends/drm/egl_gbm_backend.h

https://invent.kde.org/plasma/kwin/commit/516a00be28495a60eb37675ceb5d2f45c968d019