Summary:
some drivers, like Mali have EGL_KHR_platform_gbm
but not EGL_MESA_platform_gbm
Test Plan: pending a test on rock64 board
Reviewers: #kwin, #plasma, davidedmundson, graesslin
Reviewed By: #kwin, #plasma, graesslin
Subscribers: graesslin, garg, davidedmundson, plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D10346
Summary:
The support for interactive point selection was missing. This results in
the ColorPicker dbus API always returning an error on X11. We either need
to disable the ColorPicker on X11 or add support for this functionality.
As the X11 platform basically supports selecting a point in the
interactive window selection it makes more sense to add this missing
method in the platform than to disable support of color picker effect.
BUG: 387720
FIXED-IN: 5.12.1
Test Plan:
Run KWin/X11 on Xephyr and was able to pick a color and
kill a window
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10302
Summary:
The main reason for not having it as a mandatory dependency was that BSD
doesn't support it. But as I learned recently it is available on our CI
system. So BSDs have support now.
Even more it showed that the code doesn't compile if the dependency is
missing. And there's one thing I hate: broken build configuration
options.
So let's make UDEV and libinput a required dependency and get rid of the
problems.
Test Plan: Compiles
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10057
Summary:
While investigating BUG 387313 I noticed that blending might be disabled
for subsurfaces. Blending was disabled before rendering the subsurfaces
and it is not checked whether the surfaces have an alpha channel or not.
This change addresses this problem by disabling blending after all
subsurfaces have been rendered and enabling blending if a subsurface has
an alpha channel.
Unfortunately this does not fix the investigated bug.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10060
Summary:
x and y are always relative to the parent, adding parent.width to
calculate the position doesn't make sense.
Original author meant just "x: parent.width-1"
But we may as well just use anchors. Programatically it comes out the
same.
Test Plan:
No more weird vertical lines in the KCM when view is slightly less than 2 previews wide.
Modded colour to hardcoded "red" for easier visualisation, checked it looked ok when set as a real deco.
Reviewers: #plasma
Subscribers: plasma-devel, kwin, #kwin
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D9776
Summary:
This change finds the screen for a touch screen device based on:
* number available screens
* output name defined on the touch screen device
* internal screen
* and physical size
The id of the screen is stored in the Device allowing to adjust the
touch points accordingly. This means instead of transferring to the
combined display size the touch points are transferred into the output
space and the position of the output is added. Thus in a multi screen
system the touch points are properly mapped to the output.
Furthermore the screen orientation is passed to the Device and a
calibration matrix is set accordingly. Thus a transformed screen has the
touch screen transformed accordingly.
Please note that this only affects libinput on Wayland and not on X11!
The x11 standalone platform needs to gain similar code.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8748
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
Summary:
KWin was quite good in ensuring that you don't need to install by
passing paths to the tests. The new way is much nicer, so code is
adjusted for the new way. Also if we require a newer ECM in future we
need to support the new way.
No guarantee that the tests don't pick something up from the system env,
that needs more testing.
References: https://community.kde.org/Guidelines_and_HOWTOs/Making_apps_run_uninstalled
Test Plan: The tests which loaded helpers pass
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7543
Summary:
The addition of the test infrastructure is motivated by the regressions
caused by adding mode switching and transformation support.
A contributing factor to these regression is the fact that the DRM
platform does not have any tests. It is difficult to test this code as
it needs to work with hardware, thus we cannot use the real DRM library.
Instead we need to use mocking.
This change sets up some first basic tests with the help of a mockDrm
library. In order to better test the code as units the Drm classes are
slightly refactored. Most importantly the dependency to DrmBackend is
removed wherever possible and replaced by a simple int fd which is mostly
the only element used by the classes.
This first test introduces basic testing of a DrmObject. It is intended
to extend this to at least also test DrmPlane as a central piece of our
Drm platform plugin. This will also extend the tests of DrmObject.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D8776
Summary:
We need to keep the DrmOutput object to still have the
WaylandOutputDevice.
Screens currently start off enabled as before.
In order to keep KWin to have a correct index based list of screens we
need to store a second vector of currently enabled outputs for the
screens interface.
Test Plan:
Had dual screens.
Disabled/Enabled each one through the kscreen KCM
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: ngraham, luebking, broulik, graesslin, plasma-devel, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8796
Mesa's glXChooseFBConfig will not return any sRGB capable fbconfig when it
is not explicitly asked for. On some systems, the only ARGB32 visual is
paired with an sRGB capable fbconfig, so application windows using ARGB32
visuals would fail to display.
BUG: 387159
FIXED-IN: 5.11.4
Summary:
This is a tiny refactor so that DrmOutput can have WaylandOutput
dynamically
deleted and recreated at runtime as we disable outptuts.
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: plasma-devel, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8794
Summary:
con->setOutput and crtc->setOutput is called in Output::~Output so this
is doing it twice redundantly.
More importantly Output::~Output calls crtc->blank(), which means we
need a valid CRTC object there.
Test Plan: Compiles
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: bshah, plasma-devel, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8779
Summary:
The AMS code accesses elements in a vector which might not be valid. This
change refactors the code to be more robust, especially the DrmPlane,
which started to crash after adding transformation support.
BUG: 386490
Reviewers: #kwin, #plasma, fvogt, subdiff
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8752
Summary:
This change introduces an OrientationSensor class which wraps a
QOrientationSensor. The OrientationSensor is hold by Screens and gets
enabled if Screens knows about an internal (e.g. LVDS) display which
supports rotation. In addition the OrientationSensor holds an KSni to
enable/disable the automatic rotation support.
The drm platform plugin is adjusted to make use of the OrientationSensor.
The API is defined in a way that this can also be implemented on other
platforms supporting rotation. Most important are hwcomposer and X11
standalone. The latter should be straight forward as rotation is provided
through XRandR. The former needs addition for rotation support first.
Test Plan: Rotated my Yoga 12
Reviewers: #kwin, #plasma, sebas
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D8699
Summary:
The idea behind getting the supported transformations is to tell KScreen
which transformations are actually supported and thus not even allow the
user select a setting which is not supported.
Reviewers: #kwin, #plasma, subdiff
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8645
Summary:
While KWin gained support for changing modes it did not yet forward it
to the Wayland OutputInterface. This change implements this missing todo
by finding the matching mode and marking it as current.
Test Plan: Run kinfocenter to verify the current mode is properly set.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8578
Summary: Mostly so DRM can report if it has AMS or not
Test Plan:
Ran on my DRM setup, printed debug.
Spawned nested compositor, printed debug on that
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: plasma-devel, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8702
Summary:
This change fixes the hotspot calculation by introducing a dedicated
matrix to map the hotspot.
To better test the hotspot a small test application is added. The app
renders a red point at the cursor position and uses a cross for cursor
with the hotspot position being transparent. So if KWin renders the
cursor at the correct position a red point is visible in the center of
the cross. The test app supports several cursor hotspot positions:
* center (default)
* top left
* top right
* bottom right
* bottom left
To switch between the variants press the space key.
Test Plan:
Rotated screen, used test app to verify the hotspot is
correct. Also scaled display, still correct
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8668
Summary:
So far all outputs shared the same dumb buffer for the cursor image.
This doesn't work any more when screen rotation is enabled. For rotated
screens the cursor image per output is different. On some it might be
rotated, on some not.
To solve this problem the dumb buffers are moved from the DrmBackend to
the DrmOutput. The DrmOutput now creates the cursor images itself and
can rotate them if needed. Thus we get nicely transformed cursors.
Test Plan: Rotated screens, moved cursor around, image properly rotated
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8664
Summary:
This is meant to address Bug 372114. The problem here is that the KConfig
object (and its derivatives), that the freeze detection thread needs to
record the freeze, are not thread safe. When it happens that the main
thread is in fact not frozen, it is possible that the two stomp on each
other's KConfig object.
The solution applied here is to use the KSharedConfig::openConfig
function, which is thread safe, on the freeze detection thread. As was
mentioned by Martin Flöser in the discussion, the thread needs to obey
the name of the main config file of KWin, which can change in the future.
As a secondary issue, this patch also turns off KCrash reporting for
aborts due to a freeze being detected. IMO it is not very user friendly
to still show a crash report to the user, even after this bug is fixed,
for the deliberate SIGABRT. Maybe a less intrusive notification could be
used to tell the user why effects are suddenly disabled?
I've been using kwin with this change for several weeks now and it makes
the restarts of kwin due to freezes unobtrusive. However, most (I would
say almost all) of these freezes are actually instances where the system
is being slow after eg. screen resolution is changed.
BUG: 372114
FIXED-IN: 5.11.3
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: ngraham, graesslin, anthonyfieroni, cfeck, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8356
Summary:
This change refactors the way how the cursor position on a screen is
calculated. It is changed to a matrix multiplication with the
adjustments for the rotated screen just being additional steps added to
the matrix.
With this calculation I got correct positions for all variants of
scaled, rotated and differently positioned outputs.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8627
Summary:
When KWin successfully presents a new mode, it stores the current state
as the last working mode. If a new modeset is requested and the atomic
test fails, all is undone and reverted to this last knowing mode.
Currently included are:
* the mode
* global position
* transformation
This is only done on a modeset not when going to DPMS.
Test Plan:
Selected the not working vertical rotation and nothing bad
happened.
Reviewers: #kwin, #plasma, subdiff
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8602
Summary:
This change hooks up the drm plane rotate with the rotation requests
from KScreen. Our requests support more than what KScreen exposes in the
UI, that is all the flipped variants. I do not really understand what
the flip means, so this is not implemented yet.
Furthermore this only implements the visual rotation and not the input
rotation. This means mouse movement and touch input is currently broken
on a rotated screen.
Please note that the hardware I used seems to not support the vertical
rotation. I'm not sure whether my code works. On my system it just
results in atomic commit errors and we need to go back to a previous
working state. This is not yet implemented. I need to test the vertical
rotation on my notebook, which should (in theory) support it.
Reviewers: #kwin, #plasma, subdiff, sebas
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8594
Summary:
A preparation step to support rotation of outputs. The idea is to rotate
using DRM directly and not add it to the compositors. With this change
and a small hack to try it, I was able to rotate the screen.
Reviewers: #kwin, #plasma, subdiff
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8582