Commit graph

48 commits

Author SHA1 Message Date
Simon Hausmann
3b51c8e30a
LinuxKMS: Add support for synthetic display rotations (#4166)
This patch adds support for the `SLINT_KMS_ROTATION` environment
variable, that instructs the Skia/FemtoVG renderers to rotate
the scene before rendering.
2023-12-18 17:49:05 +01:00
Simon Hausmann
8d19426723
linuxkms: decouple event loop from window adapter (#4144)
- Allow for the event loop to run before creating the window adapter
- Keep the loop running if requested
2023-12-12 13:06:36 +01:00
Simon Hausmann
c1841fdfbe Add support for compiling the linuxkms backend without libseat support 2023-12-11 17:36:17 +01:00
Simon Hausmann
cb51fdfe81 janitor: bump xkbcommon dependency 2023-11-14 16:00:56 +01:00
Simon Hausmann
269b327cff janitor: bump calloop dependency 2023-11-14 15:56:24 +01:00
Simon Hausmann
58f9cf5d36 Port to new vulkano
This might fix the issue with resizing causing swapchain re-creation
errors, because "Swapchain creation no longer returns an error when the
swapchain extent doesn't match the current surface extent."

cc #3850
2023-11-13 12:39:59 +01:00
Simon Hausmann
0118363bec Fix build with only backend-linuxkms
Activate the kms feature of softbuffer correctly, when building without
default features.
2023-11-13 11:14:03 +01:00
Olivier Goffart
1864257f29 Silence error when rendering SVG in an 0x0 size
Make the size argument to svg::render optional to mean that it is the
default size of the image.
Otherwise, passing None as the size to ImageInner::render_to_buffer
would not render the image which is possible in some backend (eg: the
button image icon with the qt backend)

And if the image is really rendered on an empty because of layouting or
so, we don't need to show a warning anyway.

Fix #3790
2023-11-02 11:09:20 +01:00
Simon Hausmann
11ce7a2d59 Don't compile glutin twice
Use the same glutin version everywhere
2023-10-25 08:43:42 +02:00
Olivier Goffart
12cd8e71f1 WIP: some polish over the winit update to 0.29 2023-10-23 14:22:48 +02:00
Simon Hausmann
60901a27ff skia: Fall back to software rendering if GPU accelerate rendering fails to initialize
At the moment this is only supported for the winit backend and the C++
API. linuxkms uses a different SkiaRenderer constructor.
2023-10-23 13:55:23 +02:00
Simon Hausmann
d9672c5a21 linuxkms: Initialize xkb lazily
This has two benefits:

- It improves start-up time for device that are touch-only because
  the xkb parsing is delayed until a keyboard is attached and key is
  pressed
- It fixes #3678 by working around the situation where xkb would
  crash if the xkbcommon data files (in /usr/share/X11/xkb) aren't
  there. Sadly, no error is reported in that case (that we could
  handle), instead just crashes.
2023-10-16 19:03:10 +02:00
Simon Hausmann
0d35e01724 Revert "linuxkms: Update drm and gbm dependencies"
This reverts commit 17afe1aa8a.

This causes

 thread '<unnamed>' panicked at 'assertion failed: (has_modifier && modifier.is_some()) || (!has_modifier && modifier.is_none())', drm-0.10.0/src/control/mod.rs:324:9

when running on qemu-virgl.
2023-10-13 15:21:15 +02:00
Simon Hausmann
17afe1aa8a linuxkms: Update drm and gbm dependencies 2023-10-13 08:54:59 +02:00
Olivier Goffart
40cbdd17f3 Janitor: linuxkms: slint-ui.com -> slint.dev 2023-10-11 08:28:31 +02:00
Simon Hausmann
1c37a7ed60 linuxkms: Prospective fix for touch input when SLINT_SCALE_FACTOR is set
When supplying logical touch coordinates to the slint::Window, scale
them to the logical screen size, not the physical one.
2023-10-09 16:47:37 +02:00
Simon Hausmann
b31d6c464a linuxkms: Add support for motion pointer events with absolute coordinates
When using qemu we receive these, for example.
2023-10-09 12:12:04 +02:00
Simon Hausmann
186c3ef3cb Simplify filter/map expression
Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2023-10-07 11:26:17 +02:00
Simon Hausmann
b6b3dfc9c0 linuxkms: Prospective fix for failing crtc setup
If the chosen connector doesn't have a current encoder (who's crtc we could use), fall back to the algorithm described in

    https://manpages.debian.org/testing/libdrm-dev/drm-kms.7.en.html#CRTC/Encoder_Selection

for selecting the crtc (minus the usage check, since we drive only one connector).
This is also the same logic as in kmscube.
2023-10-07 11:26:17 +02:00
Simon Hausmann
3a56bcd2a4 Fix build of linuxkms backend on Yocto
We enable libseat's custom_logger feature by default, which redirects
log output from libseat into the Rust log facade. That's nice, but as
part of the implementation of this feature unfortunately libseat's
build.rs unconditionally adds /usr/local/include to the list of the
search include paths when compiling the log_handler.c file. That breaks
the Yocto build, rightly so:

warning: cc1: error: include location "/usr/local/include" is unsafe for cross-compilation [-Werror=poison-system-directories]

We can do without this feature, so let's not enable it.
2023-10-04 22:17:02 +02:00
Tobias Hunger
85e1c6020b janitor: Use workspace dependnecies for the slint crates
This moves most of the version information we need to update into one
place.

Note that the workplace dependency features are in *addition* to any
feature set when using the workspace dependency. So we have all
workspace dependencies defined with `no-default-features = true`.
2023-09-25 16:34:16 +02:00
Tobias Hunger
d6695c55cb Janitor: Use cargo workspace package data more 2023-09-25 16:34:16 +02:00
tronical
b8b9db4e42 Bump version number to 1.3.0 2023-09-05 15:46:36 +02:00
Olivier Goffart
95b6eda10b Make sure PLatformError is Send+Sync as it is needed for anyhow 2023-08-31 20:52:10 +02:00
Olivier Goffart
4ad5b1f6d6 Remove the pin of nix 0.26.2 since nix 0.26.4 was released 2023-08-29 18:42:30 +02:00
Simon Hausmann
65f9e6f1eb Move the OpenGLInterface back to the FemtoVG renderer
At the moment it's only needed there, so let's
have it there and move it to core later if the need arises.
2023-08-28 13:33:15 +02:00
Olivier Goffart
93a8f604a8 linuxkms: update dependencies 2023-08-28 12:04:34 +02:00
Olivier Goffart
541e7137c6
Backends: don't resize the WindowItem in set_visible
We already query the size right after the call to set_visible in the
WindowInner::show()
2023-08-24 13:15:28 +02:00
Simon Hausmann
96d7bb132c reuse: remove glob for markdown files
Instead, place the copyright and license right into the source.

To satisfy reuse, this also removes the unnecessary MIT.txt
symlinks.
2023-08-17 08:55:28 +02:00
Tobias Hunger
09d3eaf00a Update license symlinks
run `cargo xtask check_reuse_compliance --fix-symlinks`
2023-08-16 11:46:15 +02:00
Simon Hausmann
203a5ed431 linuxkms: Tweak mouse cursor appearance
- Fix the viewbox so that cursor isn't squashed but appears in the
  correct ratio.
- Add a ~2 pixel wide white stroke around it, so that it's easier to see
  on dark background.
2023-07-31 20:11:15 +02:00
Olivier Goffart
f5caafd379 linuxkms: Implement support for SLINT_SCALE_FACTOR 2023-07-31 19:35:17 +02:00
Olivier Goffart
ad389aa4eb linuxkms: Implement keyboard input and clamp mouse
Unfortunately, this is currently not mapped to the right keyboard layout

Also keep the mouse clamped in the visible area.
And make it start in the middle of the screen.
2023-07-31 17:27:53 +02:00
Simon Hausmann
23ca0cb36c Disambiguate Render trait type name
Use FullscreenRenderer as name for the trait used in the linuxkms backend
2023-07-31 17:11:43 +02:00
Simon Hausmann
d96d37ea4b Fix linuxkms on i915
Adding a framebuffer with the given modifiers fails for some reason. Forcing
the gbm surface to linear is one workaround, but instead
let's use the old API without modifiers but still planar support.

This also removes the dependency to drm-ffi again, which was missing from renderer-femtovg.
2023-07-31 13:47:23 +02:00
Simon Hausmann
6b044ae078 Rename extension trait to use Ext as suffix 2023-07-31 13:06:28 +02:00
Simon Hausmann
84ddfc6c2f Add support for rendering the mouse cursor with linuxkms
The cursor is loaded by the window adapter from the cache. When it's
loaded the first time, its format will be Svg, so we convert it to a
pixel buffer. That way the skia backend can convert it on first draw
into a skia_safe::Image and replace the cache entry with the backend
storage variant.
2023-07-31 13:06:28 +02:00
Simon Hausmann
4b2eacd024 Fix build
Amends 717a3d9729
2023-07-31 12:46:58 +02:00
Simon Hausmann
717a3d9729 linuxkms: Add support for planar framebuffers and DRM modifiers 2023-07-31 12:07:33 +02:00
Simon Hausmann
fee44f3f7d Add basic support for libseat
This is not dynamic unfortunately, but at least it forwards device access for OpenGL and remove the need to run it as root.
2023-07-28 13:40:37 +02:00
Simon Hausmann
36eaad96ad Add support for terminating the app via ctrl+alt+backspace and ctrl+alt+delete 2023-07-28 13:40:37 +02:00
Simon Hausmann
bf57b32898 Clean up the order of function calls in the event loop
Use the common order of timer update, render, sleep.

This should be equivalent to the previous code.
2023-07-28 13:40:37 +02:00
Simon Hausmann
797de6c6d6 Fix rendering of animations without user input
Update timers before rendering, so that the state is correct.
2023-07-28 13:40:37 +02:00
Simon Hausmann
4991278a2b Improve error propagation when opening DRM devices fails
Print the last error
2023-07-28 13:40:37 +02:00
Luke D. Jones
b907b8f904 linuxkms: iterate over DRI files to find correct device 2023-07-28 13:40:37 +02:00
Simon Hausmann
e40f6c253e linuxkms: Add support for FemtoVG as renderer 2023-07-28 13:40:37 +02:00
Simon Hausmann
236d6ec183 Initial EGL implementation using gbm surfaces 2023-07-28 13:40:37 +02:00
Simon Hausmann
5c9eed62f1 Add a new backend that supports rendering fullscreen with Vulkan
This doesn't require a windowing system, just Linux and Vulkan drivers
that supports the display extensions.

It's called linuxkms as soon this will go beyond Vulkan and also support
EGL and perhaps dumb buffers for software rendering.
2023-07-28 13:40:37 +02:00