15 Commits (eb186a78a1f267c3c57633746ff267d0597e8bc2)

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
5 years ago
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
5 years ago
Vlad Zagorodniy 8e88139fd6 Overhaul AbstractOutput
Summary:
There are several issues with code of AbstractOutput class:

(a) Some methods are documented, and some are not. In general, we tend
    to document all public methods in KWin core. It looks like a very
    minor issue, but there are methods that have very ambiguous return
    value. One such method is geometry(). It's not obvious whether the
    returned geometry is in device independent pixels or not;

(b) There's a mix of methods defined in the cpp file and in the header.
    This is not very good because reading such code becomes a bit harder
    if you don't use any fancy IDE;

(c) Missing Q_DISABLE_COPY, etc.

This change addresses these issues, so the code is a bit more readable
and easier to work with.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: broulik, cfeck, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21874
5 years ago
Vlad Zagorodniy 0d381846f1 Backport Night Color feature to X11
Summary:
The color correction manager doesn't make any specific assumptions about
underlying platform, e.g. whether it's x11, etc. The platform just
has to be capable of setting gamma ramps. Given that, there are no any
significant technical blockers for making this feature work on x.

Reviewers: #kwin, davidedmundson, romangg

Reviewed By: #kwin, davidedmundson, romangg

Subscribers: romangg, neobrain, GB_2, filipf, davidedmundson, ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D21345
5 years ago
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
5 years ago
David Edmundson c4ab885616 Initialise XdgOutput properties on creation
Summary:
initWaylandOutput can be called before or after all properites are set.
If it's called after, we need to still have xdgOuput set correctly.

Test Plan:
Simplified Aleix's patch that avoids a no-op setScale call
Now it works.

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20800
5 years ago
Roman Gilg 6857fe5477 Add output orientation size helper
Summary:
In order to reduce code duplication add this helper
to AbstractOutput.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16794
6 years ago
Roman Gilg 6295d1e6a2 Move output refresh rate getter into AbstractOutput
Summary:
The current refresh rate is stored in OutputInterface. Move the getter
therefore in the AbstractOutput class.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16793
6 years ago
Roman Gilg 93f78c2d23 Set outputs enabled in AbstractOutput
Summary:
Nothing hardware specific anymore in setEnabled method,
therefore put it in AbstractOutput.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T10016

Differential Revision: https://phabricator.kde.org/D16790
6 years ago
Roman Gilg 32a9a61889 Abstract OutputDevice initialization
Summary:
Move generic Wayland parts of OutputDevice initialization into
AbstractOutput class.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Maniphest Tasks: T10016

Differential Revision: https://phabricator.kde.org/D16789
6 years ago
Roman Gilg 27946199b6 Abstract output dpms handling
Summary:
Move init and Wayland side changes of dpms modes into
AbstractOutput.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Maniphest Tasks: T10016

Differential Revision: https://phabricator.kde.org/D16787
6 years ago
Roman Gilg e2b1bcea1b Set mode in AbstractOutput
Summary:
Set the mode in AbstractOutput and call into the plugin
for final change on hardware.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Maniphest Tasks: T10016

Differential Revision: https://phabricator.kde.org/D16786
6 years ago
Roman Gilg 254a807374 Handle Wayland change sets in AbstractOutput
Summary:
Move Wayland change set handling to AbstractOutput and create
virtual functions to call into the hardware implementation

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T10016

Differential Revision: https://phabricator.kde.org/D16785
6 years ago
Roman Gilg 21aee588af Initialize Wayland output in AbstractOutput
Summary:
Wayland output is on protocol level and not dependent on the hardware
platform. Next steps are to do the same for output device and then let
the virtual output call into these initializing functions as well.

Test Plan: Manually and auto test.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16783
6 years ago
Roman Gilg fe63e21f80 Introduce generic Output class
Summary:
In order to separate high-level properties of individual outputs from
hardware-specific ones and access these, introduce a new generic class Output.

Also make the DrmOutput class directly a child class of this generic class.

The long-term goal is to get rid of the Screens global object on Wayland and
instead directly work with Output objects on compositing level.

This should enable us long-term to do direct scanout to hardware planes, what
I predict needs this generic output representation at one point.

Test Plan: Manually.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11781
6 years ago