Commit Graph

5 Commits (8d0554e45a8f8628b8b4dd233d983a3a4f1a6562)

Author SHA1 Message Date
Roman Gilg 9cf2730f8d [colorcorrection] Set gamma through Output class
Summary:
With the new Output class we can set the gamma directly here. This is also
a stepping stone to adjust individual output gamma adjustment later on.

This means any future backend, which aims to support the color correction
frontend needs to use the Output class.

Test Plan: Night Color test still passes.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11803
2018-08-31 11:58:21 +02:00
Roman Gilg 99fec3d245 [colorcorrection] Apply current color temperature on screen hot plug
Summary:
Current color temperature must be applied immediately to hot pluged outputs.

BUG: 391623

Test Plan:
Manually. I'm working on auto tests with the new virtual output classes, but
since 5.12.4 will land before I can finish this work, I have to get this fix
in without them.

Reviewers: #kwin, broulik

Reviewed By: broulik

Subscribers: martinkostolny, broulik, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11654
2018-03-27 09:51:34 +02:00
Roman Gilg dbdaf6c839 [Night Color] Check read in mode value
KConfigSkeleton does not check arbitrary enum values on being
correct. So we do it explicity in our code.

Reviewers: #kwin, graesslin

Subscribers: kwin, plasma-devel, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9310
2017-12-15 00:50:34 +01:00
Roman Gilg 112d30b5d1 Fix BSD build 2017-12-13 12:07:59 +01:00
Roman Gilg 82d2860469 [colorcorrection] Night Color - blue light filter at nighttime
With Wayland KWin needs to provide certain services, which were provided
before that by the Xserver. One of these is gamma correction, which includes
the - by many people beloved - functionality to reduce the blue light at
nighttime. This patch provides the KWin part of that. It is self contained,
but in the end will work in tandem with a lib in Plasma Workspace and a KCM
in Plasma Desktop, which can be used to configure Night Color.

* Three modi:
** Automatic: The location and sun timings are determined automatically
   (location data updates will be provided by the workspace)
** Location: The sun timings are determined by fixed location data
** Timings: The sun timings are set manually by the user
* Color temperature value changes are smoothly applied:
** Configuration changes, which lead to other current values are changed
   in a quick way over a few seconds
** Changes on sunrise and sunset are applied slowly over the course of few
   minutes till several hours depending on the configuration
* The current color value is set immediately at startup or after suspend
  phases and VT switches. There is no flickering.
* All configuration is done via a DBus interface, changed values are tested
  on correctness and applied atomically
* Self contained mechanism, speaks directly to the hardware by setting the
  gamma ramps on the CRTC
* Currently working on DRM backend, extensible to other platform backends in
  the future
* The code is written in a way to make the classes later easily extendable to
  also provide normal color correction, as it's currently done by KGamma on X

Test Plan:
Manually with the workspace parts and added integration tests in KWin using
the virtual backend.

BUG:371494

Reviewers: #kwin, graesslin

Subscribers: kwin, plasma-devel, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5928
2017-12-11 10:58:40 +01:00