Commit graph

84 commits

Author SHA1 Message Date
Xaver Hugl
d18e631d47 backends/drm: hide cursor again
Before 6a99bfd2, the DrmBackend took care of checking this. Now it
needs to be explicitly checked in DrmOutput
2022-01-05 16:39:56 +01:00
Xaver Hugl
81905dbfaa backends/drm: properly handle pending transformations
AbstractWaylandOutput::pixelSize returns the size with already set transformation
applied but the render backends need the pending transformation
2022-01-04 22:22:57 +00:00
Xaver Hugl
b06ec13ead backends/drm: test crtc+connector combinations with hardware rotation
This should enable KWin to use hardware rotation in more situations. As
a fallback all hardware rotation is disabled and the test is done again
2022-01-04 22:22:57 +00:00
Xaver Hugl
dc5cddd33f backends/drm: ensure hardware transforms are properly applied and tested
Testing only the pipeline that this output uses is not enough and can
cause breakage on multi-monitor setups.
2022-01-04 22:22:57 +00:00
Xaver Hugl
2af3f46357 backends/drm: adjust logging verbosity 2022-01-04 22:22:57 +00:00
Vlad Zahorodnii
5f83f2a781 Replace abort() with Q_ASSERT and Q_UNREACHABLE
This change replaces abort() with Q_ASSERT and Q_UNREACHABLE() macros to
make kwin code base consistent. Besides that, Q_UNREACHABLE may
potentially provide the compiler more info that can be used to generate
more efficient machine code.
2022-01-04 10:28:42 +02:00
Méven Car
d81b106c15 Apply the rgbrange read from Kscreen configuration on startup
CCBUG: 442520
2022-01-03 15:40:52 +00:00
Xaver Hugl
93d5127014 backends/drm: improve dmabuf feedback
Instead of only allowing the current format, send the default tranches modified
to only contain formats and modifiers suitable for scanout.
In order to not fail when we can't do direct scanout with a given format
(because that may require a modeset, which we don't allow), keep a blacklist
of attempted formats and modifiers for the current client.
2022-01-03 10:45:44 +00:00
Xaver Hugl
0ba2c35e1a dmabuf feedback: limit modifiers to those supported by egl 2022-01-03 10:45:44 +00:00
Xaver Hugl
5a6f1e42c1 backends/drm: make the placeholder screen as big as the last screen
The fixed size of 1080p makes windows change their size and place. To
prevent that from happening, make the placeholder screen the same size
as the last disconnected screen.
This is not a bullet proof solution, only a fast one. Ideally KWin
should remember the window layout on a given monitor setup and restore
it when reconnected.

BUG: 447419
FIXED-IN: 5.24
2022-01-03 11:17:50 +01:00
Xaver Hugl
5e75d2a095 backends/drm: fix cursor crash 2022-01-01 13:22:20 +00:00
Vlad Zahorodnii
84690a0de6 scenes/opengl: Move copying front buffer to back buffer to X11 specific code
On X11, if buffer age is unsupported, kwin can do some quirks like
copying parts of the front buffer to back buffer to avoid repainting the
whole screen.

Currently, the copying is performed in the opengl scene, which is not
perfect because it makes the scene responsible not only for painting the
scene but also some low level platform specific shenanigans.

This change moves the copying step to the glx and egl backends. It
simplifies the opengl scene, makes it less overloaded and more open to
changes, but it also duplicates code, which is not ideal. However, given
the de-facto deprecated state of the X11 platform, it's sort of acceptable
as the main focus is now on wayland session and the things that are
needed to make it fly as expected.
2021-12-29 15:11:40 +00:00
Xaver Hugl
6a99bfd2f4 make software cursors work per output 2021-12-28 18:42:29 +00:00
Xaver Hugl
f2b29e3555 backends/drm: deep color support
This commit makes 10 bits per color channel the default color depth, which
should reduce banding on outputs that support color formats with more than
8 bits per color channel. In order to support this the commit also removes
the dependency of the EglGbmBackend on a specific format and EglConfig and
instead makes those per-Output properties.
2021-12-25 18:32:58 +00:00
Xaver Hugl
cfeeb817bf backends/drm: query min and max values for properties 2021-12-25 18:32:58 +00:00
Xaver Hugl
3135f56576 backends/drm: don't reset damage with direct scanout 2021-12-21 16:07:36 +00:00
Xaver Hugl
dde7a2efac backends/drm: fix crash with direct scanout
BUG: 447079
2021-12-16 16:44:01 +01:00
l10n daemon script
0db88c3ea6 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-12-15 01:55:28 +00:00
Xaver Hugl
9781f43a48 backends/drm: remove unneeded methods in DrmBackend 2021-12-14 16:31:15 +00:00
Xaver Hugl
5d5bb2422c backends/drm: move definitions into cpp file 2021-12-14 16:31:15 +00:00
Xaver Hugl
ca79f11ede backends/drm: minor refactor of DrmPipeline 2021-12-14 16:31:15 +00:00
Aleix Pol
eaa2f538e3 libinput: Pass QStrings as constref 2021-12-13 18:53:23 +00:00
Aleix Pol
7c6b0d9ef4 libinput: Install org.kde.kwin.InputDevice.xml exposing libinput/device.h
It allows to more comfortably create tooling that implements it.
2021-12-13 18:53:23 +00:00
Aleix Pol
5ff22d7765 libinput: Successfully set the output of a device from the dbus interface 2021-12-13 18:53:23 +00:00
Matt Scheirer
449da861f3 Grammar and syntax changes suggested by @vladz 2021-12-13 18:53:23 +00:00
Matt Scheirer
6287ab16f4 [libinput] Add support for display mapping 2021-12-13 18:53:23 +00:00
Matt Scheirer
e51cefe136 [libinput] Serialize QMatrix4x4 for KConfig 2021-12-13 18:53:23 +00:00
Matt Scheirer
a719ceab4a [libinput] Persist device calibration & orientation 2021-12-13 18:53:23 +00:00
Matt Scheirer
21ef0925ab [libinput] Expose calibration and orientation on devices over dbus 2021-12-13 18:53:23 +00:00
Xaver Hugl
f392a9ba39 backends/drm: add some documentation about the drm api 2021-12-13 16:11:40 +00:00
Xaver Hugl
3fb14035cd backends/drm: only use atomic gamma size with AMS
For some reason the property exists with legacy, too. If you try to set
legacy gamma with atomic gamma size it'll fail
2021-12-13 09:23:57 +00:00
Xaver Hugl
58e5a5c9f7 backends/drm: also log properties with legacy
Can be useful to find bugs
2021-12-13 09:23:57 +00:00
Xaver Hugl
4dec21d8e4 backends/drm: remove unused user data 2021-12-13 08:32:33 +00:00
nerdopolis turfwalker
37c3e0d158 Fix crash on simpledrm 2021-12-13 08:02:58 +00:00
Vlad Zahorodnii
eb080395ef backends/drm: Fix stuck cursors
Currently, if you move the cursor really fast between two outputs, there
may be stuck cursor on the previous output.

We need to query the old cursor visibility status before updating the
cursor position, otherwise the drm backend may not schedule an update to
move the cursor offscreen.
2021-12-10 06:24:21 +00:00
Xaver Hugl
2817e7581f backends/drm: fix legacy cursor 2021-12-09 15:48:58 +00:00
Julius Zint
9537ea6d16 Use SmoothPixmapTransform when drawing cursor
This solves the pixelated look of the cursor under wayland, if the
scaling is set to a fractional value.
2021-12-09 16:04:31 +01:00
Xaver Hugl
b526b35e9d backends/drm: refactor legacy cursor
This commit does away with the special handling of the legacy cursor and
makes it be applied directly in DrmPipeline, using the same state as the
atomic cursor and without dirty flags.
2021-12-09 10:05:16 +01:00
Xaver Hugl
7e2bd5a773 backends/drm: refactor DrmPipeline
Split out more things from commitPipelines, and split out the legacy stuff
into a separate file
2021-12-08 21:39:38 +01:00
Vlad Zahorodnii
358b45a4f2 Remove some no longer relevant KWIN_UNIT_TEST ifdefs 2021-12-08 16:29:55 +00:00
Xaver Hugl
494ef1c930 backends/drm: port cursors to atomic
The cursor being set out-of-band with atomic commits creates problems
because it can create false positive for atomic tests, if the cursor
state gets changed in between an atomic test and its matching commit.

This commit also ports the cursor to a swapchain instead of only one
image. This is not strictly required but may prevent artifacts and
will be needed for future optimisations.
2021-12-08 17:06:02 +01:00
Vlad Zahorodnii
2b628ea412 backends/drm: Mark frame failed if presenting null buffer
If eglSwapBuffers() fails, there won't be a buffer and so we need to
mark the frame as failed. Otherwise, the screen can be frozen.

eglSwapBuffers() can fail if some effect calls makeOpenGLContext()
between RenderBackend::beginFrame() and RenderBackend::endFrame(), which
is the case with the zoom effect. It can set wrong draw surface in
ZoomEffect::recreateTexture()

BUG: 445412
2021-12-03 08:06:37 +00:00
Xaver Hugl
8d08306c48 backends/drm: support dmabuf-feedback
dmabuf-feedback allows the compositor to give the clients better feedback on what
formats and modifiers they should use, and for which device they should allocate.
This way they can reallocate for scanout whenever the compositor tells them to,
which makes direct scanout work for a lot more devices and applications.
2021-11-30 10:46:06 +00:00
Xaver Hugl
f097440eb4 backends/drm: don't cache formats
While it could be useful with tiled displays, the isFormatSupported and
supportedModifier functions can be called before prepareModeset, so where
m_formats is still empty. Additionally they're neither in a hot path nor
performance critical.
2021-11-30 10:29:51 +01:00
Xaver Hugl
1f79f421b4 backends/drm: only enforce modifiers default for surface creation
Whether or not we want to use explicit modifiers for our surfaces doesn't
matter for what format+modifiers drm planes support. This way direct scanout
works by default, without having to explicitly enable modifiers
2021-11-29 18:28:29 +00:00
Aleix Pol
5f16757090 libinput: Make sure we don't crash if we start without an output 2021-11-29 17:51:49 +01:00
Xaver Hugl
15993fa6bb backends/drm: fix KWIN_DRM_NO_AMS env var
It currently makes the session not start at all
2021-11-29 14:53:11 +00:00
Vlad Zahorodnii
4a1d5ea53c backends/drm: Improve PauseDevice/ResumeDevice signal handling
systemd takes care of setting and dropping master permissions when
sending PauseDevice and ResumeDevice signals.

When the ResumeDevice signal is received, the relevant drm device should
already have master permissions set up.

On the other hand, when the active property changes, there's still a
chance that systemd haven't granted drm master permissions to us.
2021-11-25 15:06:49 +00:00
Xaver Hugl
3a5cb1c441 backends/drm: only set pageflipPending when wanted
It shouldn't be set when the pipeline wants to be disabled. Whenever that
happens it will wait forever for the pageflip that doesn't come
2021-11-25 15:44:59 +01:00
Vlad Zahorodnii
9f93358bc1 backends/drm: Notify about failed frames if there are actually pending frames
In case a modeset needs to be performed, the drm backend will test all
pipelines to ensure that new mode won't cause any bandwidth issues on
other outputs, etc.

To do that, it may delay presenting frames. If the new configuration
doesn't work, it needs to notify about failed frames.

However, the relevant code that notifies the RenderLoop about failed
atomic commits doesn't check if there's actually a pending modeset
present.

When switching between VTs, systemd can revoke master permissions from
kwin. To make things even more trickier, kwin can try to present a frame
in that short time span.
2021-11-25 11:15:50 +02:00