Commit graph

27360 commits

Author SHA1 Message Date
Vlad Zahorodnii
315fff68e9 opengl: Drop unnecessary 16 bit texture support checks
16 bit textures are supported universally in OpenGL.
2024-08-20 11:57:19 +00:00
Vlad Zahorodnii
f3406a033c opengl: Set GL_UNPACK_ROW_LENGTH in GLTexture::upload()
The image stride can be other than "width * bpp". In order to properly
handle such a case, we need to set GL_UNPACK_ROW_LENGTH to skip the right
amount of pixels between consecutive rows.

Co-authored-by: Gabriel Souza Franco <gabrielfrancosouza@gmail.com>
2024-08-20 11:57:19 +00:00
Vlad Zahorodnii
31adedba3a opengl: Re-arrange code in GLTexture::upload()
Re-arrange the code so it's easier to set GL_UNPACK_ROW_LENGTH.
2024-08-20 11:57:19 +00:00
Xaver Hugl
def0bde5e9 scene/workspacescene: do occlusion testing for direct scanout
Some clients have two or more completely opaque surfaces stacked on top of each other,
optimizing the lower ones out makes direct scanout happen more often and more efficiently
when multiple planes are involved
2024-08-20 13:05:02 +02:00
Xaver Hugl
4ebb8530e6 scene/workspacescene: remove unused function 2024-08-20 11:04:44 +00:00
l10n daemon script
7f1f62e53e GIT_SILENT Sync po/docbooks with svn 2024-08-20 01:42:58 +00:00
l10n daemon script
a9e85cd540 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"
2024-08-20 01:24:48 +00:00
Xaver Hugl
f9e6ecd298 core/colorpipeline: improve optimization with differing reference luminances
This is done by
- fixing isFuzzyScalingOnly to not check the [3, 3] component, which is always 1
- making the comparison between transfer functions fuzzy, so small floating point
  errors don't prevent two practically identical functions to be optimized out
- switching manual optimizations to use addMatrix instead, which removes the
  matrix or replaces it with a multiplier

and the autotest is expanded to test transformations between color descriptions with
transfer functions and reference luminances that are just scaled versions of each
other
2024-08-19 16:39:11 +02:00
Xaver Hugl
e2c7cf2bb3 autotest/colorspaces: test identity transformations with bpc 2024-08-19 16:38:54 +02:00
Jie Liu
8233bb9de5 colorblindesscorrection: fix incorrect variable name in shader program
Signed-off-by: Jie Liu <liujie01@kylinos.cn>
2024-08-19 14:16:13 +00:00
Yifan Zhu
0eba9e631e debug_console: correct name scancode to keycode
QKeyEvent()->nativeScanCode() actually reports the keycode generated by
the kernel, not the scancode generated by the hardware.
2024-08-19 13:59:17 +00:00
Xaver Hugl
d07ce95617 effect/animationeffect: use a normal d pointer
There's no need for Qt macros to do that
2024-08-19 11:58:22 +00:00
Xaver Hugl
f10a93ce1c effects/animationeffect: clean up the code a bit 2024-08-19 11:58:22 +00:00
Vlad Zahorodnii
8ca94eed44 opengl: Fix a typo in GLTexture::upload()
For glTexStorage2D(), we need to check whether texture storage is
supported, not that ARGB32 textures are supported. Those are two
distinct things.
2024-08-19 11:44:27 +00:00
l10n daemon script
3e3bbd3034 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"
2024-08-18 01:21:13 +00:00
Xaver Hugl
74b04d3e4e disable the watchdog by default
The systemd watchdog has three big problems:
- it wrongly restarts KWin in some cases after suspend
- it wrongly restarts KWin in some OOM situations
- it wrongly restarts KWin when doing a live upgrade from the watchdog being disabled to it being enabled

Each of those cases can cause users to lose data and in the upgrade case even require repairing
the system manually, which is not acceptable.
This commit keeps the watchdog code in place for now; the decision to remove it or what to
replace it with isn't as urgent.
2024-08-17 23:23:21 +00:00
l10n daemon script
fa35c8bbac GIT_SILENT Sync po/docbooks with svn 2024-08-17 01:28:05 +00:00
Xaver Hugl
b325555e18 workspace: unset brightness devices on outputs that didn't get one assigned
Otherwise, two outputs might end up having the same brightness device
2024-08-16 23:33:13 +00:00
Vlad Zahorodnii
fdff6588c6 opengl: Drop GLTexture::update(QImage, QPoint, QRect) overload 2024-08-16 19:03:48 +03:00
Vlad Zahorodnii
e504f1a711 scene: Port away from GLTexture::update(QImage, QPoint, QRect) overload 2024-08-16 19:03:48 +03:00
Vlad Zahorodnii
46e452127e opengl: Add GLTexture::update() overload that takes a region
This ensures a couple of things:

- avoid pointlessly binding and unbinding the texture
- if the image format needs to be changed, it will be done only once
2024-08-16 19:03:40 +03:00
Vlad Zahorodnii
bfff8ac52a opengl: Simplify GLTexture::update()
Use the unpack code path by default, it lets us to simplify the code and
also fix texture uploading when the image stride is not
"width * bytes per pixel".
2024-08-16 15:35:42 +00:00
Vlad Zahorodnii
98953b0218 opengl: Make GL_EXT_unpack_subimage mandatory
It's widely supported, and other wayland compositors already require it,
so the chances of breaking things should be minimal, although some embedded
GPUs might be affected, in which case kwin will fallback to software
rendering. With the unpack being always available, we can simplify and
also fix bugs in texture uploading.
2024-08-16 15:35:42 +00:00
Xaver Hugl
7ab825cba1 backends/drm: test direct scanout with the same code as presentation
This means that we prefer direct scanout over a specific presentation mode (tearing),
which usually just means we first engage direct scanout and program the relevant
properties, and then switch to tearing afterwards.
It also removes a hack for direct scanout with legacy, and is one step less for
implementing overlay plane support.
2024-08-16 14:26:58 +02:00
David Redondo
df184ebd11 fakeinput: Remove static touches list
We track now touches per device
2024-08-16 08:48:49 +00:00
David Redondo
436211ad45 fakeinput: Keep track of pressed buttons, keys and touches
To prevent having them eternally pressed when the device is
destroyed.
2024-08-16 08:48:49 +00:00
l10n daemon script
82a49d8abc GIT_SILENT Sync po/docbooks with svn 2024-08-16 01:30:23 +00:00
l10n daemon script
ff56041de4 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"
2024-08-16 01:21:04 +00:00
Xaver Hugl
3aba2cf3da wayland/frog_colormanagement: improve mastering luminance handling
Before we only used max_cll and max_fall, but with some videos they are not provided
and only mastering display luminances are set
2024-08-16 02:36:05 +02:00
Xaver Hugl
f9b88ee2f3 wayland_server: expose xx color management support by default
I'm confident in the implementation and (significant) upstream changes before the protocol
is released as wp-colormanagement-v1 are unlikely, so I think allowing apps to make use of
it in practice is okay at this point.

Once the upstream protocol is released, we'll still drop the xx variant though and apps will
have to use the wp protocol in order to make use of color management features.
2024-08-15 14:47:21 +00:00
David Redondo
9e2326d3ac Generate wayland code with PRIVATE_CODE 2024-08-15 14:16:11 +00:00
Xaver Hugl
fe5db7f97d backends/drm: disable degamma_lut and ctm on NVidia
The NVidia driver maps them to hardware planes, which means they do not
apply to the cursor because the cursor plane doesn't have these color
operations.

BUG: 491634
2024-08-15 15:26:41 +02:00
Xaver Hugl
74c90b727f wayland/xx colormanagement: send max_fall and max_cll 2024-08-15 10:38:02 +00:00
Xaver Hugl
ecd3c673e9 wayland/xx colormanagement: send target primaries 2024-08-15 10:38:02 +00:00
Xaver Hugl
9ed492a17f wayland/xx colormanagement: send named primaries when possible 2024-08-15 10:38:02 +00:00
Vlad Zahorodnii
f3086be998 Simplify Window::updateLayer()
The stack layer of a transient doesn't depend on its transient parent.

It is not clear why this code exists, it dates back to a commit 20 years
ago, which is massive and difficult to analyze. But, with that being said,
Window::belongsToLayer() doesn't place transients in parent's stack
layer, stack constraints are used instead.
2024-08-15 09:29:24 +00:00
l10n daemon script
af8f3e4126 GIT_SILENT Sync po/docbooks with svn 2024-08-15 01:33:59 +00:00
Xaver Hugl
e3953e7602 core/colorpipeline: allow rounding away more floating point errors
Black point compensation introduced a tiny bit increased error in the floating point
calculations, but the errors are still way too small to actually matter.
To avoid those unnecessary calculations causing performance issues and more rounding
errors, this commit changes the allowed error to 10^-5.
2024-08-15 01:23:00 +00:00
Xaver Hugl
aa93f6ac55 autotests/colorspaces: add some test cases for black point compensation 2024-08-15 01:23:00 +00:00
Xaver Hugl
45c09de02b backends/drm: make minBrightness in the color description more accurate in SDR
There's no way to go below the min. luminance of the transfer function
2024-08-15 01:23:00 +00:00
Xaver Hugl
0fdc3b2633 core/iccprofile: read and use the black point for black point compensation 2024-08-15 01:23:00 +00:00
Xaver Hugl
6f79597f13 core/colorspace: match default luminances with the Wayland protocol
It wasn't feasible to do it before, because it made SDR black far too bright, but
with black point compensation the result looks as users expect it
2024-08-15 01:23:00 +00:00
Xaver Hugl
0d0135e237 core/colorspace: implement black point compensation 2024-08-15 01:23:00 +00:00
Xaver Hugl
cd371d8618 opengl/glshader: set all color management uniforms, even if some calls fail
A driver might optimize out a uniform, in which case setting it will fail. That does not however mean
that the rest can be ignored too or that the shader won't work because of that
2024-08-15 01:23:00 +00:00
Xaver Hugl
7bdab9c4d2 core/colorpipeline: fix matrix multiplication order when optimizing matrix operations
The other matrix needs to be applied first, so it must be on the right side in
the matrix multiplication
2024-08-15 01:23:00 +00:00
l10n daemon script
388082cb3d 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"
2024-08-15 01:22:15 +00:00
Xaver Hugl
ad27858df3 platformsupport/scene/opengl: do test imports for external_only formats properly
The scene renderer doesn't use external_only formats as a single EGLImage, but only does
YUV conversion for some specific formats, so the test import should match that.
2024-08-15 01:09:36 +02:00
Xaver Hugl
61ef8c0087 opengl/egldisplay: add the invalid modifier to the correct list
Adding the invalid modifier to nonExternalOnlyModifiers even for formats that otherwise only
have external_only modifiers means that KWin will advertise support for this modifier to clients,
but using the format without external_only samplers fails.
2024-08-15 01:06:15 +02:00
Vlad Zahorodnii
2cc3f9cdee Avoid issuing many glTexSubImage2D() calls when uploading shm contents
Applications that use QtWidgets can have a lot of rectangles in the
damage region. For example, when you navigate between directories in
Dolphin, each individual file or folder item will be added to the
damage region rather than the container view where they are.

On the other hand, issuing multiple glTexSubImage2D() function calls
is not great because it means stalling the cpu until the texture upload
completes.

This change attempts to improve that by simplifying the input damage.
If the input damage isn't complex, use it as is; otherwise use its
bounding rect.

The gains are not impressive. On my machine, I see fewer 5ms texture
upload time spikes when navigating in Dolphin, now I can observe 4ms
spikes instead. Still, I believe the change is reasonable enough.
2024-08-14 13:18:33 +00:00
Xaver Hugl
6b3f211ef7 wayland: remove workaround for xdg-dialog base name with wayland-protocols <= 1.35
We require 1.36 now, so the workaround is no longer necessary
2024-08-14 14:50:14 +02:00