Commit graph

15 commits

Author SHA1 Message Date
Roman Gilg
6bfa931f2b Associate output transforms and orientations
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
2019-11-26 22:29:40 +01:00
Roman Gilg
523967b3ac Set transform in AbstractWaylandOutput
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
2019-11-26 22:24:58 +01:00
Roman Gilg
df3c1de848 [platforms/drm] Rework enablement and dpms switching
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
2019-09-05 17:36:21 +02:00
Roman Gilg
b3e7664d2c Replace Wayland/XDG outputs checks with enablement checks
Summary:
Make it more explicit what the relation is between Wayland and XDG objects
existing and enablement:

The ouput is enabled if and only if Wayland and XDG output objects exist.

We can simplify the code by replacing checks on the outputs with checking
the current enablement value.

Test Plan: Wayland nested and virtual backends.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23553
2019-09-05 17:29:08 +02:00
Roman Gilg
f7ff62e2e2 Lift output enablement into Platform
Summary:
This lifts the enablement code for outputs from the DRM backend to Platform
allowing other Wayland backends in the future to use this interface as well.

To do that we also create some helper functions on Platform level and have to
spill some KWayland classes into AbstractOutput what motivates a further split
of Platform into a Wayland child class like for AbstractOutput.

Test Plan: Disabled and enabled an output in DRM session.

Reviewers: #kwin

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23545
2019-09-05 17:22:44 +02:00
Roman Gilg
e8fada8a36 Get name and refresh rate from output device
Summary:
We can simplify the AbstractWaylandOutput code some more by getting name and
refresh rate of an output from the always available output device object.

Test Plan: Tested with DRM, Wayland nested and virtual backends.

Reviewers: #kwin

Subscribers: davidedmundson, apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23546
2019-08-29 16:04:09 +02:00
Roman Gilg
f2c5f85cae Assure wayland output interface creation path
Summary:
The Wayland and XDG output interfaces are created or destroyed when the
output is en- or disabled. This follows a clear path of dependencies and
we should not check if this is indeed the case but instead assert on it.

Test Plan: Nested Wayland and Drm sessions.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23540
2019-08-28 18:33:00 +02:00
Roman Gilg
331f5d7da7 Get output physical size from output device
Summary:
Get the physical size directly from the always available output device
interface instead of saving an additional copy in the abstract wayland
output class.

There is some ambiguity with orientation and naming that needs to be
cleaned up when output orientation is reworked.

Test Plan: Nested Wayland, Drm, virtual backends tested.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T11459

Differential Revision: https://phabricator.kde.org/D23496
2019-08-28 14:56:26 +02:00
Roman Gilg
dbb2cede08 Get output pixel size from output device
Summary:
Get the pixel size directly from the always available output device
interface instead of saving an additional copy in the backends.

Test Plan: Nested Wayland, Drm, virtual backends tested.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T11459

Differential Revision: https://phabricator.kde.org/D23495
2019-08-28 14:54:14 +02:00
Roman Gilg
819609a8a6 Get output position and scale from output device interface
Summary:
Let the data saved in OutputDeviceInterface be the single source of truth
and as low hanging fruits first do this for global position and scale.

Test Plan: Nested Wayland, Drm, virtual backends tested.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Maniphest Tasks: T11459

Differential Revision: https://phabricator.kde.org/D23489
2019-08-28 14:51:12 +02:00
Roman Gilg
0bcfb4d609 Rely on output device existence
Summary:
For every abstract wayland output an output device interface is created
by the backend directly after instance creation. We can therefore rely on
its existence and remove superfluous checks.

Test Plan: Relevant auto tests pass. Wayland nested and DRM sessions tested.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T11459

Differential Revision: https://phabricator.kde.org/D23486
2019-08-28 14:48:28 +02:00
Roman Gilg
0301c0866a Emit mode-change on all relevant changes
Summary:
The EGL GBM backend must be informed about mode changes so that the surface
gets reset. This fixes mode changes for me. Rotations still not work, this
needs some more structure cleanup.

Test Plan: Manually changed resolution and scale alone and together with KScreen.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23435
2019-08-26 12:41:42 +02:00
Roman Gilg
9bf7cbc7f6 Remove change-set null check
Summary:
It is unnecessary to check if the change-set is null when looking at the
KWayland code. Also the check would be useless at the moment anyway because
before the check we access the change-set already in the DRM backend and at
the check we would not return if it would be null.

Test Plan: Relevant auto tests pass.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23428
2019-08-26 12:38:23 +02:00
Roman Gilg
6ac1585e12 Fix xdg-output creation
In 1a11abc821 some function calls in the createXdgOutput function were
accidentally removed resulting in possibility of broken setup on startup.

Add these calls back again.
2019-06-14 12:10:28 +02:00
Roman Gilg
1a11abc821 [platforms/x11/standalone] Port to AbstractOutput
Summary:
Represent outputs in the X11 session via AbstractOutput. For that we
move all Wayland specific parts of AbstractOutput into a new subclass
AbstractWaylandOutput and let the outputs of our Wayland backends inherit
from there.

This should allow us to get rid of the Screens class later on.

Test Plan: Manually in X session.

Reviewers: #kwin, zzag, davidedmundson

Reviewed By: #kwin, zzag, davidedmundson

Subscribers: ngraham, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19208
2019-06-13 11:39:25 +02:00