Commit graph

228 commits

Author SHA1 Message Date
Xaver Hugl
b50f747876 Multi-GPU output support on Wayland
This commit sets up udev and the DrmBackend to list and use all GPUs.

BUG: 425586
BUG: 417323
2020-10-05 21:05:55 +00:00
l10n daemon script
30b516eceb SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-09-30 06:16:48 +02:00
Aleix Pol
9479c0d6b4 Do not call randomly eglGetError() after eglMakeCurrent
If it failed, it will return accordingly, and then we get to call
eglGetError, only when it fails.
2020-09-23 10:05:30 +00:00
Aleix Pol
61e655f7f7 Centralize WindowPixmap buffer updating code
Uses a setter and clear method pattern rather than having the code
repeated.
Instead of keeping a QPointer, now we are a QObject and we get notified
about destruction intention directly, so we can clear the pointer when
necessary.
2020-09-22 13:04:35 +00:00
Aleix Pol
fec4e058e5 Do not try to create a gbm dmabuf when gbm is not available
Allows us to take the fallback path instead of just crashing
2020-09-15 15:45:44 +02:00
Vlad Zahorodnii
848f7f3177 Revert "plugins/drm: Link against Wayland::Server"
This reverts commit efb9e0edb2.

libwayland-server is now in the link interface of kwayland-server.
2020-09-02 19:31:29 +03:00
Vlad Zahorodnii
efb9e0edb2 plugins/drm: Link against Wayland::Server
We need to link against Wayland::Server because the EGL Streams protocol
wrapper uses wl_array in its public API.
2020-09-02 16:10:25 +00:00
Aleix Pol
eeeac04974 Implement EGL_KHR_partial_update and EGL_EXT_swap_buffers_with_damage
Summary:
Notify the driver about the parts of the screen that will be repainted.
In some cases this can be benefitial. This is especially useful on lima
and panfrost devices (e.g. pinephone, pinebook, pinebook pro).

Test Plan:
Tested on a pinebook pro with a late mesa version.
Basically I implemented it, then it didn't work and I fixed it.
Maybe next step we want to look into our damage algorithm.
2020-08-19 14:51:42 +00:00
Aleix Pol
d5da366507 Add a generic Output::transformation method
Makes it possible to map any space into the output's coordinates system
2020-08-19 14:51:42 +00:00
Vlad Zahorodnii
4ce853e8e4 Prettify license headers 2020-08-07 19:57:56 +00:00
Vlad Zahorodnii
1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00:00
Andrey Butirsky
307a9bc559 Avoid crash in KWin on Session leave
BUG: 420077

- hunk of original commit e8a1f8ecc seems was lost during a94be708e merge,
so restoring it again
- add missing check

Original Differential Revision: https://phabricator.kde.org/D28889
2020-08-06 12:21:03 +00:00
Vlad Zahorodnii
d4ec18d844 Fix build 2020-07-29 15:35:50 +03:00
Chaojiang Luo
def9817a7e fix:Check image map nullptr error
The map may be failed, we should check the image map is succeed first.

Signed-off-by: luochaojiang <luochaojiang@uniontech.com>
2020-07-29 12:11:17 +00:00
Aleix Pol
03b12d1dfc drm: Use introspection to print enums
Removes a bit of code and allows to list the supported
transformations on the same line, which is useful to be able to
grep over the output.
2020-07-29 10:39:47 +00:00
Aleix Pol
4eda4d2b5d drm: prevent cursor buffer leakage
Use smart pointers to make sure we don't dereference valid pointers.
2020-07-27 09:29:11 +00:00
Aleix Pol
edb6159396 drm: we must not call showCursor when softwareCursor is on
Otherwise we'll show a dangling cursor but otherwise the cursor will be
updated by other code paths, so we end up with a weird cursor in the
middle of the screen that doesn't move.
2020-07-27 09:29:11 +00:00
Vlad Zahorodnii
e7b8a5ad5e Remove remote-access leftovers
We've switched to PipeWire for screen casting \o/.
2020-07-23 18:19:49 +03:00
Aleix Pol
4ddefd37bd screencasting: Remove deprecated RemoteAccessManager interface
In favour of zkde_screencast_unstable_v1
2020-07-23 13:14:31 +02:00
Aleix Pol
02042908aa screencasting: implement wayland output streaming for egl and wayland backends 2020-07-23 13:14:31 +02:00
Aleix Pol
42e543c5b2 screencasting: implement intefraces to create dmabuf textures 2020-07-23 13:14:22 +02:00
Vlad Zahorodnii
036ad759e0 [wayland] Adapt to SurfaceInterface changes 2020-07-15 12:46:28 +00:00
Adrien Faveraux
bb138d7668 Adapt EglStream to KwaylandServer 2020-07-14 10:09:43 +00:00
Andreas Haratzis
6c9026628c Fix DrmOutput sometimes being freed with a pending pageflip, often when waking from sleep.
It is possible for updateOutputs to be called when a pageflip is pending.
Freeing a DrmOutput with a pending pageflip is not allowed (see ~DrmOutput assert - the page flip handler will be called on the freed memory, possibly leading to use-after-free).
This works around the problem by delaying the destruction with teardown().

BUG: 422460
2020-07-07 18:33:28 -07:00
Chaojiang Luo
0ef5ddfd47 [drm] Do not blank crtc in atomic mode
In atomic setting mode, when external display tears down, it will blank
crtc with dump buffer by legacy api, then re-plug the external display,
the blank can not be removed. We think the blank is not needed in atomic
mode setting.

Signed-off-by: Chaojiang Luo <chaojiangluo@163.com>
2020-07-03 12:09:34 +08:00
Aleix Pol
e1bf133de7 Fix support for systems with age disabled
If no damage is supported, repaint all the output rather than nothing.
2020-06-22 09:46:27 +00:00
l10n daemon script
c10fe06d06 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-06-18 05:44:57 +02:00
l10n daemon script
0e117c49a1 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-06-17 14:12:29 +02:00
l10n daemon script
29915632df SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-06-04 05:12:36 +02:00
Méven Car
5c3e03259a DrmOutput: Ensure waylandOutput dpms mode matches DrmOutputs
After 797ccca48c
It appeard WaylandOutput (OutputInterface) would never get their Dpms
mode.
2020-05-27 10:07:39 +02:00
Méven Car
797ccca48c Wayland: avoid binding disabled outputs to surfaces
We don't need to bind disabled outputs to surfaces that overlaps them.
This prevents error down the line and warnings about ignoring surface.enter events with Qt.

BUG: 419749
2020-05-26 15:14:13 +00:00
Bhushan Shah
6caad6ee2f Merge branch 'Plasma/5.19' 2020-05-21 14:26:28 +05:30
Bhushan Shah
b2df11bf7e [platforms/drm] show cursor only when it is enabled
In previous code we used to update/show cursor even when the pointer
device was present, e.g mobile device. Guard it behind the cursor
enabled check.

BUG: 418977
FIXED-IN: 5.19.0
2020-05-21 12:38:02 +05:30
Méven Car
b77d29119e Drm backend: delete DrmOutput* after DrmScreens notified its users
Test:

Plug-in and out HDMI screen

Before:
Crash when pluggin-in
After:
No crash
2020-05-19 17:25:19 +02:00
Aleix Pol
3a9d7a6e9d Port KWin to KWaylandServer
Summary: Away from KWayland::Server and KF5WaylandServer.

Test Plan: Builds, ran nested session

Reviewers: #kwin, #plasma, #frameworks, davidedmundson, zzag

Reviewed By: #kwin, #plasma, davidedmundson, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29278
2020-04-30 12:56:08 +02:00
Vlad Zahorodnii
c61b85f502 Revert "Fix build with Qt 5.12, Qt::hex and Qt::endl"
This reverts commit d18449c743.

Differential Revision: https://phabricator.kde.org/D29147
2020-04-24 10:18:45 +03:00
Méven Car
a94be708ef Merge branch 'Plasma/5.18' 2020-04-17 18:31:23 +02:00
Méven Car
e8a1f8eccc Avoid crash in KWin::DrmOutput::updateCursor
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
2020-04-17 18:25:31 +02:00
Aleix Pol
85b322ad9c drm: Fix hotplugging docking stations
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
2020-04-09 00:45:23 +02:00
Aleix Pol
6a33533816 drm: properly access a scoped pointer
Differential Revision: https://phabricator.kde.org/D28680
2020-04-08 16:26:07 +02:00
Aleix Pol
16fe8dbd88 drm: Don't leak planes 2020-04-08 16:12:03 +02:00
Aleix Pol
fa654bda59 drm: Improve QDebug of DrmOutput
Instead of printing as QObject, provide actual information of the
instance.
2020-04-08 16:11:44 +02:00
David Edmundson
a13ecf8d0e [wayland] Add new XdgOutput properties
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
2020-04-08 10:39:59 +01:00
Aleix Pol
f6029c3dbd debugging: Simplify printing DrmObjects through QDebug
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
2020-04-07 13:23:05 +02:00
Aleix Pol
6abd23ed02 Make it possible to have a separate cursor for the tablet
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
2020-04-03 01:16:45 +02:00
Aleix Pol
d18449c743 Fix build with Qt 5.12, Qt::hex and Qt::endl 2020-03-17 15:57:11 +01:00
Daniel Vrátil
9bd91e66cd
fix: make hwdata truly a runtime dependency
Summary: Followup to comments in D10041

Reviewers: #plasma, ngraham, davidedmundson, zzag

Reviewed By: #plasma, ngraham, davidedmundson, zzag

Subscribers: iasensio, wstephenson, davidedmundson, zzag, ngraham, kwin, cgiboudeaux

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27729
2020-03-17 15:39:17 +01:00
Aleix Pol
cca0e15b45 Fix compiler warnings
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
2020-03-17 15:07:52 +01:00
Vlad Zahorodnii
be759b7d33 Use AbstractClient instead of XdgShellClient wherever possible
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
2020-03-04 09:57:13 +02:00
Roman Gilg
2c66e1f690 Remove orientation sensor
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
2020-02-29 09:59:30 +05:30