Commit Graph

16 Commits (master)

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
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
Adriaan de Groot fcba278094 Handle differences in paths for Linux vs FreeBSD
- The name of tty devices is different; put detection into
  the CMakeLists and pass that as a define when building
  virtual_terminal.cpp -- this means no ifdeffery for the path.
- The name of dri devices is different; FreeBSD just has one.
2020-06-05 12:41:28 +02:00
Martin Flöser 825aa4ac38 [platform/virtual] Drop support for vgem and rendernode
Summary:
Instead we depend on the surfaceless platform for which we recently
added support. Thus the plugin does not need to use gbm and udev
anymore. So simplifies a lot.

Test Plan: ctest (prior to breaking change) passes

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18160
2019-01-12 07:37:25 +01:00
Nerdopolis Turfwalker 99376d38f6 udev: Only handle devices from the current seat
Summary: This prevents the firstFound device, or any device detected by UdevEnumerate::find that is not from the same seat kwin is running under, from being handled

Test Plan:
made sure that kwin starts on a default udev (assuming a blank ID_SEAT attribute on a device means the device is on seat0)

added /dev/dri/card1 to seat1 and /dev/dri/card0 to seat0.
Start kwin with the drm-backend on seat0 and seat1, and make sure it starts on both instances

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: rkflx, graesslin, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9553
2018-04-05 19:47:36 +02:00
Nerdopolis Turfwalker 7801afdd4c udev: Add the ability to query the current framebuffer.
Summary:
This adds the ability for kwin's udev handler to detect a usable framebuffer device.
This is very similar to the function that queries the primary GPU.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: rkflx, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9554
2018-04-05 19:46:20 +02:00
Martin Flöser 95a6f1ac2a Don't move local object in return statement
Clang complains that this prevents copy elision.
2017-08-19 14:10:59 +02:00
Martin Gräßlin 9bdc7b7d4b Do not move temporary objects
It prevents copy elision according to Clang and of course clang is
right.
2017-07-31 18:24:05 +02:00
Martin Gräßlin f15ceaffe6 Drop unused variable UdevMonitor::m_udev
Credits to clang for finding unused private fields.
2017-07-31 18:22:14 +02:00
Martin Gräßlin 56ce6689fd [platforms/virtual] Use rendernode or vgem device if available for egl
Summary:
The egl implementation for the virtual platform tries to use a render
node if available. If there is no render node it looks for a virtual
(kernel driver vgem) device, which unfortunately does not create a
render node in mainline kernel (there are patches in ChromiumOS).

For this the Udev wrapper is extended to search for renderNode devices
and for virtual dri devices.

If either render node or vgem dri device is found, it is tried to be
opened (without logind escalation) and on success a gbm device is
created on it. If any step of this fails the so far default behavior
of default device is tried for creating the EGLDisplay.

All of this is compile optional, so that the virtual platform does not
hard depend on udev and/or gbm.

Test Plan:
Auto tests which need OpenGL executed and verified that they
use the render node or vgem device.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2216
2016-07-21 09:13:57 +02:00
Martin Gräßlin d9a29f3a49 [udev] Add wrapper for udev_monitor 2015-04-24 12:03:20 +02:00
Martin Gräßlin cf27a056b8 [udev] Read property on UdevDevice 2015-04-24 12:03:20 +02:00
Martin Gräßlin c759551340 [wayland] Add a basic drm/kms backend
Introduces a new (optional) dependency: libdrm.

The DrmBackend currently supports finding the first connected output.
It can create shared memory buffers which are used by SceneQPainter to
do double buffered rendering.

There is still lots to do, the following things are not yet working:
* multiple outputs
* page flip
* OpenGL (through gbm)
* restoring mode setting to start value
2015-04-24 12:03:19 +02:00
Martin Gräßlin f135d92c00 [udev] Find the primary gpu by iterating drm devices 2015-04-24 12:03:19 +02:00
Martin Gräßlin e6b076df9c Move Udev into an own header and implementation
For a DRM backend we also need Udev, so don't bundle with libinput.
2015-04-24 12:03:19 +02:00