44 Commits (master)

Author SHA1 Message Date
Xaver Hugl 8d25550c22 backends/drm: support applying icc profiles with color management
While applications are still restricted to sRGB, this allows working on sRGB
content on displays with a wide color gamut as the whole profile gets applied,
instead of just the VCGT.

CCBUG: 439135
11 months ago
Laurent Montel bc6116c5a7 There's no QVector anymore, QList is the QVector in Qt6 11 months ago
Vlad Zahorodnii 7d626363e4 autotests: Remove old kernel checks
CI runners have been upgraded.
1 year ago
Xaver Hugl 32ae9dd7d1 libkwineffects: rename major and minor methods
There's "major" and "minor" defines that can get implicitly included, for
example with musl libc. To prevent that from breaking compilation, rename
the methods
1 year ago
Xaver Hugl 1c18d11206 backends/drm: replace drmModeAtomicCommit with a custom implementation
drmModeAtomicCommit does additional allocations and sorting that KWin doesn't
use or need
1 year ago
David Edmundson 10ed34bc9d Avoid painting unchanged scene layers
Currently when we move the mouse the one render loop triggers a repaint.
When the cursor layer needs a new update we end up in the compositor
repainting the main content.

Even though painting should mostly no-op it still goes through all
existing items and effects to collect damage, still potentially making
the GL context current which could stall. A waste when we know we
haven't got anything to do. It's enough to cause noticable mouse lag on
some hardware.

Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
1 year ago
Xaver Hugl 44937136cd backends: record GPU render time
This should make it much less likely for KWin to miss frames
1 year ago
Xaver Hugl 7d02bc17d6 backends/drm: rework how atomic commits are tracked
Pending buffers for drm planes and crtcs are no longer tracked in the planes
and crtcs themselves, but instead in a DrmCommit object that is used as
the user data for the pageflip handler. This way multiple commits can be
pending at the same time without causing conflicts, and the handling of
pending buffers is simplified as well.
1 year ago
Xaver Hugl 87444f6ce3 backends/drm: offload atomic commits to a separate thread
This separate thread submits commits as late as possible, so that until
immediately before vblank the cursor position can still be updated, reducing
its latency and opening the door for more optimizations.
1 year ago
Laurent Montel 86c6238cfa Don't use QtTest => use QTest + missing include 1 year ago
Aleix Pol Gonzalez 49a76ea772 Install KWaylandServer headers
There are use cases for the headers to be used, e.g. when implementing
wayland-specific workflows from an Effect.
In order to be able to use these, we also need to expose libkwin to be
imported as it carries the interfaces' symbols.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
1 year ago
Vlad Zahorodnii 88ade3a409 Extract reusable egl swapchain bits
EGL rendering has some duplicated bits, so this change extracts
them to reduce code duplication.
1 year ago
Vlad Zahorodnii 3bd5e91226 Extract reusable qpainter swapchain bits
QPainter rendering has some duplicated bits, so this change extracts
them to reduce code duplication.
1 year ago
Vlad Zahorodnii d6a384627b autotests: Let drm test use host primary node to allocate buffers 1 year ago
Vlad Zahorodnii 082301920e backends/drm: Port to GraphicsBuffer
This change ports the drm backend to the GraphicsBuffer and
GraphicsBufferAllocator.

The main motivation is to unify graphics buffer abstractions across
various backends and to prepare it for output layers, which could be
nicer if we could have direct control over the buffers.
1 year ago
Xaver Hugl 8229573e63 autotests/drm: add a test for doing modesets
And fix an issue preventing it from working
1 year ago
Xaver Hugl e7c803b7e5 backends/drm: store drm properties directly in drm objects
This makes it possible to ensure type safety for enums, as each drm property
object can have its own type now, and it reduces the amount of typing needed
to access properties
1 year ago
Xaver Hugl 67dc0c5c48 backends/drm: restrict common mode generation to drivers that support scaling
Also set the scaling mode property to "full aspect", which should reduce
the number of cases where the feature can cause issues
2 years ago
Vlad Zahorodnii e88a4e34a3 Remove some include_directories()
It seems we've settled on dir/dir/header.h includes, so let's use them
consistently.
2 years ago
Xaver Hugl f433213bd6 backends/drm: simplify how atomic commits are done
Instead of having every DrmProperty store pending values, store the data
for the next commit in a separate and temporary type. This simplifies the
code and makes it possible to do commits in a separate thread
2 years ago
Xaver Hugl d9077e36c5 backends/drm: use a common base class for property blobs
This simplifies the code a bit and makes more generic handling of blobs
possible
2 years ago
Xaver Hugl e4938297e6 scene: fix texture inversion with the drm backend
Specify the render target to buffer transformation and take that into
account in effects and when calculating the projection matrix.
2 years ago
Xaver Hugl 2417a0381f backends/drm: port from gbm_surface to a custom swapchain using gbm buffers 2 years ago
Vlad Zahorodnii d9f5d432be Port to KF6 2 years ago
Xaver Hugl 00c0f29f8e autotests/drm: add test that verifies extending output lifetimes works 2 years ago
Xaver Hugl 435873a19b autotests/drm: add more test cases for mode generation 2 years ago
Vlad Zahorodnii 89607dfebd qAsConst -> std::as_const
We started using std::as_const() in some parts of kwin, so let's use it
everywhere for the code consistency sake.
2 years ago
Vlad Zahorodnii 7fffe99328 build: Add -Wno-unused-parameter compiler option
Due to being a compositor, kwin has to conform to some certain
interfaces. It means a lot of virtual functions and function tables to
integrate with C APIs. Naturally, we not always want to use every
argument in such functions.

Since we get -Wunused-parameter from -Wall, we have to plumb those
unused arguments in order to suppress compiler warnings at the moment.

However, I don't think that extra work is worth it. We cannot change or
alter prototypes in any way to fix the warning the desired way. Q_UNUSED
and similar macros are not good indicators of whether an argument is
used too, we tend to overlook putting or removing those macros. I've
also noticed that Q_UNUSED are not used to guide us with the removal no
longer needed parameters.

Therefore, I think it's worth adding -Wno-unused-parameter compiler
option to stop the compiler producing warnings about unused parameters.
It changes nothing except that we don't need to put Q_UNUSED anymore,
which can be really cumbersome sometimes. Note that it doesn't affect
unused variables, you'll still get a -Wunused-variable compiler warning
if a variable is unused.
2 years ago
Xaver Hugl 3d7e926c94 autotests/drm: add autotest for common modes 2 years ago
Xaver Hugl d628cc90fa autotests/drm: use std::vector instead of malloc 2 years ago
Volker Krause 346ac6f32b Add Qt 6 FreeBSD CI 2 years ago
Xaver Hugl a587e426f8 add autotest for the drm platform 2 years ago
Xaver Hugl c0c3ec09af Refactor DrmObject 4 years ago
Xaver Hugl 995437f57c decouple DRM planes from DrmOutput 4 years ago
Vlad Zahorodnii 93e0265e4e Move source code to src/ directory
Once in a while, we receive complaints from other fellow KDE developers
about the file organization of kwin. This change addresses some of those
complaints by moving all of source code in a separate directory, src/,
thus making the project structure more traditional. Things such as tests
are kept in their own toplevel directories.

This change may wreak havoc on merge requests that add new files to kwin,
but if a patch modifies an already existing file, git should be smart
enough to figure out that the file has been relocated.

We may potentially split the src/ directory further to make navigating
the source code easier, but hopefully this is good enough already.
4 years ago
Nicolas Fella 99947c8bd8 Use versionless Qt cmake target
This makes it easier to build against both Qt5 and Qt6

GIT_SILENT
4 years ago
Xaver Hugl 9f4a1433e4 Also initialize properties when not using AMS
BUG: 431981
4 years ago
Laurent Montel 2ac8611523 If include is define in .h remove it if it's defined in .cpp too (scripted) 4 years ago
Vlad Zahorodnii 4ce853e8e4 Prettify license headers 4 years ago
Vlad Zahorodnii 1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
4 years ago
David Edmundson 9e1bb1f130 [autotests] Fix warning
DrmOutput is a class
4 years ago
Vlad Zagorodniy c7639fd7ed Port away from deprecated headers
Summary: Headers like stdio.h are deprecated in C++.

Test Plan:
Compiles.

clangd no longer spews these warnings

{F6997789, size=full}

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22351
5 years ago
Martin Flöser 1c61e61119 [autotests] Support new way to run the tests without need to install
Summary:
KWin was quite good in ensuring that you don't need to install by
passing paths to the tests. The new way is much nicer, so code is
adjusted for the new way. Also if we require a newer ECM in future we
need to support the new way.

No guarantee that the tests don't pick something up from the system env,
that needs more testing.

References: https://community.kde.org/Guidelines_and_HOWTOs/Making_apps_run_uninstalled

Test Plan: The tests which loaded helpers pass

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7543
7 years ago
Martin Flöser d4ba05a22f [autotests] Add tests for DRM platform plugin
Summary:
The addition of the test infrastructure is motivated by the regressions
caused by adding mode switching and transformation support.
A contributing factor to these regression is the fact that the DRM
platform does not have any tests. It is difficult to test this code as
it needs to work with hardware, thus we cannot use the real DRM library.
Instead we need to use mocking.

This change sets up some first basic tests with the help of a mockDrm
library. In order to better test the code as units the Drm classes are
slightly refactored. Most importantly the dependency to DrmBackend is
removed wherever possible and replaced by a simple int fd which is mostly
the only element used by the classes.

This first test introduces basic testing of a DrmObject. It is intended
to extend this to at least also test DrmPlane as a central piece of our
Drm platform plugin. This will also extend the tests of DrmObject.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D8776
7 years ago