Commit graph

23951 commits

Author SHA1 Message Date
Asahi Lina
a508149882 dmabuf: Create buffers without the SCANOUT flag
gbm_bo_create_with_modifiers implies the GBM_BO_USE_SCANOUT flag, which
disables complex (tiled or compressed) formats that cannot be used for
scanout. This reduces performance. We don't need to scan out buffers
created for sceencasting/etc., so this is suboptimal.

By switching to gbm_bo_create_with_modifiers2, we can explicitly pass
the flags and avoid falling back to lower performance formats. Also add
a config check and fall back to the old version, to retain compatibility
with older mesa versions.
2022-12-21 12:34:24 +00:00
Asahi Lina
f5a80f0d3c screencast: Don't skip the last valid modifier
Since modifiers are listed in preference order, the last one is usually
the most general fallback. If we drop it, we risk winding up with no
usable modifiers.

On Apple GPUs with the Asahi driver, the received modifiers are usually
compressed, twiddled, and linear. Dropping linear means we only request
complex formats. But then gbm_bo_create_with_modifiers always requests
a scanout-capable BO which cannot support complex formats, and we wind
up with nothing. This breaks screencasting on these platforms.
2022-12-21 12:34:24 +00:00
Vlad Zahorodnii
f37acaff54 scene: Split base Scene class from WorkspaceScene class
The main motivation behind this change is to share rendering code
between windows and the cursor, specifically the Item class which
requires a Scene.

Note that Scene subclasses are responsible for issuing
ItemRenderer::renderItem() calls. The main reason for that is the
current architecture of the effects system, specifically we need to call
some effects hooks before and after painting a window.
2022-12-21 12:20:23 +02:00
Vlad Zahorodnii
6c71bfd800 scene: Rename Scene to WorkspaceScene
Currently, the Scene class is used to represent the contents of the
Workspace so rename it to match its usage.
2022-12-21 11:49:07 +02:00
Vlad Zahorodnii
9c0056c96d Make opengl cursor delegate push fbo
This case was overlooked in 8071ade9a8.
2022-12-21 09:16:50 +00:00
Vlad Zahorodnii
ccf5623f34 backends/wayland: Flush rendering commands in endFrame()
eglSwapBuffers() used to flush rendering commands but now that we render
to dmabufs, we need somehow to flush the rendering commands to the dmabuf.

It fixes some of the weird rendering issues that I see sometimes.
2022-12-21 09:16:50 +00:00
l10n daemon script
370808b9d2 GIT_SILENT Sync po/docbooks with svn 2022-12-21 02:12:30 +00:00
l10n daemon script
d11181090c 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"
2022-12-21 01:55:00 +00:00
Xaver Hugl
f90ec209d4 core/renderlayerdelegate: remove QObject parent
Managing an object with both std::unique_ptr and a QObject parent at the
same time is unnecessary and potentially dangerous
2022-12-20 23:38:46 +01:00
Vlad Zahorodnii
5553d0e0f4 Introduce SurfaceCursorSource
The contents of the cursor can be either a normal image or a wl_surface.
At the moment, we get an image from the wl_surface. But it's going to be
changed so we use SurfaceItem to render wl_surface cursors.

SurfaceCursorSource provides the way to get the wl_surface handle from
the cursor. In order to provide backwards compatibility, it also provides
a QImage.
2022-12-20 15:17:59 +02:00
Vlad Zahorodnii
877406ba50 wayland: Emit Cursor::changed signal when cursor surface is committed
The damaged signal is wired to the KWaylandServer::Cursor::changed
signal to indicate when the cursor image changes, makes sense.

But it can create issues if you repaint cursor SurfaceItem when the
SurfaceInterface::damaged signal is emitted. There might be other
signals that we need to wait for to invalidate SurfaceItem's state.

The SurfaceInterface::committed is a better signal. When it's emitted,
the surface commit has been completed. Technically, it's different from
the damaged signal, but in practice they are equivalent. GTK and Qt
always damage the cursor surface.
2022-12-20 09:06:19 +00:00
l10n daemon script
a9174ad9a0 GIT_SILENT Sync po/docbooks with svn 2022-12-20 02:11:01 +00:00
l10n daemon script
6ab6f188cd 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"
2022-12-20 01:50:45 +00:00
Vlad Zahorodnii
4e2e9ab78a wayland: Fix updating pixel data from translucent client buffers when using qpainter backend
We must set QPainter::CompositionMode_Source to overwrite the old
contents.
2022-12-19 18:15:00 +00:00
Vlad Zahorodnii
977016b743 scene: Change clear color in ItemRendererQPainter
It makes the behavior of the ItemRendererQPainter compatible with the
behavior of the ItemRendererOpenGL. It is needed to ensure that the
cursor layer is properly cleared too.
2022-12-19 17:02:20 +02:00
Vlad Zahorodnii
09e0fa5eb8 backends/wayland: Request wl_shm_buffers with RGB32 format 2022-12-19 16:40:39 +02:00
Vlad Zahorodnii
fc36affdee backends/wayland: Specify correct format for remapped primary layer buffers
We don't need the alpha channel and WaylandQPainterBufferSlot specifies
RGB32 format in its constructor.
2022-12-19 14:50:40 +02:00
Vlad Zahorodnii
30d856b9cb scene: Pass Scene to Item constructor
This is needed to establish explicit connection between an item and the
scene it belongs to. For now, the scene must be known at the item
construction time. Perhaps it can be improved in the future by items
inheriting their scene from the parent item, but the scene would need to
be refactored more so there's a root item or something like that.
2022-12-19 11:35:26 +00:00
l10n daemon script
38e0464e1f GIT_SILENT Sync po/docbooks with svn 2022-12-19 02:14:28 +00:00
l10n daemon script
0509dec92f 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"
2022-12-19 01:54:39 +00:00
Vlad Zahorodnii
2819a3cb4f scene: Decouple Item from Workspace and Output
Currently, Item schedules repaints taking output geometry into account,
but that's going to work poorly for cases other than workspace scene.

Moving from Output to SceneDelegate also allows us to unify some X11 and
Wayland specific code paths in Item.

Furthermore, it ensures that effects->paintScreen() won't remove pending
repaints for the output.
2022-12-18 20:25:40 +00:00
Xaver Hugl
b95c93517b backends/drm: fix VRR detection
The pending value always retains the value initially read and is not updated
when the driver changes the property value.

BUG: 463172
FIXED-IN: 5.26.5
2022-12-18 18:29:32 +01:00
l10n daemon script
2668904ae1 GIT_SILENT Sync po/docbooks with svn 2022-12-18 02:44:02 +00:00
l10n daemon script
3af5bec4ba 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"
2022-12-18 02:12:19 +00:00
Vlad Zahorodnii
8071ade9a8 scene: Make ItemRenderer responsible for pushing fbo
It makes more sense for an output layer to return the render target fbo.
The user of the render target will then take appropriate steps to bind
the fbo. It reduces the amount of boilerplate code in output layers too.
2022-12-18 00:44:51 +00:00
Nicolas Fella
a0e3a6e54b Port away from deprecated KService::property overload 2022-12-18 01:19:07 +01:00
Vlad Zahorodnii
3068f8bee5 ci: Sort dependencies in alphabetical order 2022-12-17 22:29:22 +00:00
Vlad Zahorodnii
c7518db4e3 ci: Update .kde-ci.yml
kcompletion and ktextwidgets are unused. plasma-wayland-protocols is not
marked explicitly.
2022-12-17 22:29:22 +00:00
Vlad Zahorodnii
f2857d556f scene: Drop SceneOpenGL::openGLPlatformInterfaceExtensions()
It doesn't belong in the Scene, whose sole responsibility is to draw
windows.
2022-12-18 00:05:48 +02:00
Vlad Zahorodnii
23bef7601e core: Move surface texture factory functions to RenderBackend
The goal is to create surface items for things that are not in the
workspace scene. RenderBackend perhaps is not a great place for these
factory functions. On the other hand, this change merely rewires code
from Scene to RenderBackend. I think that in distant future we could
make surface items pick surface texture type on their own, for what it's
worth that's what we would do in QtQuick.
2022-12-17 21:35:40 +00:00
Vlad Zahorodnii
f94b8bfa86 kcms: Simplify directory naming
Remove "kwin", it's repetitive and doesn't add new information. In
addition to that, prefixing commits that change kcms will become more
straightforward. There's more than one scheme people use, some include
"kwin", some don't.
2022-12-17 20:02:16 +00:00
Alexander Lohnau
7a83e4542c kcmkwin/kwineffects: Adjust "Name" in knsrc file
In the QML code we set the text of the KNS button to `i18n("Get New Desktop Effects...")`.
Consequently we should use the same terminology in the knsrc file.

BUG: 463021
2022-12-17 19:46:24 +01:00
Vlad Zahorodnii
1ca263d588 scene: Move OffscreenQuickView painting to EffectsHandlerImpl
There's no any way to integrate OffscreenQuickView into the scene graph.
So make the EffectsHandlerImpl responsible for drawing quick views until
the corresponding item is introduced (requires a lot and a lot of
refactoring in effects) or the design of kwin changes so much that we
don't need this special code path.
2022-12-17 17:14:43 +00:00
Vlad Zahorodnii
4ded856fbf scene: Introduce ItemRenderer
ItemRenderer class provides Item rendering facilities. The main
motivation behind this change is to extract code that can be used to
render both normal windows as well as the cursor.
2022-12-17 17:14:43 +00:00
Xaver Hugl
9078d916c2 backends/drm: fix error in finding the best plane 2022-12-17 15:40:43 +01:00
l10n daemon script
e708f8a166 GIT_SILENT Sync po/docbooks with svn 2022-12-17 12:35:21 +00:00
l10n daemon script
3ea6ed0b60 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"
2022-12-17 12:16:25 +00:00
l10n daemon script
71ebe1dac4 GIT_SILENT Sync po/docbooks with svn 2022-12-17 02:20:01 +00:00
l10n daemon script
59383ef665 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"
2022-12-17 01:58:50 +00:00
Xaver Hugl
3204d6ac3c port all headers to pragma once 2022-12-16 20:58:17 +00:00
Xaver Hugl
4a09f97679 openglbackend: reduce timeout for handling graphics resets
With current and broken behavior in Mesa, the timeout will always be
reached. GPU resets don't take anywhere near even a second, making
the user wait for 10s has no use.
2022-12-16 20:04:37 +00:00
Xaver Hugl
3335716d7b backends/drm: reset cursor texture on compositing reset
When a GPU reset happens, the old texture and vbo become invalid
2022-12-16 20:04:37 +00:00
Xaver Hugl
6211654e11 openglbackend: increase severity of GPU reset messages 2022-12-16 20:04:37 +00:00
Xaver Hugl
01bf4f12d3 kwinglutils: don't crash on gpu resets 2022-12-16 20:04:37 +00:00
Vlad Zahorodnii
f7a8635b10 Move scene related bits into src/scene/ directory
We've got quite a few scene related files, move them in a directory to
group related code together.
2022-12-16 19:15:35 +00:00
Vlad Zahorodnii
44439baad2 scene: Move some opengl initialization to Compositor
This kind of code doesn't belong in the SceneOpenGL. Moving it to the
Compositor class allows us to make the Scene class less central and
permit running with more than one scene, e.g. one for the workspace and
the other one for the cursor, etc.
2022-12-16 18:25:15 +00:00
Xaver Hugl
efbc86ef6d wayland/drmlease: invalidate lease requests with invalid connectors 2022-12-16 13:47:48 +00:00
Xaver Hugl
c2150988f2 wayland/drmlease: don't connect with nullptr parameter 2022-12-16 13:47:48 +00:00
Xaver Hugl
2c0091aacf wayland/drmlease: don't leak lease connectors 2022-12-16 13:47:48 +00:00
Vlad Zahorodnii
eec07c477d wayland: Require to reboot computer after changing primary selection option
Not all clients handle well withdrawing the primary selection global at
runtime, so apply the new primary selection option only after a reboot.
2022-12-16 12:47:11 +00:00