Commit graph

446 commits

Author SHA1 Message Date
Xaver Hugl
18a72f7187 backends/drm: also force linear layout for dumb buffer cursors
While it usually shouldn't make a difference, it ensures that the buffer import
always works properly

CCBUG: 456306
2022-10-04 07:33:59 +00:00
Xaver Hugl
ae4dd73e99 backends/drm: use linear buffers for multi gpu where necessary 2022-10-03 10:44:51 +00:00
Xaver Hugl
1f92dc5e5d backends/drm: correct test buffer check
There can be situations where the surface fits but there's no test buffer yet
2022-10-03 10:44:51 +00:00
l10n daemon script
b4cd4f645e 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-09-28 01:57:42 +00:00
Arjen Hiemstra
9a6c1e60e8 X11 backend: Retry enabling compositing when it was disabled a while ago
This removes the "OpenGLIsUnsafe" flag and replaces it with a timestamp
that we can check to see how long ago we tried enabling compositing, so
we can retry it if a certain amount of time has elapsed.

BUG: 452344
2022-09-27 10:23:04 +00:00
Vlad Zahorodnii
1d8c9c62cf backends/drm: Fix 100% cpu usage after tty switch
The drm fd can get stuck in readable state, in which case the
QSocketNotifier will fire the activated signal as often as it can
leading to high cpu usage.

We need to read() the drm fd in order to make the socket notifier stop
firing QSocketNotifier::activated.

This change removes the m_platform->isActive() check to ensure that
drmHandleEvent() gets called, in general, it should be safe as we only
notify the outputs about completed pageflips.

BUG: 452726
2022-09-27 07:29:05 +00:00
Aleix Pol
2c874fc3e0 tablet: Ensure persistency of the outputName property
With this change, when the specified output is disconnected, it will
just behave as if none were selected but when it's connected again it
will pick it back up.

BUG: 456857
2022-09-27 07:11:38 +00:00
Fabian Vogt
494feb2eea Fix build with older libgbm
The code for the !HAVE_GBM_BO_GET_FD_FOR_PLANE case needed an explicit
constructor call.
2022-09-16 17:51:36 +00:00
Xaver Hugl
1a902b1dec backends/drm: supress warning for disconnected connector
It just pollutes the log with useless information
2022-09-16 01:43:08 +02:00
Aleix Pol Gonzalez
fdf2011b34 Wayland backend: Don't crash when terminating
Remember to release all resources before the wayland socket goes:
- release the seat as we give up a seat
- release the ssdManager
- release the output decoration with the output itself
Otherwise they leak and stay dangling.
2022-09-15 16:43:04 +00:00
Xaver Hugl
eccfbbd6fd backends/drm: turn all outputs on when new output is hotplugged
Otherwise only the new output is turned on, which is a bit weird
2022-09-14 12:58:39 +02:00
Vlad Zahorodnii
a1e1d72f4b backends/drm: Emit Platform::outputsQueried signal after removing virtual output
It's needed so the Workspace can react to output removal.
2022-09-13 18:53:47 +00:00
l10n daemon script
ed811a7810 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-09-13 01:46:02 +00:00
Xaver Hugl
5f886d72cf backends/fakeinput: port away from QObject memory management 2022-09-12 20:55:32 +00:00
Xaver Hugl
b0c852aa76 backends/wayland: port away from most remaining manual memory management 2022-09-12 20:55:32 +00:00
Xaver Hugl
297971006b backends/x11: port away from most remaining manual memory management 2022-09-12 20:55:32 +00:00
Vlad Zahorodnii
d1de19e212 Make Workspace process batched output updates
Currently the Workspace processes output updates as they occur, e.g.
when the drm backend scans connectors, the Workspace will handle
hotplugged outputs one by one or if an output configuration changes the
mode of several outputs, the workspace will process output layout
updates one by one instead of handling it in one pass. The main reason
for the current behavior is simplicity.

However, that can create issues because it's possible that the output
layout will be temporarily in degenerate state and features such as
sticking windows to their outputs will be broken.

In order to fix that, this change makes the Workspace process batched
output updates. There are several challenges - disconnected outputs have
to be alive when the outputsQueried signal is emitted, the workspace
needs to determine what outputs have been added or removed on its own.
2022-09-12 08:03:48 +00:00
Vlad Zahorodnii
e0945886ed Rename Platform::screensQueried() to Platform::outputsQueried()
It makes the vocabulary consistent. We use the word "output" more than
"screen."
2022-09-12 08:03:48 +00:00
Vlad Zahorodnii
dbef4fa3f0 backends/drm: Rework GPU removal
The proposed way to handle unplugged gpus allows us to ensure that
removed outputs' lifetime can be extended to the moment when the
Platform::outputsQueried signal is emitted.

Besides that, it's possible to extend this code a bit further to make
sure that output updates are batched when hotplugging multiple gpus,
e.g. after resuming, etc.
2022-09-12 08:03:48 +00:00
Vlad Zahorodnii
3d1b3c9c66 backends/drm: Store hardware and virtual outputs in two different lists
Currently, we effectively almost everywhere need DrmOutput outputs,
DrmVirtualOutput outputs are needed only in a couple of places. There's
not a lot that we gain from storing real and virtual outputs in one
list, it adds unnecessary casting, etc. Ideally, virtual outputs must
come from a different backend, the current approach is not scalable.
2022-09-07 17:40:51 +00:00
Vlad Zahorodnii
9c4bcb92c3 backends/drm: Don't sort DrmBackend::m_outputs
This std::sort() function traces its origin back to
cbbd684430. The sort step was necessary to
ensure that we get same configuration hash regardless the order in which
outputs were connected.

On the other hand, our KWinKScreenIntegration code already does that so
it seems excessive to sort outputs the second time.
2022-09-06 17:54:52 +03:00
Vlad Zahorodnii
d8ea87a9ea Add dummy placeholder output type
Placeholder outputs are not rendered so they don't need render data.
Also, this simplifies the control flow when the last real output is
removed. The Platform::screensQueried signal won't be emitted inside a
Platform::screensQueried slot.
2022-09-06 10:36:33 +00:00
Vlad Zahorodnii
d2fb4147fc Move multi-purpose code in its own directory
Things such as Output, InputDevice and so on are made to be
multi-purpose. In order to make this separation more clear, this change
moves that code in the core directory. Some things still link to the
abstraction level above (kwin), they can be tackled in future refactors.
Ideally code in core/ should depend either on other code in core/ or
system libs.
2022-09-06 11:21:40 +03:00
Aleix Pol
0744ee09ed libinput: Include the Pad name in the TabletPadId
It's helpful to identify what pad we are referring to in a cross-session
way where a pointer won't hold.
2022-09-05 20:37:40 +00:00
Aleix Pol
6b4feccadd tablet: Send libinput timestamp as the time
As it should be done, instead of using some different value from the
local system.
2022-09-05 20:37:40 +00:00
Laurent Montel
0ea72e9275 Remove extra ';' 2022-09-02 08:27:52 +02:00
Vlad Zahorodnii
207a16f14f backends/drm: Fix software cursor fallback in DrmOutput::renderCursorOpengl()
We need to return if the cursor sprite is bigger than DrmGpu::cursorSize().

BUG: 458036
2022-09-01 13:11:13 +00:00
Vlad Zahorodnii
df79d68309 backends/drm: Port from kwinApp()
kwinApp() lives in abstraction layer above and we can use
QCoreApplication to terminate the application.
2022-09-01 12:49:39 +03:00
Xaver Hugl
e195d42916 backends/drm: ensure pipeline mode is always in the connector mode list
The current mode of an output not being in its mode list can lead to crashes
2022-08-31 09:18:59 +00:00
Xaver Hugl
c4b9626117 backends/drm: replace manual IN_FORMATS parsing with libdrm functions
!2819 reminded me that it's time to replace this mess with libdrm functions

Upstream MR: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/146
2022-08-30 08:30:01 +00:00
Vlad Zahorodnii
ed49d7c59b Refactor output state setting
If multiple properties that affect the geometry change, then the
Output::geometryChanged() signal will be emitted multiple times, which
in its turn may force the Workspace to re-arrange windows, etc.

With this, the geometryChanged signal will be emitted in more expected
fashion only once as long as relevant property changes are batched.
2022-08-28 14:30:24 +00:00
Xaver Hugl
a1ed313a42 backends/drm: move placeholder output management to Workspace
Backends aren't the right layer to take care of placeholder outputs, and
don't really have enough information to do it either. This also fixes a
crash, because the placeholder output currently gets created too late
2022-08-27 20:30:27 +02:00
Vlad Zahorodnii
070f63c451 Drop Screens::geometry() and Screens::size()
Currently, the main user of these two functions is the X11 standalone
platform.

This change ports that code to Workspace::geometry(), which is not great
but the X11 backend already depends on the Workspace indirectly via the
Screens. Not sure if it's worth making the standalone X11 backend track
the xinerama rect internally.
2022-08-27 13:51:37 +03:00
Vlad Zahorodnii
ace5b58f7a Drop Platform::{outputEnabled,outputDisabled} signals
Use Output::enabledChanged signal to determine if an output is enabled
or disabled.
2022-08-25 06:35:55 +00:00
David Redondo
80d28499e1 libinput/device: Use button mapping that is used in input handling for supported buttons
Fixes and prevents inconsistencies between those.
2022-08-24 08:44:31 +00:00
Vlad Zahorodnii
a32869594e Fix some -Wunused-variable warnings 2022-08-23 10:54:39 +03:00
l10n daemon script
8ca6170c91 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-08-22 01:46:04 +00:00
Vlad Zahorodnii
26752058d6 backends/x11: Remove initial position logic
Let kwin decide the output position. This makes the behavior of the
x11 backend consistent with the drm backend.
2022-08-18 10:20:53 +00:00
Vlad Zahorodnii
97e196df54 backends/wayland: Remove initial position logic
Let kwin decide the output position. This makes the behavior of the
wayland backend consistent with the drm backend.
2022-08-18 10:20:53 +00:00
Vlad Zahorodnii
b5a4c08231 Move kscreen integration in Workspace
The main motivation behind moving kscreen integration to the
Workspace is to make output configuration work the same way
regardless of the backend and simplify the drm backend.
2022-08-18 10:20:53 +00:00
Vlad Zahorodnii
59907c12ff Remove own copies of drm_fourcc.h
libdrm is a mandatory dependency so we don't need to keep own copies of
drm_fourcc.h anymore.
2022-08-17 14:08:05 +00:00
Vlad Zahorodnii
fa5be54a6d Remove Platform::repaint()
It doesn't belong in Platform.
2022-08-17 10:39:46 +00:00
Vlad Zahorodnii
cf5205439c backend/wayland: Fix computing output pixel size in xdg_toplevel.configure handler
Currently, we pass the logical size but setGeometry() expects the size
in device pixels. It fixes "kwin_wayland --scale 2" shrinking on every
configure event.
2022-08-17 09:48:38 +00:00
Janet Blackquill
506e2d6f9f drm_gpu: don't bother trying to assign a crtc to a connector that isn't connected
BUG: 457002
2022-08-16 13:04:31 +00:00
Vlad Zahorodnii
f2e594358c Remove Platform::supportsOutputChanges()
If the platform does not support configuring outputs, applying a config
must fail. However, almost all output backends support output
configuring except, perhaps, the x11 backend, but that case doesn't
matter.
2022-08-16 12:31:28 +00:00
Volker Krause
835dc7c818 Explicitly mark DrmObject as non-copyable
It implicitly already is not copyable, due to the unique_ptr member.
However, Qt6 moc code isn't realizing that and fails to compile the
DrmPlane Q_GADGET sub-class of this.
2022-08-15 18:03:46 +02:00
Xaver Hugl
6cdb1e6f64 backends/drm: add stricter checks for direct scanout
Buffers with implicit modifiers from another GPU must not be imported, as
the layouts may not be compatible.
For buffers with incompatible modifiers, direct scanout can also be rejected
early, saving some computational power.

BUG: 457851
2022-08-14 19:53:30 +02:00
Xaver Hugl
f4e917f734 backends/drm: release buffers for disabled objects
BUG: 456686
2022-08-12 19:52:24 +00:00
Xaver Hugl
9c4f3d447f debug console: use FileDescriptor class 2022-08-11 21:27:33 +02:00
Xaver Hugl
1b1e0ab95f wayland/drmlease: use FileDescriptor class 2022-08-11 21:27:33 +02:00