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:
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
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
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
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
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
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
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
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
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
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
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
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.
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