Commit graph

286 commits

Author SHA1 Message Date
Alexander Lohnau
3cbbdbee99 GIT_SILENT Silence warning about unused parameter in windows runner 2021-03-16 08:45:29 +01:00
Alexander Lohnau
81b40966ed GIT_SILENT Add trailing comma to enums 2021-03-14 18:06:22 +01:00
Aleix Pol
58debd72a3 Only scanout when the texture matches the display size
Otherwise drmModeAtomicCommit() in DrmOutput::doAtomicCommit() fails due
to unmatched buffer sizes.

While rendering continues working properly, this makes drm freak out and
try to go back to a previous state (see the test commit in
presentAtomically()) that in turn starts issuing screen events to every
process even though it's just to say the same thing. The fact that this
happens per frame makes the system unusable as soon as fullscreen starts
happening on a scaled display.

Another thing we could do is get EglGbmBackend::scanout() to take care
of the resizing.
2021-03-11 15:01:09 +01:00
Méven Car
ef19948c00 Reflect changes in kwayland-server changes
https://invent.kde.org/plasma/kwayland-server/-/merge_requests/180
2021-03-11 08:24:33 +00:00
Vlad Zahorodnii
38996d9725 libkwineffects: Introduce EffectScreen
This provides the compositor a way to indicate what output is being
rendered. The effects such as the screenshot can check the provided
screen object in order to function as expected.
2021-03-09 08:58:22 +00:00
Vlad Zahorodnii
b3e7031893 platforms/drm: Fix potential stack corruption
If the file descriptor of the DRM device is greater than FD_SETSIZE, the
stack will be corrupted. However, it is highly unlikely that we ever hit
this case because DRM devices are opened at startup of kwin, so the file
descriptors should small.

In order to prevent the potential stack corruption, this change replaces
the usage of select() with poll().

Unlike select(), the api of poll() is much more sensible. Back 20 or so
years ago the main argument against poll() was that it's not implemented
by all platforms. But, nowadays, it's supported on all major platforms.
2021-03-09 10:27:17 +02:00
Xaver Hugl
7a937fc7af Ignore fully translucent Toplevels for direct scanout 2021-03-05 19:59:48 +01:00
Bhushan Shah
debea631f3 platforms/drm: inhibit the renderloop when screen is turned off
Otherwise we will continue using gpu resources even when we can not show
any content on screen.
2021-03-04 15:01:15 +00:00
Vlad Zahorodnii
691df1ae00 qpa: Use imported targets for QtCore and QtGui private headers 2021-03-04 13:11:27 +00:00
Chaojiang Luo
fdc7e976fe screencast: Add OpenGLES support for screencasting
OpenGLES does not support glGetTextureImage, we use glReadPixels to
replace it.
2021-03-04 09:29:57 +00:00
l10n daemon script
5f7a2806f0 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-03-03 07:52:05 +01:00
Xaver Hugl
7cc95d931b Improvements for direct scanout
Instead of cancelling direct scanout if the client buffer is not
fitting, adjust the atomic planes. Also ignore all toplevels from
other screens.
2021-03-02 17:17:36 +00:00
Xaver Hugl
1f7e794b82 DrmGpu: add gbm device nullptr check
BUG: 433145
2021-02-25 19:14:02 +01:00
Bhushan Shah
28d2650f24 [platforms/drm] include missing errno.h include
CCMAIL: Xaver Hugl <xaver.hugl@gmail.com>
2021-02-23 12:07:17 +05:30
Xaver Hugl
6703bc9d24 Improve teardown of DrmGpu 2021-02-22 21:56:03 +01:00
Bhushan Shah
ae8e69b4bb [platforms/drm] accept both keypress and keyrelease event in filter
We don't want to pass out either of key press or release event to other
filters.
2021-02-22 21:52:57 +05:30
Vlad Zahorodnii
58bee8e38a Fix build 2021-02-22 18:11:06 +02:00
Bhushan Shah
b24fc72969 [platforms/drm] only enable output on key press not release
Otherwise if powerdevil for example is configured to turn screen off on
the power key press, we will turn it right back on when we get key
release event.

Suggested-by: David Edmundson <kde@davidedmundson.co.uk>
2021-02-22 21:16:00 +05:30
l10n daemon script
553b6d39c6 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-02-22 06:57:46 +01:00
Vlad Zahorodnii
45979ed460 x11: Introduce an envvar to force software vsync
This can be useful for debugging purposes and for people wishing to ramp
up the refresh rate on their setups with different refresh rates.

BUG: 433094
2021-02-19 14:59:47 +00:00
Vlad Zahorodnii
fb93037ca7 x11: Introduce an envvar to prevent sync'ing to vblanks
This can be useful if you want to ensure that the buffer swap operation
won't block.

CCBUG: 433094
2021-02-19 14:59:47 +00:00
Vlad Zahorodnii
e179fb697d platforms/drm: Refactor event dispatching code
There are a couple of reasons not to use the lambda:

* It is unnecessary. The DrmGpu has the DRM file descriptor
* If a crash occurs somewhere in the lambda, the backtrace will be hard
  to read
* Instead of processing events in the destructor of the DrmBackend
  class, we should keep dispatching events without involving
  QCoreApplication::processEvents() until all page flips are completed.
2021-02-19 13:40:07 +00:00
Xaver Hugl
79ccfaddf0 Properly clean up DrmGpu
CCBUG: 433145
2021-02-19 13:19:21 +01:00
Vlad Zahorodnii
6053bbd2d0 Sprinkle static keywords
There is no need to query the environment variables every time kwin
tries to determine the current compositing refresh rate.
2021-02-19 11:16:50 +02:00
David Faure
abab1660aa Define -DQT_NO_CAST_TO_ASCII and fix compilation 2021-02-19 11:00:27 +02:00
Aleix Pol
8950b78121 pipewire: Don't crash if we're passed a null spa_data
I just had that crash, this is what coredumpctl suggested it was
happening.
We don't need to make sure we're in dmabuf mode to remove the buffer.
Worst case scenario it won't remove anything. Check the spa_data before
querying in case it's null.
2021-02-18 17:13:36 +00:00
Méven Car
11c3ada121 DrmGpu fix atomicModeSetting try 2021-02-18 16:26:18 +00:00
Vlad Zahorodnii
cf2486d643 x11: Properly detect whether swap events have to disabled
qEnvironmentVariableIntValue() will return 0 if the specified variable
is not set.

This means that swap events will be disabled on AMD GPUs unless the env
var is set explicitly to 1.
2021-02-18 12:04:27 +00:00
Vlad Zahorodnii
8570b64384 Rename visibleRect to visibleGeometry
"rect"s have their origin at the top-left corner of the frame. However,
visibleRect() returns a QRect that's in the global coordinates.
2021-02-16 06:56:04 +00:00
Xaver Hugl
995437f57c decouple DRM planes from DrmOutput 2021-02-15 17:28:58 +00:00
Méven Car
7c2c213f52 QPA Integration: Save enabled screens
Since QWindowSystemInterface::handleScreenRemoved would not be called in Integration::handleScreenDisabled, Qt apps would still reference disabled screens resulting in crashes.
2021-02-15 07:30:18 +00:00
Dan Leinir Turthra Jensen
df498d9be4 Add CLI tool to set window decorations, and use for KNS adoptions
This adds a command line tool which allows the user to set the window
decoration, and then that tool is used in the two knsrc files to allow
the user to switch window decoration directly from either a KNS dialog,
or from Discover.
2021-02-11 16:44:33 +00:00
Vlad Zahorodnii
3d363fb797 Fix build on FreeBSD 2021-02-11 16:49:05 +02:00
Vlad Zahorodnii
9ccae5eda6 platforms/wayland: Round up fractional scale factors
Currently, fractional scale factors that are less than 1 will be floored
to 0, which is a protocol violation.

CCBUG: 432766
2021-02-11 12:06:37 +00:00
Vlad Zahorodnii
2ce49877f7 platforms/wayland: Emit outputEnabled() signal
Otherwise the QPA won't create QPlatformScreens and the compositor may
not work as expected.
2021-02-11 12:03:26 +00:00
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.
2021-02-10 15:31:43 +00:00