Commit graph

14 commits

Author SHA1 Message Date
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
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
2019-06-17 16:34:38 +03:00
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
2019-06-17 12:09:04 +03: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
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
2019-04-25 00:45:06 +01:00
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
2018-11-14 20:05:39 +01:00
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
2018-11-14 20:04:29 +01:00
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
2018-11-14 20:00:28 +01:00
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
2018-11-14 19:59:09 +01:00
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
2018-11-14 19:57:25 +01:00
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
2018-11-14 19:56:07 +01:00
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
2018-11-14 19:54:29 +01:00
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
2018-11-09 19:47:23 +01:00
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
2018-08-31 11:53:12 +02:00