Commit graph

992 commits

Author SHA1 Message Date
Xaver Hugl
4890db3f16 Fix hotplugging for VR headsets 2021-02-06 10:54:44 +00:00
Xaver Hugl
e30b1a0f92 Don't allow direct scanout when using software cursor 2021-02-02 22:15:50 +01:00
Xaver Hugl
bda47c9043 Fixes for direct scanout 2021-02-02 16:19:30 +01:00
Xaver Hugl
30464e5c8b Implement direct scanout for the gbm backend 2021-02-02 13:26:43 +00:00
Vlad Zahorodnii
e7dc64028c GIT_SILENT: kdecorations: Port away from Q_ENUMS to Q_ENUM
Q_ENUMS has been deprecated since Qt 5.5.
2021-02-02 09:55:56 +02:00
l10n daemon script
1d8ebfa475 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"
2021-02-02 07:28:08 +01:00
Vlad Zahorodnii
76effae5ca platforms/x11: Disable swap events by default on Intel
Some users reported performances issues after recent compositing
scheduling changes, in particular animations being laggy.

The issue is that sometimes it may take more than a vblank interval for
a buffer swap to complete. Previously, compositing was driven by a
timer and it wasn't synchronized to vblanks. If some frame is running
late, the compositor will just start painting a new frame, i.e. the
screen will be rendered triple buffered.

This change disables the swap events code path on Intel to restore the
previous behavior. Unfortunately, that may add an extra frame of latency.

The swap events code path can be enabled explicitly on Intel by setting
the KWIN_USE_INTEL_SWAP_EVENT environment variable to 1.
2021-02-01 18:51:59 +00:00
Vlad Zahorodnii
6aea213c84 platforms/x11: Build own vsync monitors only when GLX backend is built
The SGIVideoSyncVsyncMonitor and OMLSyncControlVsyncMonitor use GLX,
thus they should be compiled only if the GLX backend is built.
2021-02-01 18:49:16 +00:00
Vlad Zahorodnii
ffc013292f platforms/x11: Don't monitor vblanks on the root window
This makes scrolling in Firefox, which also monitors vblanks on the root
window, laggy.
2021-02-01 18:49:16 +00:00
Vlad Zahorodnii
b338c4cb0e platforms/x11: Move GLXFBConfig selection code in a separate file
This allows reusing the GLXFBConfig selection code.
2021-02-01 18:49:16 +00:00
Xaver Hugl
f8d9b3bc6c Actually use a linear buffer format for multi-GPU
BUG: 431968
2021-02-01 11:28:28 +00:00
Xaver Hugl
2c6d19fec1 Only release shared buffers right before the next frame
BUG: 425586
2021-02-01 11:26:42 +00:00
Nicolas Fella
99947c8bd8 Use versionless Qt cmake target
This makes it easier to build against both Qt5 and Qt6

GIT_SILENT
2021-01-30 17:18:21 +01:00
Laurent Montel
88b6076b2f GIT_SILENT: dont use deprecated cmake variable 2021-01-29 11:34:52 +01:00
Aleix Pol
92c00d1dc3 screencasting: generate the composed textures with the proper size
Don't neglect the scale of the buffer for windows that we are rendering
on the spot.
Otherwise we will be offering a smaller size to what we are generally
using. More importantly, the ScreencastManager expects the buffers
scaled. This causes glitches when the stream starts otherwise as the
first frame triggers a resize.

CCBUG: 428594
2021-01-28 18:24:40 +00:00
Aleix Pol
38e656ba7e screencast: Properly report the initial size of windowed streams
Otherwise we'll be triggering a resize request first thing and never
hear back from the stream until a new frame is requested (which is often
rare when looking at a thumbnail).

BUG: 428594
2021-01-28 18:24:40 +00:00
Vlad Zahorodnii
a78754b695 Fix recorded render time when glXSwapBuffers() blocks
If glXSwapBuffers() blocks, the render loop will also record how long
kwin was blocked. Obviously, we don't want that.
2021-01-28 12:55:10 +00:00
Xaver Hugl
90007b906b Change qpainter connect for initOutput to outputEnabled 2021-01-27 19:17:59 +00:00
Vlad Zahorodnii
8681a69f47 Remove redundant usesOverlayWindow() method
Whether an overlay window is used for compositing can be determined by
checking the return value of overlayWindow().
2021-01-27 13:57:56 +00:00
Méven Car
b7539d06b9 Add TestOutputManagement::testOutputDeviceRemoved
Test the mock VirtualBackend
2021-01-27 08:18:57 +00:00
Xaver Hugl
9f4a1433e4 Also initialize properties when not using AMS
BUG: 431981
2021-01-26 21:23:52 +01:00
Vlad Zahorodnii
44176c6a8c Lower default severity of logging categories
Warning messages are not the kind of messages that should be ignored,
they indicate that something is off or wrong.

Also, this makes triaging bugs easier as we no longer have to ask people
to run kwin with the QT_LOGGING_RULES environment variable set.
2021-01-25 14:03:14 +02:00
Vlad Zahorodnii
ed5dfa1691 Don't use "no border" property to determine if Deleted was decorated
With xdg-toplevel windows, the value of the "no border" property can be
sometimes out of sync with the fact whether the window is decorated. This
may result in Deleted windows being frameless.

In order to address that issue, we need to store the current value of
AbstractClient::isDecorated() during the construction of Deleted.
2021-01-24 23:52:27 +00:00
Méven Car
8bb5b27448 VirtualBackend: make sure the initial dummy VirtualOutput is enabled
Fix tests regressions introduced in 39a1e11958b1ad47d9a516c1cb4bcea852e92a00
2021-01-18 16:57:07 +00:00
l10n daemon script
59b1dee55a 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"
2021-01-17 06:42:32 +01:00
Vlad Zahorodnii
2d1994e066 aurorae: Make direct connection to maximizedChanged signal
If the maximizedChanged connection is queued, several configure events
will be sent. If the client acks the first configure event and later on
acks the second one, the maximize animation will be cancelled due to
"unexpected" geometry change.

Based on the code, there is no clear reason why the connection is queued
in the first place.

CCBUG: 431415
2021-01-15 13:26:49 +00:00
Vlad Zahorodnii
242439b8af Minor whitespace fixes 2021-01-14 11:40:22 +02:00
Vlad Zahorodnii
e5abd704de Remove stray file and unused variable
It seems like they were introduced by accident while resolving merge
conflicts.
2021-01-14 11:39:33 +02:00
Méven Car
4f744d1bb6 Add TestOutputManagement::testOutputDeviceDisabled test
Allow VirtualBackend to supports Output changes.
2021-01-14 08:21:59 +00:00
l10n daemon script
866dfb4e89 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"
2021-01-14 07:04:00 +01:00
l10n daemon script
e938a569bc 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"
2021-01-12 06:49:28 +01:00
Vlad Zahorodnii
6d20d19fec platforms/x11: Always set swap interval to 1
With the new compositing scheduling, we want the screen to be redrawn as
close as possible to the next vblank. Furthermore, compositing is no
longer driven by a timer. This change removes the NoSwapEncourage swap
strategy as it doesn't make sense now, in addition to that it just does
not work on Wayland.
2021-01-07 13:10:59 +00:00
Vlad Zahorodnii
2e3a6b7253 cmake: Minor cleanups in X11 platform CMakeLists.txt 2021-01-07 12:13:14 +02:00
Vlad Zahorodnii
5302094f30 cmake: Link against imported Xinput target 2021-01-07 09:50:24 +00:00
Vlad Zahorodnii
b67f743795 cmake: Drop libkwin's unused Xlib dependencies 2021-01-07 09:50:24 +00:00
Vlad Zahorodnii
c5d97ba04a cmake: Clean up CMakeLists.txt for QPA plugin 2021-01-07 09:49:54 +00:00
Vlad Zahorodnii
3dc00de812 platformsupport: Set PUBLIC include directories
This makes using platform support libs easier.
2021-01-07 09:49:26 +00:00
Vlad Zahorodnii
605988d2a1 platformsupport: Rename some headers to make them less ambiguous 2021-01-07 09:49:26 +00:00
Vlad Zahorodnii
ee3515680a platforms/drm: Make frame scheduling robust
If there is a pending frame, the RenderLoop will delay all schedule
repaint requests to the next vblank event. This means that the render
loop needs to be notified when a frame has been presented or failed.

At the moment, the RenderLoop is notified only about successfully
presented frames. If some frame fails, no repaints will be scheduled
on that output.

In order to make frame scheduling robust, the RenderLoop has to be
notified if a frame has failed.
2021-01-06 16:59:30 +00:00
Vlad Zahorodnii
b8a70e62d5 Introduce RenderLoop
At the moment, our frame scheduling infrastructure is still heavily
based on Xinerama-style rendering. Specifically, we assume that painting
is driven by a single timer, etc.

This change introduces a new type - RenderLoop. Its main purpose is to
drive compositing on a specific output, or in case of X11, on the
overlay window.

With RenderLoop, compositing is synchronized to vblank events. It
exposes the last and the next estimated presentation timestamp. The
expected presentation timestamp can be used by effects to ensure that
animations are synchronized with the upcoming vblank event.

On Wayland, every outputs has its own render loop. On X11, per screen
rendering is not possible, therefore the platform exposes the render
loop for the overlay window. Ideally, the Scene has to expose the
RenderLoop, but as the first step towards better compositing scheduling
it's good as is for the time being.

The RenderLoop tries to minimize the latency by delaying compositing as
close as possible to the next vblank event. One tricky thing about it is
that if compositing is too close to the next vblank event, animations
may become a little bit choppy. However, increasing the latency reduces
the choppiness.

Given that, there is no any "silver bullet" solution for the choppiness
issue, a new option has been added in the Compositing KCM to specify the
amount of latency. By default, it's "Medium," but if a user is not
satisfied with the upstream default, they can tweak it.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
fc60e8f1e3 platforms/x11: Present buffers even if nothing has been changed
This is needed to ensure that the compositor always receives swap events
even if nothing has been changed on the screen.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
bc9df67c79 platforms/wayland: Present buffers even if nothing has been changed
Present buffers event if nothing has been changed on the screen because
we want to receive the frame callback.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
58cb4de1b8 platforms/drm: Present buffers even if nothing has been changed
We want to get notified when the next page flip occurs. The problem is
that kwin will avoid queueing a page flip if nothing has been changed on
the screen. From performance point of view, that is expected behavior,
but for frame scheduling and some wayland clients that create frame
callbacks to get notified about the next vblank, it's not suitable.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
ef6fa25d90 platforms/x11: Split out the EGL for X11 backend
EGL for X and EGL for Wayland backends are quite different. The main
motivation behind this change is to prepare the EGL backends for
monitoring vblank events. Things work quite differently depending on
if the EGL backend renders onto a toplevel window or overlay window.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
4f3adbb520 Drop SGI_video_sync based method for vsync
With the new compositing timing, we want to start compositing some time
later after a vsync event. This doesn't go along with the video sync
based method to synchronize buffer swaps with vblank.

Since practically all drivers nowadays provide support for the swap
control extensions (GLX_EXT_swap_control, GLX_SGI_swap_control, or
GLX_MESA_swap_control), it's safe to rely on them for the purpose of
synchronizing buffer swaps to vblank.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
7a3fa88f02 Drop flag to indicate if swap buffers is blocking
We want the new compositing timing algorithm to be invariant regarding
whether glXSwapBuffers() or eglSwapBuffers() block.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
2152598cc4 Drop the swap profiler
In hindsight, we want to swap buffers after finishing a compositing
cycle, therefore there is no need for the swap profiler.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
0ceff5fd24 Swap buffers after finishing a compositing cycle
The compositing timing algorithm assumes that glXSwapBuffers() and
eglSwapBuffers() block. While this was true long time ago with NVIDIA
drivers, nowadays, it's not the case. The NVIDIA driver queues
several buffers in advance and if the application runs out of them,
it will block. With Mesa driver, swapping buffer was never blocking.

This change makes the render backends swap buffers right after ending
a compositing cycle. This may potentially block, but it shouldn't be
an issue with modern drivers. In case it gets proven, we can move
glXSwapBuffers() and eglSwapBuffers() in a separate thread.

Note that this change breaks the compositing timing algorithm, but
it's already sort of broken with Mesa drivers.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
7e5c16989e Drop hwcomposer backend
Plasma Mobile announced that they plan to drop support for Halium
devices, see the announcement blog post [1] for the reasons that led to
such a decision.

But just to summarize, here are some of the key points from the post:

 * Some of our team members no longer have access to reference LG Nexus
   5X device anymore
 * After KDE Neon switched to using Ubuntu 20.04 we no longer are
   updating the rootfs for halium devices
 * After several important architecture changes in upstream KWin, the
   hwcomposer backend might be broken and we have no way of verifying it

If the community members are interested in reviving the hwcomposer
backend,

  * it pretty much needs rewrite/re-thinking given differences of hwc1
    and hwc2 API for hwcomposer part of it, see also [2]
  * It also needs removal of Android 5 based libhardware API as we don't
    think code can be kept sane with 3 different levels of ifdefs
  * This backend needs better way of fixing difference between
    CAF/non-CAF devices then just recompiling with different headers,
    maybe env vars?
  * This backend does not support various things like transformation/
    rotation etc, and is not exactly feature complete as the DRM backend

[1] https://www.plasma-mobile.org/2020/12/14/plasma-mobile-technical-debt.html
[2] 83f563c339
2021-01-05 17:38:36 +00:00
Kai Uwe Broulik
5edfccac12 KRunner integration: Send window pixmap along
If there is no icon name available which is very often
the case on X11.

BUG: 430054
2020-12-29 21:22:36 +00:00