Commit graph

68 commits

Author SHA1 Message Date
Xaver Hugl
802d855785 backends/drm: support link-status
Userspace is expected to do a modeset and set link-status to good again,
if link-status gets bad. This is needed to prevent some black screen situations.

BUG: 448177
2022-01-14 10:31:32 +00:00
Xaver Hugl
2564886f7f backends/drm: fix legacy crash
CCBUG: 447680
2022-01-12 21:23:37 +00:00
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
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
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
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
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
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
Xaver Hugl
c4dcbb40d6 properly fix bsd build 2021-11-22 13:15:01 +00:00
Xaver Hugl
912b7d0b02 fix freebsd build 2021-11-22 13:36:57 +01:00
Xaver Hugl
c4d50e984f backends/drm: drop some unused stuff in DrmGpu 2021-11-22 11:30:31 +00:00
Xaver Hugl
95f64a7ac7 backends/drm: drop DrmBackend as a friend of DrmOutput
It's unused
2021-11-22 11:30:31 +00:00
Xaver Hugl
cd8a7ac0b0 backends/drm: don't make DrmGpu a friend of DrmOutput
Making the constructor and updateModes private isn't necessary
2021-11-22 11:30:31 +00:00
Xaver Hugl
6cea76bfaf backends/drm: inline DrmPipeline::updateProperties
It's only used in one place
2021-11-22 11:30:31 +00:00
Xaver Hugl
3e24bc008a backends/drm: force soft cursor if image creation fails
If the soft cursor is only set but not forced then KWin will try to update
cursors again, making it go into code paths that will crash.

BUG: 445507
2021-11-22 08:43:29 +00:00
Xaver Hugl
50c39e202b backends/drm: properly check for vrr property with legacy
BUG: 445907
2021-11-22 09:00:50 +01:00
Xaver Hugl
8528bbf800 backends/drm: ignore placholder outputs for the output config
They can only introduce intermediary state when a real output gets enabled
and are not relevant to the actual output config
2021-11-16 17:08:08 +01:00
Xaver Hugl
b6b0af727d backends/drm: don't take crtcs from dpms disabled outputs
Fixes a crash I have with dpms + suspend, which was caused by the udev
event for updating outputs being called before the output got enabled
again. When DrmGpu::updateOutputs got called it removed the crtc from
the inactive output and then disabled the output afterwards. Instead,
only remove crtcs if an output is really disabled.
This also allows to generalize the logic for lease outputs, and could
in the future allow for faster dpms on/off switching.
2021-11-16 17:05:31 +01:00