Summary:
BUG: 420077
Sample stack traces :
From bug:
#2 QImage::copy (this=this@entry=0x558117775e20, r=...) at image/qimage.cpp:1172
#3 0x00007f22d0a24cdf in QImage::detach (this=this@entry=0x558117775e20) at image/qimage.cpp:1091
#4 0x00007f22d0a25ae0 in QImage::fill (this=0x558117775e20, color=...) at image/qimage.cpp:1806
#5 0x00007f22d0a25f5f in QImage::fill (this=this@entry=0x558117775e20, color=color@entry=Qt::transparent) at image/qimage.cpp:1780
#6 0x00007f22bf3bdffd in KWin::DrmOutput::updateCursor (this=0x5581176fb780) at ./plugins/platforms/drm/drm_output.cpp:175
#7 0x00007f22bf3b0e55 in KWin::DrmBackend::updateCursor (this=0x558117669b60) at ./plugins/platforms/drm/drm_backend.cpp:701
Locally reproduced:
#0 0x00007f360611e159 in KWayland::Server::OutputDeviceInterface::transform() const (this=<optimized out>)
at /home/meven/kde/src/kwayland/src/server/outputdevice_interface.cpp:590
#1 0x00007f3607438059 in KWin::AbstractWaylandOutput::transform() const (this=this@entry=0x5645bed10f90) at /home/meven/kde/src/kwin/abstract_wayland_output.cpp:317
#2 0x00007f35ecd8acd3 in KWin::DrmOutput::matrixDisplay(QSize const&) const (this=0x5645bed10f90, s=...)
at /home/meven/kde/src/kwin/plugins/platforms/drm/drm_output.cpp:155
#3 0x00007f35ecd8efa9 in KWin::DrmOutput::updateCursor() (this=<optimized out>) at /home/meven/kde/src/kwin/plugins/platforms/drm/drm_output.cpp:179
#4 0x00007f35ecd81db5 in KWin::DrmBackend::updateCursor() (this=0x5645bec743a0) at /home/meven/kde/src/kwin/plugins/platforms/drm/drm_backend.cpp:701
#5 0x00007f36049e7fe7 in () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6 0x00007f36075ee43f in KWin::Cursors::currentCursorChanged(KWin::Cursor*) (this=<optimized out>, _t1=<optimized out>)
at /home/meven/kde/build/kwin/kwin_autogen/EWIEGA46WW/moc_cursor.cpp:385
Test Plan: Could not reproduce
Reviewers: #kwin, zzag, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: ngraham, apol, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28889
Summary:
It turns out DRM connectors are not static and may change over time.
This patch refreshes them right before looking for new outputs.
BUG: 419061
FIXED-IN: 5.19.0
Test Plan:
Seems to work better, it's still not ideal but I think there's an unrelated bug
sending updates to clients.
Reviewers: #kwin, davidedmundson, meven
Reviewed By: #kwin, davidedmundson, meven
Subscribers: dalbers, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28642
Summary:
AbstractOutput::name() behaviour is changed so that it matches the X11
behaviour, showing an identifier like "HDMI-0".
XdgOutput.name is set to this name.
XdgOutput.description is currently set to the manufacturer name and
model, but it's not exposed to Qt so we probably don't care too much.
This should fix plasmashell changing applets when switching between X11
and wayland.
Test Plan:
Relevant unit test
I still need to run it on my laptop.
Reviewers: #kwin, #plasma, zzag
Reviewed By: #kwin, #plasma, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28230
Summary:
Print automatically a few properties as well as the type, so it's easier
to read debug information.
Test Plan: Debugged a fix with it
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28641
Summary:
As is KWin only had 1 Cursor which was a singleton. This made it impossible for
us to properly implement the tablet (as in drawing tablets) support and show where
we're drawing.
This patch makes it possible to have different Cursors in KWin, it makes all the
current code still follow the mouse but the tablet can still render a cursor.
Test Plan: Tests pass, been using it and works as well as before but with beautiful tablet cursors.
Reviewers: #kwin, cblack, davidedmundson
Reviewed By: #kwin, cblack, davidedmundson
Subscribers: davidedmundson, cblack, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28155
Summary: No need to keep them around for no reason.
Test Plan: Tested the plugins I thought could be affected. Have been using it for a couple of days without problems
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28062
Summary:
Currently, we have only one shell client type - XdgShellClient. We use
it when we are dealing with Wayland clients. But it isn't really a good
idea because we may need to support shell surfaces other than xdg-shell
ones, for example input panel surfaces.
In order to make kwin more extensible, this change replaces all usages
of the XdgShellClient class with the AbstractClient class.
Test Plan: Existing tests pass.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D27778
Summary:
This functionality will instead be implemented in KScreen such that manual and
automatic output rotation can be used and configured through a single UI in
unison together.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin, bshah, davidedmundson, zzag
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D26036
Summary:
The calculation of cursor position and orientation on outputs rotations other
than 0° and 180° was faulty.
This patch fixes both.
Test Plan: In live session cursor looks and moves as expected.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D25909
Summary:
The previous code uses a fixed version of GSLS which does not match our suported GL targets. We need both, using kwin's existing MapTexture framework we can achieve the same thing in a better way with less code.
Test Plan:
Had some slight issues with the rotation, but everything appeared the same
as when I applied the patchset with the custom shader.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D26371
Summary:
In case the hardware is not able to rotate the output for the configured
rotation value do this rotation in a post-process step.
For that rendering the current view into a separate framebuffer bound to a
texture that then gets sampled to the default framebuffer in an additional
rendering pass through a simple shader rotating it.
This allows us to leave the Effects system and internal model-view-projection
matrix untouched. The rotation in the post-processing step is isolated.
BUG: 389665
FIXED-IN: 5.18
Test Plan: With KScreen all rotations work.
Reviewers: #kwin
Subscribers: davidedmundson, PureTryOut, z3ntu, zzag, univerz, kwin
Tags: #kwin
Maniphest Tasks: T6106
Differential Revision: https://phabricator.kde.org/D25907
Summary:
Planes might be able to do transformations without compositing required.
When changing the current transform try this with the primary plane. If this
fails fall back to no transformation at all through hardware and communicate
the fact and other information through some getters.
Also adds an environment variable to never do hardware transformations.
Test Plan: Compiles.
Reviewers: #kwin
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D25906
Test Plan:
KScreen now shows "Dell Inc." instead of DEL and
"Eizo Nano Corporation" instead of ENC in output names, which
matches closer to what's written on my monitors.
Reviewers: graesslin, davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: apol, feverfew, ngraham, davidedmundson, mart, kwin, sebas
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D10041
Summary:
Otherwise the content overflows the frame when scrolling.
QQC2 scrollview docs say "ScrollView does not automatically clip its contents. If it is not used as a full-screen item, you should consider setting the clip property to true"
Test Plan:
Before:
{F8121150}
After:
{F8121152}
Reviewers: #kwin, #plasma, ngraham
Reviewed By: ngraham
Subscribers: ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D27558
Summary:
Otherwise the content overflows the frame when scrolling.
QQC2 scrollview docs say "ScrollView does not automatically clip its contents. If it is not used as a full-screen item, you should consider setting the clip property to true"
Test Plan:
Before:
{F8121150}
After:
{F8121152}
Reviewers: #kwin, #plasma, ngraham
Reviewed By: ngraham
Subscribers: ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D27558
Summary:
Set outputs enablement also when none outputs are present. This patch is
similar to earlier attempt at D17985.
BUG: 402827
BUG: 389551
BUG: 398680
BUG: 413758
Test Plan:
Starting without outputs, manual disconnects and DPMS changes. There is still
an issue when an output gets disconnected while the DPMS is off. But it's an
improvement already.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Maniphest Tasks: T10016
Differential Revision: https://phabricator.kde.org/D26511
When initializing a property we loop through the drmModeObjectProperties
object and search for the property by its name.
Once found we create the Property object and there should be not another one
with the same name afterwards. In any case we would leak memory. Therefore just
directly return once the property was found.
This gives us the added benefit that we can put out a warning in case the
property was not found in the loop, what should not happen with the properties
we use.
This is just a code cosmetic change to have the same values internally like the
kernel for the type enum. In the logic there should not be a difference since
the enum values are mapped at runtime.
Summary:
This cleans up some of the code, moves and deletes superfluous functions,
improves in-code docs and runtime warnings.
Test Plan: On vt.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D25867
Summary:
This is a small overhaul of the EglGbmBackend. Functions are restructured,
white space added and variables renamed for better readability and style
aligned with Frameworks Coding Style.
Test Plan: Session starts.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D25830
Summary:
Small intermediate refactor. For now just do the normal rotation when a flipped
transform is requested. In the future we might want to provide the possibility
to flip the output image.
Test Plan: Compiles
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D25649
Summary:
Instead of using Qt::ScreenOrientation use an enum class that is directly
mapped to KWayland's transformation enums. This simplifies the code.
Test Plan: Compiles and transformations work as before.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Maniphest Tasks: T11670
Differential Revision: https://phabricator.kde.org/D25558
Summary:
In case of a failed atomic commit the previous mode should be fallen back to.
For orientation provide again a setter that DRM backend can use to set the
transform back to the last working one.
Test Plan: Compiles, fallback works, cursor still messed up somewhat (scaling issue?).
Reviewers: #kwin
Subscribers: zzag, kwin
Tags: #kwin
Maniphest Tasks: T11670
Differential Revision: https://phabricator.kde.org/D25507
Summary:
We use internally Qt:ScreenOrientation for representing output transforms.
This is not ideal since the values do not map directly to Wayland transform
values, but we can make it work by using OR combinations of
Qt:ScreenOrientations.
Do this for now and see if we should not better introduce an internal enum
mapped directly.
Additionally the OR combinations need to be handled in the drm backend at
various places accordingly as well (see TODOs).
Test Plan: Compiles
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Maniphest Tasks: T11670
Differential Revision: https://phabricator.kde.org/D25505
Summary:
Move the Wayland output device and output transform calls from DRM backend
to AbstractWaylandOutput. This leaves still some loose ends that need to be
tied up later. On failed commit we want to fall back to last working state
and orientation getter in general needs some more refactoring.
Test Plan: Compiles.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Maniphest Tasks: T11670
Differential Revision: https://phabricator.kde.org/D25504
Summary:
Selecting not to vsync does not make sense for an X11 compositor. In the end
we want clients to be able to present async if they want to but the compositor
is supposed to send swaps with vsync to the XServer in order to not generate
tearing artifacts.
There was also a detection logic which did some questionable things in case
vsync was not available. I don't think this is necessary at all since we can
just always run a timer to present with or without vsync.
Test Plan: kwin_x11 tested on i915.
Reviewers: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Maniphest Tasks: T11071
Differential Revision: https://phabricator.kde.org/D23511
Summary:
The initial blank needs to happen after the output device has been
initialized to get the current mode size.
Also we can't assert in legacy mode on the page flip pending since
a page flip can also be the result of a CRTC blank using a different.
BUG: 412684
FIXED-IN: 5.17.1
Test Plan: Full Plasma session
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24829
Summary:
Rotation in the past was not working in the DRM backend reliable. Now on 5.17
it even freezes the KWin session, so for now we need to just disable it trying.
Test Plan:
Tried to change Rotation with KScreen. Nothing happened but session was still
usable afterwards.
Reviewers: #kwin
Subscribers: ngraham, jriddell, bshah, zzag, apol, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24112
Summary:
Lot of mobile devices, as well as tablet devices use the DSI connector,
for internal screens. This is more common in ARM devices, so consider
them as internal display as well.
Test Plan: checked on the device with DSI screen, it was considered internal
Reviewers: #kwin, romangg
Reviewed By: #kwin, romangg
Subscribers: romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24209
Summary:
Rename ShellClient to XdgShellClient in order to reflect that it
represents only xdg-shell clients.
Test Plan: Compiles, tests still pass.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23589
Summary:
In some environemnts it is possible that udev detection of primary GPU
fails and it picks the first available card (normally card0). But it is
not desired, and it would be required to use different card (card1).
Introduce environment variable, which when used, will make it possible
to use different card node then one selected by udev.
You can use it like KWIN_DRM_DEVICE_NODE=/dev/dri/card1 kwin_wayland
Test Plan: Tested on the device where card0 was not usable for kms, but card1
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24051
We have lots of inconsistency at the moment in CMakeLists.txt files. Most
of it is due to kwin being a very old project. This change hopefully fixes
all of it.
Summary:
This patch further refines output management.
We go now through AbstractWaylandOutput virtual functions to enable and
disable outputs.
Dpms changes and enablement switches use separate code paths at start in the
Drm backend code since they are similar but not the directly same. Common code
is shared though, functions are renamed accordingly.
Asserts have been put in place to better understand and check the control
flow. A seemingly unnecessary call to DrmOutput::pageFlipped on reactivation
after Vt switch has been removed to allow for that.
In future patches we need to look additionally at the legacy mode switching
code path which was and is still not working and better handling of the
current monitor Dpms state. For example a monitor being switched off is not
properly acted on and the workspace still expanded.
Test Plan:
With one and two monitors:
* Dpms off/on
* Vt switches
* Screen disable/enable
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Maniphest Tasks: T11459
Differential Revision: https://phabricator.kde.org/D23600