Bug 413403 - Closing of Rules Dialog causes flickering
Summary: Closing of Rules Dialog causes flickering
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.17.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-24 17:27 UTC by David Redondo
Modified: 2023-01-19 12:09 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Video of flickering (3.38 MB, video/mp4)
2019-10-28 13:56 UTC, David Redondo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Redondo 2019-10-24 17:27:35 UTC
SUMMARY
After closing the rules dialog the screen flickers and sometimes kwin crashes. So far I only saw the crash on Wayland while the flickering also happens on X11.

STEPS TO REPRODUCE
1. Right click on the titlebar of window 
2. Open "Configure Special Application Settings"
3. Close the dialog by clicking on the close button in the titlebar

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.17.1
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1

Backtrace:
#0  0x00007fcef0d44bcf in KWin::DmabufBuffer::removeImages()
    (this=this@entry=0x558f3ed29b00)
    at ./platformsupport/scenes/opengl/linux_dmabuf.cpp:225
#1  0x00007fcef0d46578 in KWin::DmabufBuffer::~DmabufBuffer()
    (this=0x558f3ed29b00, __in_chrg=<optimized out>)
    at ./platformsupport/scenes/opengl/linux_dmabuf.cpp:206
#2  0x00007fcef0d46779 in KWin::DmabufBuffer::~DmabufBuffer()
    (this=0x558f3ed29b00, __in_chrg=<optimized out>)
    at ./platformsupport/scenes/opengl/linux_dmabuf.cpp:215
#3  0x00007fcf0154ee52 in  ()
    at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
#4  0x00007fcf0154eeae in wl_resource_destroy ()
    at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
#5  0x00007fcefb167dae in ffi_call_unix64 ()
    at /usr/lib/x86_64-linux-gnu/libffi.so.6
#6  0x00007fcefb16771f in ffi_call () at /usr/lib/x86_64-linux-gnu/libffi.so.6
#7  0x00007fcf015527e4 in  ()
    at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
#8  0x00007fcf0154f26f in  ()
    at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
#9  0x00007fcf01550832 in wl_event_loop_dispatch ()
    at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
#10 0x00007fcf0acc2d0e in KWayland::Server::Display::Private::dispatch() ()
--Type <RET> for more, q to quit, c to continue without paging--
   usr/lib/x86_64-linux-gnu/libKF5WaylandServer.so.5
#11 0x00007fcf095c982f in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffd0bc77a30, r=0x558f3e164ba0, this=<optimized out>)
    at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:394
#12 0x00007fcf095c982f in QMetaObject::activate(QObject*, int, int, void**)
    (sender=sender@entry=0x558f3e146050, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=<optimized out>,
    argv@entry=0x7ffd0bc77a30) at kernel/qobject.cpp:3789
#13 0x00007fcf095c9dd7 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**)
    (sender=sender@entry=0x558f3e146050, m=m@entry=0x7fcf09a4ec40 <QSocketNotifier::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffd0bc77a30) at kernel/qobject.cpp:3660
#14 0x00007fcf095d5e68 in QSocketNotifier::activated(int, QSocketNotifier::QPrivateSignal) (this=this@entry=0x558f3e146050, _t1=<optimized out>, _t2=...)
    at .moc/moc_qsocketnotifier.cpp:141
#15 0x00007fcf095d6222 in QSocketNotifier::event(QEvent*) (this=0x558f3e146050, e=0x7ffd0bc77d10) at kernel/qsocketnotifier.cpp:266
#16 0x00007fcf09bb3eac in QApplicationPrivate::notify_helper(QObject*, QEvent*)
    (this=this@entry=0x558f3e0fe480, receiver=receiver@entry=0x558f3e146050, e=e@entry=0x7ffd0bc77d10) at kernel/qapplication.cpp:3703
#17 0x00007fcf09bbb4b0 in QApplication::notify(QObject*, QEvent*) (this=0x7ffd0bc78120, receiver=0x558f3e146050, e=0x7ffd0bc77d10)
    at kernel/qapplication.cpp:3449
#18 0x00007fcf09598d48 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x558f3e146050, event=0x7ffd0bc77d10)
    at kernel/qcoreapplication.cpp:1095
#19 0x00007fcf095f3b33 in QEventDispatcherUNIXPrivate::activateSocketNotifiers() (this=this@entry=0x558f3e10f010) at kernel/qeventdispatcher_unix.cpp:304
#20 0x00007fcf095f3f62 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...)
    at kernel/qeventdispatcher_unix.cpp:509
#21 0x00007fcef4987dcd in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/KWinQpaPlugin.so
#22 0x00007fcf09596eaa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffd0bc77ec0, flags=..., flags@entry=...)
    at kernel/qeventloop.cpp:225
#23 0x00007fcf095a0220 in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1403
#24 0x0000558f3d170e4e in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at ./main_wayland.cpp:677
(gdb) bt
#0  0x00007fcef0d44bcf in KWin::DmabufBuffer::removeImages() (this=this@entry=0x558f3ed29b00) at ./platformsupport/scenes/opengl/linux_dmabuf.cpp:225
#1  0x00007fcef0d46578 in KWin::DmabufBuffer::~DmabufBuffer() (this=0x558f3ed29b00, __in_chrg=<optimized out>)
    at ./platformsupport/scenes/opengl/linux_dmabuf.cpp:206
#2  0x00007fcef0d46779 in KWin::DmabufBuffer::~DmabufBuffer() (this=0x558f3ed29b00, __in_chrg=<optimized out>)
    at ./platformsupport/scenes/opengl/linux_dmabuf.cpp:215
#3  0x00007fcf0154ee52 in  () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
#4  0x00007fcf0154eeae in wl_resource_destroy () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
#5  0x00007fcefb167dae in ffi_call_unix64 () at /usr/lib/x86_64-linux-gnu/libffi.so.6
#6  0x00007fcefb16771f in ffi_call () at /usr/lib/x86_64-linux-gnu/libffi.so.6
#7  0x00007fcf015527e4 in  () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
#8  0x00007fcf0154f26f in  () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
#9  0x00007fcf01550832 in wl_event_loop_dispatch () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
#10 0x00007fcf0acc2d0e in KWayland::Server::Display::Private::dispatch() () at /usr/lib/x86_64-linux-gnu/libKF5WaylandServer.so.5
#11 0x00007fcf095c982f in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffd0bc77a30, r=0x558f3e164ba0, this=<optimized out>)
    at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:394
#12 0x00007fcf095c982f in QMetaObject::activate(QObject*, int, int, void**)
    (sender=sender@entry=0x558f3e146050, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=<optimized out>,
    argv@entry=0x7ffd0bc77a30) at kernel/qobject.cpp:3789
#13 0x00007fcf095c9dd7 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**)
    (sender=sender@entry=0x558f3e146050, m=m@entry=0x7fcf09a4ec40 <QSocketNotifier::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffd0bc77a30) at kernel/qobject.cpp:3660
#14 0x00007fcf095d5e68 in QSocketNotifier::activated(int, QSocketNotifier::QPrivateSignal) (this=this@entry=0x558f3e146050, _t1=<optimized out>, _t2=...)
    at .moc/moc_qsocketnotifier.cpp:141
#15 0x00007fcf095d6222 in QSocketNotifier::event(QEvent*) (this=0x558f3e146050, e=0x7ffd0bc77d10) at kernel/qsocketnotifier.cpp:266
#16 0x00007fcf09bb3eac in QApplicationPrivate::notify_helper(QObject*, QEvent*)
    (this=this@entry=0x558f3e0fe480, receiver=receiver@entry=0x558f3e146050, e=e@entry=0x7ffd0bc77d10) at kernel/qapplication.cpp:3703
#17 0x00007fcf09bbb4b0 in QApplication::notify(QObject*, QEvent*) (this=0x7ffd0bc78120, receiver=0x558f3e146050, e=0x7ffd0bc77d10)
    at kernel/qapplication.cpp:3449
#18 0x00007fcf09598d48 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x558f3e146050, event=0x7ffd0bc77d10)
    at kernel/qcoreapplication.cpp:1095
#19 0x00007fcf095f3b33 in QEventDispatcherUNIXPrivate::activateSocketNotifiers() (this=this@entry=0x558f3e10f010) at kernel/qeventdispatcher_unix.cpp:304
#20 0x00007fcf095f3f62 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...)
    at kernel/qeventdispatcher_unix.cpp:509
#21 0x00007fcef4987dcd in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/KWinQpaPlugin.so
#22 0x00007fcf09596eaa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffd0bc77ec0, flags=..., flags@entry=...)
    at kernel/qeventloop.cpp:225
#23 0x00007fcf095a0220 in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1403
#24 0x0000558f3d170e4e in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at ./main_wayland.cpp:677
Comment 1 David Redondo 2019-10-28 13:37:06 UTC
I bisected 1db84a2ba71657a26d2a7971eb0c35e2716742c3  to be the commit which introduced the flickering.
Comment 2 David Redondo 2019-10-28 13:56:37 UTC
Created attachment 123540 [details]
Video of flickering

I see a black screen but the camera apparently was to slow/adjusted to less light so you see afterglow or brown/grey
Comment 3 Roman Gilg 2019-10-28 14:08:47 UTC
(In reply to David Redondo from comment #1)
> I bisected 1db84a2ba71657a26d2a7971eb0c35e2716742c3  to be the commit which
> introduced the flickering.

Could be that the flickering is because of different compositing teardown and startup what is done for several KWin configuration changes. Would need to be inspected more thoroughly.

The crash is likely fixed with https://phabricator.kde.org/D24954

Would be good if you can test this patch, so it can land in 5.17.2.
Comment 4 Vlad Zahorodnii 2019-10-29 10:34:14 UTC
> while the flickering also happens on X11.
File another bug report for that please.
Comment 5 David Redondo 2019-10-29 10:36:11 UTC
We could use this bug for the flickering. I think there is also another bug for that dmabus crash.
Comment 6 Roman Gilg 2019-10-29 11:10:26 UTC
Git commit 7459aabcac2471862a35a7c045de7176b5435f1c by Roman Gilg.
Committed on 29/10/2019 at 11:10.
Pushed by romangilg into branch 'Plasma/5.17'.

Dmabuf recovery on EGL reset

Summary:
The EGL platform might go away at any time through reconfiguration or because
of a graphic error. KWin then resets the graphics. The dmabuf implementation
must respect that and recover from a graphics reset by recreating all EGL
images for existing buffer.

This assumes that we won't change our graphics API mid-session and that
supported plane and modifier configuration stays constant.

In practise we remember all current dmabufs in a single map and only remove
them if the client did destroy the resource.
Related: bug 411980
FIXED-IN: 5.17.2

Test Plan: Applied screenedge configuration without crash.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: fvogt, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24954

M  +1    -0    CMakeLists.txt
A  +88   -0    linux_dmabuf.cpp     [License: GPL (v2)]
C  +12   -49   linux_dmabuf.h [from: platformsupport/scenes/opengl/linux_dmabuf.h - 053% similarity]
M  +1    -1    platformsupport/scenes/opengl/CMakeLists.txt
M  +4    -4    platformsupport/scenes/opengl/abstract_egl_backend.cpp
R  +52   -63   platformsupport/scenes/opengl/egl_dmabuf.cpp [from: platformsupport/scenes/opengl/linux_dmabuf.cpp - 084% similarity]
R  +23   -30   platformsupport/scenes/opengl/egl_dmabuf.h [from: platformsupport/scenes/opengl/linux_dmabuf.h - 068% similarity]
M  +10   -0    wayland_server.cpp
M  +15   -0    wayland_server.h

https://commits.kde.org/kwin/7459aabcac2471862a35a7c045de7176b5435f1c
Comment 7 Roman Gilg 2019-10-29 22:45:33 UTC
(In reply to David Redondo from comment #5)
> We could use this bug for the flickering. I think there is also another bug
> for that dmabus crash.

Yea, let's do it this way. Can you rename the bug?
Comment 8 Patrick Silva 2020-01-25 14:06:09 UTC
I see a slight flicker on my system.

Operating System: Arch Linux 
KDE Plasma Version: 5.17.90
KDE Frameworks Version: 5.66.0
Qt Version: 5.14.0
Comment 9 Christoph Feck 2020-02-13 23:20:07 UTC
The flicker was temporarily fixed with the commits in master that had to be reverted immediately before the 5.18 branching.
Comment 10 Vlad Zahorodnii 2023-01-19 12:09:45 UTC
Can't reproduce.