Commit graph

18 commits

Author SHA1 Message Date
Sebastian Kügler
d8a3e0525f First part of outputmanagement wayland interface
This patch implements read access to the outputmanagement interface in
kwin_wayland's drm backend.

- outputdevices are created in DrmOutput, just like the wl_outputs
- wayland_server implements the outputmanagement interface and
- passes the changesets down into the backend

This means that the interface is announced, independently of the DRM
backend, but the actual outputs are currently only there if the DRM
backend is used.

The changes are not applied (passed into the kernel's drm interface
yet). This is obviously work-in-progress, so it's incomplete. Since it
allows us to run kwin[master] with the libkscreen KWayland backend, it's
a significant step allowing testing and further development.

Reviewed-by: Martin Gräßlin
2016-03-10 19:57:07 +01:00
Martin Gräßlin
a029300ce5 Rework cursor image handling for Wayland
So far updating the cursor image was not really defined. It was possible
to use the cursor image from the wayland seat or have a custom set cursor
image. But there are no rules in place to decide which one to use when.

With this change a dedicated CursorImage class is introduced which tracks
the cursor image changes on the seat, on the decoration, in the effects
and so on. In addition it tracks which is the current source for the
image, that is whether e.g. the cursor from the seat or from effects
override should be used. Whenever the cursor image changes a signal is
emitted, which is connected to the signal in AbstractBackend.

Based on that the backends can directly show the image. The existing
code in the backends to install a cursor shape or to install the cursor
from the server is completely dropped. For the backend it's irrelevant
from where the image comes from.

A new feature added is that the cursor image is marked as rendered. This
is then passed on to the frame rendered in the Surface and thus animated
cursors are finally working. Unfortunately animated cursors are broken in
Qt (see https://bugreports.qt.io/browse/QTBUG-48181 ).
2016-02-25 08:14:48 +01:00
Martin Gräßlin
a66eb1a5b9 [backends/drm] Double Tap to enable output
If the output is off a double tap (touch) can re-enable it. The two
taps have to happen in the double click interval (we don't have
something better and it kind of matches) and have to be by only one
touch point. If there are multiple touch points it's not considered
as a double tap. A todo is to restrict the possible distance of the
two taps to one thumb.

Tested-By: Marco Martin
2016-02-15 17:35:36 +01:00
Martin Gräßlin
5b1eb584d6 [backends/drm] Fix typo
Thanks to kbroulik for noticing that I really, really should bye a
new keyboard as it's eating my "p" key.
2016-02-15 16:30:22 +01:00
Martin Gräßlin
57b11f8429 [backends/drm] Use an InputEventFilter to reenable outputs
So far the DrmOutput connected to all input events when going into
power saving. As we now have the input filters it's better to just
install a filter when an output goes into powersave and remove the
input filter again when all outputs are enabled again.

To make this work InputRedirection gains a new method to add a new
filter as the first filter. This is a potentially dangerous method
as it allows to have a filter before LockScreenFilter gets the
events. But in case of DPMS it's something we actually want.

A nice new feature possible with the input filter is that we can
filter out the event which re-enables the outputs. Thus when getting
on a system with output off and screen locked, the first key hit
doesn't go to the lock screen.

Reviewed-By: Bhushan Shah
BUG: 341201
Fixed-in: 5.6.0 (Wayland-only)
2016-02-15 15:53:43 +01:00
Martin Gräßlin
a18177cc24 [backends/drm] Set mode when changing from/to a gbm buffer
Tiling configurations of DRM and GBM buffers differ, so we need to
explicitly set the mode when it changes.

BUG: 357543
FIXED-IN: 5.5.4
2016-01-11 12:53:14 +01:00
Martin Gräßlin
cbbd684430 [drm] Support configuring absolute output position
Begin of proper multiscreen support!

We load configuration sets for the connected outputs. Each set of
screens represents a unique configuration. For that we use the md5
sum of the edid+connector as uuid of an output. Each of the md5 sums
is then used to create a uuid of the output set. We can be quite certain
that this will generate unique ids for the use cases we will face.

The uuids are used as group names. And from there we read the global
position.

The uuids are considered internal information. It is not intended for
users to configure manually in the config file. The intended way to
configure will be the OutputManagementInterface which recently got added
to KWayland. Once KWin applies a configuration it will store it to config
so that it can be loaded on next startup.

The configuration looks like:
[DrmOutputs][abcdef0123][0123abcdef]
Position=0,0

[DrmOutputs][abcdef0123][fbca3bcdef]
Position=1280,0

This is an example for two outputs set next to each other.

Reviewed-By: Sebastian Kügler
2015-11-06 14:48:52 +01:00
Martin Gräßlin
ffa075490e [drm] Mark outputs as disabled in backend depending on DPMS state
Whenever the dpms of an output changes we update the outputs enabled
state in the AbstractBackend.
2015-09-10 14:31:46 +02:00
Martin Gräßlin
e3ff85d4d9 [drm] Re-enable Output on input event
If an Output went into DPMS standby we need to re-enable the Output
once we get any input event.

For this we connect to the signals of InputRedirection once we go
to standby. Once we enable again, we disconnect (to not handle the
events all the time), blank the screen (initial modesetting) and
trigger a complete repaint.
2015-09-10 14:31:46 +02:00
Martin Gräßlin
6281cf84b4 [drm] Make DrmOutput a QObject
Needs to emit signals when DPMS changes and also needs private slots
when DPMS changes.
2015-09-10 14:31:46 +02:00
Martin Gräßlin
902bdb6cf0 [drm] Add initial support for DPMS
We read the drm property for the connector and set dpms initialy to On.
2015-09-10 14:31:46 +02:00
Martin Gräßlin
4c03115882 [backends/drm] Fix crash in cleanup of DrmOutput
During cleanup the KWayland::OutputInterface is already destroyed before
we hit the cleanup code of DrmOutput. Thus guard with a QPointer to not
delete twice.
2015-06-29 12:47:29 +02:00
Martin Gräßlin
f30eb50756 [drm] Implement Screens::refreshRate 2015-05-19 09:49:37 +02:00
Martin Gräßlin
f5d123d61e [drm] Implement Screens::name
As name of screen we use the information passed to the OutputInterface:
a combination of manufacturer and model name.
2015-05-19 09:35:57 +02:00
Martin Gräßlin
2220ae44c4 Create a plugin for each of the wayland backends
Each of the backends becomes a plugin. This allows kwin_wayland to load
the requested plugin and kwin itself doesn't need to link all the
libraries needed. E.g. libdrm is no longer linked if running kwin_x11.
Also this allows to create backends for the non-standard EGL platforms
(examples could be raspberrypi or Android devices).
2015-05-06 10:31:39 +02:00
Martin Gräßlin
0782252f72 [wayland] AbstractBackend provides signal screensQueried
With this change all backends need to emit the screensQueried signal
at some point. So far only x11 backend did not provide the signal,
wayland had a comparable delayed init mechanism. Now all backends use
the same mechanism.
2015-05-06 09:05:37 +02:00
Martin Gräßlin
c4f8bed815 [wayland] Use a pure virtual AbstractBackend::init method
Two backends already used an init method, let's make that the same
in all backends to be able to have shared startup code.
2015-05-06 08:34:26 +02:00
Martin Gräßlin
72db1e63a3 [wayland] Move backend implementations into a backends/<name> directory
The aim is to be able to create a plugin for each of the backends.
The following directories are created:
* backends/drm
* backends/fbdev
* backends/wayland
* backends/x11
2015-05-05 13:05:37 +02:00
Renamed from drm_backend.h (Browse further)