Commit Graph

250 Commits (99804e0233cbb1054b1b1f5148dc5c7a6833a709)

Author SHA1 Message Date
David Edmundson 7aedacd89e Fractional scaling in DRM kscreen integration
Summary:
The kwin code was written to treat scale as non integers, we just need
to switch to the relevant float version of methods.

Test Plan:
Used kscreen-doctor to change this
Konsole resized as appropriate
Plasmashell was all broken, but that's expected until QScreen::size is based on the
xdg-output virtual size

Reviewers: #kwin, mart, graesslin, romangg

Reviewed By: #kwin, mart, graesslin

Subscribers: romangg, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13616
2018-08-06 10:50:47 +01:00
l10n daemon script 3b3aa82f58 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-07-23 05:24:40 +02:00
David Edmundson 9f2f6d9657 Don't remove outputs during page flip
Summary:
To do so leaves a dangling pointer on our pageFlipHandler

BUG: 396272

Test Plan: Wobbled a window whilst plugging a monitor in and out

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14210
2018-07-18 16:05:59 +01:00
David Edmundson 2cc42ecc12 DRM cursor scaling
Summary:
We pass the buffer scale of the cursor through QImage::devicePixelRatio.

When copying the cursor with QPainter use Qt's in-built functionality to
handle resizing the cursor pixmap as necessary to match the screen.

As we're now resizing the cursor, the hotspot needs translating from
logical to device co-ordinates.

Test Plan: Used with associated patches

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13605
2018-06-23 18:15:41 +01:00
David Edmundson 9ff1f77e8e Support cursor scaling in X windowed backend
Test Plan:
Ran kwin_wayland --windowed  --scale2

Hovered over deco. Got massive and detailed cursor
Hovered over a wayland client (Qt 5.11 not dev)
Got a massive, but slightly blocky cursor

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13642
2018-06-23 18:15:41 +01:00
David Edmundson 5b4eb80c8f Set specific edge cursor shape when resizing
Summary:
Instead of seeing the cursor <--> on the left edge you now see an icon
that looks like |<-  .

This brings kwin decorations in line with GTK CSD icons.

In theory this is also useful to tell which window will resize in the
case of side-by-side windows (regardless of whether borders are on or
not). In practice with the adwaita icon theme I tested with it's not
very intuitive to realise which is which till you learn the icon.

Change is more involved than it should be as Qt::CursorShape doesn't
have these entries, and I don't want to shadow that enum internally or
have
to change kwin effect code.

Specifics depend on cursor icon theme if they are not present it will
fallback to the <--> icon. (Breeze does not have them currently)

Test Plan:
Resized some windows (on X and on Wayland)
Correct icon appeared on Adwaita
Existing icon appeared on Breeze

Reviewers: #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13396
2018-06-11 10:05:07 +01:00
Martin Flöser 32a715b0c9 Merge branch 'Plasma/5.13' 2018-05-20 15:43:46 +02:00
Martin Flöser 9a9c34f352 Merge branch 'Plasma/5.12' into Plasma/5.13 2018-05-20 15:41:48 +02:00
Martin Flöser 69afe4d266 Update seat's timestamp after waking up screen through double tap
Summary:
The drm platform has a special handling for touch events while the
screen is in dpms. All touch events are filtered out, but a double
tap wakes up the screen.

Due to the filtering out of the events the idle timers were not reset.
So if you only double tapped, the screen turned on, but not off again.

This change updates the timestamp after double tap, so that the idle
timers are restarted. All other events are still filtered out, to not
have "fake" events (e.g. smart phone in pocket) wake up the device.

BUG: 392754
FIXED-IN: 5.12.6

Test Plan: only compile tested

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12668
2018-05-20 15:38:31 +02:00
Martin Flöser f28d44e5b2 Use XdgShell Unstable V6 in nested wayland platform
Summary:
Changing the creation of the nested window from unstable v5 to v6 in
order to be supported on more compositors and to use KWin's better
supported platform.

Targeting 5.12 as this will help to remove support for unstable v5
from KWayland.

Test Plan: Run a nested KWin/Wayland on KWin/Wayland, everything looked fine

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11806
2018-05-20 15:37:19 +02:00
David Edmundson 1403fcf316 Add XDG Output support
Test Plan:
Very minimal expansion of unit tests which uses WaylandScreens
Wrote mini app to debug actual output of xdg-output for testing the DRM code

Main relevant user of this is xwayland > 1.20 which I don't have, so that
part remains untested

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: romangg, graesslin, bshah, kwin

Tags: #kwin

Maniphest Tasks: T8501

Differential Revision: https://phabricator.kde.org/D12243
2018-05-18 14:16:13 +01:00
Nerdopolis Turfwalker b2ed73cdb0 fb_backend_qpainter_backend: Use logind to determine if the session is active.
Summary: TTYs are only available for seat0, so when starting a framebuffer kwin on seat1, it never draws, because drawing is always suspended, because it is being treated as not active

Test Plan: The framebuffer backend draws on seat1, and /dev/fb1 and when I switch back to my Weston greeter, (when it's also using the frame buffer,) it doesn't try to draw on top of it.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: davidedmundson, rkflx, graesslin, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9574
2018-04-24 14:18:45 +02:00
Rohan Garg 757ed91a5d Handle errors with drmModeSetCursor instead of silently failing
Summary:
Make sure we switch to a software cursor when drmModeSetCursor
fails.

Reviewers: #kwin, graesslin

Subscribers: davidedmundson, bshah, graesslin, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12447
2018-04-23 10:39:24 +02:00
Nerdopolis Turfwalker 8321453fde fb_backend: use new udev function to detect framebuffer devices, if one is not set
Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: rkflx, graesslin, anthonyfieroni, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9556
2018-04-22 17:52:15 +02:00
Nerdopolis Turfwalker 3c745bb571 fb_backend: fix warning
Summary: The warning that the format is unknown was being logged unconditionally

Reviewers: #kwin, bshah

Reviewed By: #kwin, bshah

Subscribers: rkflx, graesslin, cfeck, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9567
2018-04-22 17:49:23 +02:00
l10n daemon script 67acb21ab8 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-04-22 07:33:45 +02:00
l10n daemon script e68356831b SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2018-04-22 05:43:11 +02:00
Vlad Zagorodniy c44788889c [platforms/virtual] Make VirtualOutput non-copyable
Summary:
Qt objects are treated as identities so remove the copy constructor and
an assignment operator. See, http://doc.qt.io/qt-5/object.html#identity-vs-value

IIRC some Qt objects(like QImage) have copy constructor for implicit data sharing,
but VirtualOutput doesn't have anything to share.

Also, it [this patch] fixes a compiler warning:

```
/home/vlad/KDE/src/kde/workspace/kwin/plugins/platforms/virtual/virtual_output.cpp: In copy constructor ‘KWin::VirtualOutput::VirtualOutput(const KWin::VirtualOutput&)’:
/home/vlad/KDE/src/kde/workspace/kwin/plugins/platforms/virtual/virtual_output.cpp:30:1: warning: base class ‘class QObject’ should be explicitly initialized in the copy constructor [-Wextra]
 VirtualOutput::VirtualOutput(const VirtualOutput &o)
 ^~~~~~~~~~~~~
```

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: michaelh, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12214
2018-04-16 02:48:48 +03:00
Alexey Min 0ccecbc427 drm backend: choose correct EGL config with mesa-18
Do not blindly select first EGL config from returned list, but choose the one that matches GBM surfaces, that will be created later.
GBM surfaces are created with GBM_FORMAT_XRGB8888 format, so choose the config that matches it.
With wrong format EglGbmBackend::resetOutput() will later fail with error EGL_BAD_MATCH.

Test Plan: Compile, run startplasmacompositor. Verify that OpenGL compositing is used, either by kwin debug console, or by kwin support information.

Reviewers: graesslin, davidedmundson, #kwin, #plasma_on_wayland, bshah

Reviewed By: davidedmundson

Subscribers: zzag, kwin, #kwin

Tags: #kwin, #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D11758
2018-04-06 00:17:08 +03:00
Alexey Min d318cb3bd4 drm backend: choose correct EGL config with mesa-18
Summary:
Do not blindly select first EGL config from returned list, but choose the one that matches GBM surfaces, that will be created later.
GBM surfaces are created with GBM_FORMAT_XRGB8888 format, so choose the config that matches it.
With wrong format EglGbmBackend::resetOutput() will later fail with error EGL_BAD_MATCH.

Test Plan: Compile, run startplasmacompositor. Verify that OpenGL compositing is used, either by kwin debug console, or by kwin support information.

Reviewers: graesslin, davidedmundson, #kwin, #plasma_on_wayland, bshah

Reviewed By: davidedmundson

Subscribers: zzag, kwin, #kwin

Tags: #kwin, #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D11758
2018-04-05 01:29:17 +03:00
Bhushan Shah 5c78fbfdcc Include errno.h 2018-03-26 12:35:15 +05:30
Oleg Chernovskiy 4d46edd7ba
GBM remote access support for KWin
Summary:
Implements a KWayland protocol to pass GBM fd from KWin to KRfb and
addictions to relevant projects from both sides.

Note that this patch does not affect default behaviour of mentioned projects. It can be used
only with KWIN_REMOTE=1 in env from KWin side and with preferredFrameBufferPlugin=gbm in krfbrc from
KRfb side. In all other aspects app behaviour remains unchanged.

Test Plan: Launched KWin in Wayland mode, launched KRfb in it, launched KRDC on a laptop, connected in read-only mode, observed a correctly retrieved desktop with Krfb window

Reviewers: graesslin, davidedmundson, romangg, #kwin

Reviewed By: davidedmundson, romangg, #kwin

Subscribers: kossebau, jgrulich, romangg, ngraham, alexeymin, aacid, kwin, #kwin, davidedmundson, plasma-devel

Tags: #plasma_on_wayland, #kwin

Maniphest Tasks: T5653, T7785

Differential Revision: https://phabricator.kde.org/D1230
2018-03-25 20:18:47 +03:00
Roman Gilg 1136386d9f [platforms/virtual] Store virtual outputs per reference
Summary:
Since VirtualOutput is a QObject, store it per reference and not per value.

Also fix some compilation warnings.

Test Plan: Before and after 92% tests passed.

Reviewers: #kwin, davidedmundson

Reviewed By: davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11581
2018-03-22 16:03:16 +01:00
Roman Gilg 8136c2722b [platforms/virtual] Add virtual output class
Summary:
This matches the DRM backend more closely and allows mid-test removal and
addition of virtual outputs with different properties in the future.

Test Plan: Before and after 93% tests passed.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11351
2018-03-19 22:12:22 +01:00
Martin Flöser e71460b6fc Merge branch 'Plasma/5.12' 2018-03-05 19:32:48 +01:00
Fabian Vogt b1bffa4458 Fix typo in config group name
Summary: Quickly fix it before anyone relies on this typo.

Test Plan: None. Yes, really untested.

Reviewers: #plasma, graesslin, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: kwin, plasma-devel, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11047
2018-03-05 13:03:20 +01:00
Marco Martin 8a2b9a014f check for EGL_KHR_platform_gbm extension as well
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
2018-02-15 19:33:06 +01:00
Martin Flöser 477d79b16a Merge branch 'Plasma/5.12' 2018-02-05 21:22:05 +01:00
Martin Flöser ea5e701164 [x11] Fix interactive point selection
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
2018-02-05 21:21:27 +01:00
Martin Flöser bbf00fdd98 Require libinput and udev
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
2018-02-04 15:00:42 +01:00
Martin Flöser 68698b4201 [libinput] Find screen for touch screen devices and calibrate accordingly
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
2017-12-23 10:18:55 +01:00
l10n daemon script 43f575b415 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-12-13 07:01:42 +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
Martin Flöser d4ba05a22f [autotests] Add tests for DRM platform plugin
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
2017-11-21 19:27:33 +01:00
David Edmundson 01c1870e9d Support dynamic output enabling/disabling from KScreen
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
2017-11-21 12:04:30 +00:00
Martin Flöser 45ac8eed34 Merge branch 'Plasma/5.11' 2017-11-20 18:13:35 +01:00
Pierre Willenbrock 9300aa82be Allow glXChooseFBConfig to return sRGB capable fbconfig
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
2017-11-20 18:12:55 +01:00
David Edmundson e96f2bff11 Split init'ing the wayland output from init
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
2017-11-15 16:09:03 +00:00
David Edmundson 6325749f21 Avoid hypothetical crash if output->init fails
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
2017-11-15 16:09:03 +00:00
l10n daemon script 57ea28a216 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-11-14 05:58:20 +01:00
l10n daemon script 049b34c050 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-11-14 04:38:05 +01:00
Martin Flöser c601e875cf [platforms/drm] At safety checks for the properties
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
2017-11-13 21:19:31 +01:00
Martin Flöser 9df1744830 Support automatic screen rotation based on orientation sensor
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
2017-11-08 17:44:38 +01:00
Martin Flöser 99b6f6150d [platforms/drm] Determine the supported transformation on a plane
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
2017-11-08 17:44:21 +01:00
Martin Flöser 59f7ed9c78 [platforms/drm] Forward the mode changes to the OutputInterface
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
2017-11-08 17:32:27 +01:00
David Edmundson 92e5db1ffe Debug output for platforms
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
2017-11-07 19:12:51 +00:00
Martin Flöser 4bfeeb3084 [platforms/drm] Fix cursor hotspot for inverted landscape rotation
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
2017-11-06 16:48:44 +01:00
Martin Flöser c9c26019a1 [platforms/drm] Move cursor dumb buffers to Output
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
2017-11-06 16:48:02 +01:00
Martin Flöser a21b74c05a Merge branch 'Plasma/5.11' 2017-11-05 10:46:53 +01:00
Martin Flöser a7117e4304 Don't use the global KConfig object on the OpenGL freeze detection thread
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
2017-11-05 10:25:24 +01:00