Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial kmsdrm support [forked + updated] #2795

Closed
wants to merge 155 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
d691a3b
Initial kmsdrm support
StratusFearMe21 Apr 29, 2022
2f8537e
Add to CHANGELOG
StratusFearMe21 Apr 29, 2022
2d8d2a7
Update feature matrix
StratusFearMe21 Apr 29, 2022
e7ce9d1
Fix stupid warning
StratusFearMe21 Apr 29, 2022
1cb284e
Fix formatting
StratusFearMe21 Apr 29, 2022
664cbe9
Access to more pointers for future glutin creation in kmsdrm
StratusFearMe21 Apr 29, 2022
7439d33
Add kmsdrm to README
StratusFearMe21 Apr 29, 2022
d9ebd7d
Fix formatting
StratusFearMe21 Apr 29, 2022
9c26d72
Annotations on potentially expensive swap just in case
StratusFearMe21 Apr 29, 2022
f14691a
EventSink can just be a type annotation
StratusFearMe21 Apr 29, 2022
e03d0fe
Better error handling
StratusFearMe21 Apr 29, 2022
e8cee9c
Request redraw when event loop starts
StratusFearMe21 Apr 29, 2022
aea7680
Make Card and AssertSync structs public for OpenGL context creation
StratusFearMe21 Apr 29, 2022
28c70dc
Changes to support glutin
StratusFearMe21 May 3, 2022
889f71c
Fix formatting (again)
StratusFearMe21 May 3, 2022
4b6412b
GBM is indeed thread safe
StratusFearMe21 May 3, 2022
f92a16a
Update libraries
StratusFearMe21 May 3, 2022
3ad7724
Fix formatting
StratusFearMe21 May 3, 2022
84e6dea
Fix building issue
StratusFearMe21 May 3, 2022
eefdba5
Make Card Sync
StratusFearMe21 May 3, 2022
56f285e
Make Card Sync
StratusFearMe21 May 3, 2022
b5b7824
Find preferred mode
StratusFearMe21 May 3, 2022
3f16ac4
Oops, bitflags
StratusFearMe21 May 3, 2022
364451b
Fix naming
StratusFearMe21 May 3, 2022
2522bc7
Mirror X.org connector behavior with drm
StratusFearMe21 May 3, 2022
2bcc602
Mirror X.org connector behavior with drm
StratusFearMe21 May 3, 2022
2bcc990
Merge branch 'master' into master
StratusFearMe21 May 3, 2022
b8ac6db
Proper seat management with libseat
StratusFearMe21 May 3, 2022
8d067aa
Fix seat management
StratusFearMe21 May 3, 2022
6a8457d
Add fallback method to close window
StratusFearMe21 May 3, 2022
dda06ff
Pass drm plane to user
StratusFearMe21 May 3, 2022
85b2dee
Expose primary plane
StratusFearMe21 May 3, 2022
f7185cc
Attempt to fix modesetting
StratusFearMe21 May 3, 2022
465b9df
Attempt to fix modesetting
StratusFearMe21 May 3, 2022
d851d91
Attempt to fix modesetting
StratusFearMe21 May 3, 2022
fa697f9
Attempt to fix modesetting
StratusFearMe21 May 3, 2022
ec97e9a
Attempt to fix modesetting
StratusFearMe21 May 3, 2022
792fe86
Attempt to fix modesetting
StratusFearMe21 May 3, 2022
0840f02
Open drm through seat manager
StratusFearMe21 May 4, 2022
faccb7e
Open drm through seat manager
StratusFearMe21 May 4, 2022
e5655af
Safer seat handling
StratusFearMe21 May 4, 2022
2b18343
Fix mode selection
StratusFearMe21 May 4, 2022
9e03b4b
raw-window-handle has been merged
StratusFearMe21 May 4, 2022
6716677
Add key repeating
StratusFearMe21 May 4, 2022
6c4f3d5
Fix features
StratusFearMe21 May 5, 2022
3a13ea2
Optimize repeat keys
StratusFearMe21 May 5, 2022
66cbe82
Add beta RecievedChar
StratusFearMe21 May 5, 2022
a70ad32
Complete RecievedChar
StratusFearMe21 May 5, 2022
3769612
Bug
StratusFearMe21 May 5, 2022
f342586
Better RecievedChar impl
StratusFearMe21 May 5, 2022
e44819c
Better RecievedChar impl
StratusFearMe21 May 5, 2022
ffe9251
Better RecievedChar impl
StratusFearMe21 May 5, 2022
bf2fea0
Better RecievedChar impl
StratusFearMe21 May 5, 2022
0440c60
Better RecievedChar impl
StratusFearMe21 May 5, 2022
2427a4a
Fix github building
StratusFearMe21 May 5, 2022
c27fa3a
Fix keymap handling with xkbcommon
StratusFearMe21 May 5, 2022
f9458b0
Fix dependencies
StratusFearMe21 May 5, 2022
0c6fe1a
Fix xkb
StratusFearMe21 May 5, 2022
54b29a1
Fix xkb
StratusFearMe21 May 5, 2022
d752b51
Fix xkb
StratusFearMe21 May 5, 2022
ff6666b
Fix xkb
StratusFearMe21 May 5, 2022
7c95388
Add customizability support
StratusFearMe21 May 6, 2022
3889680
xkbcommon pointer fix
StratusFearMe21 May 6, 2022
9c78f8b
Add compose support
StratusFearMe21 May 6, 2022
acf190a
Add compose support
StratusFearMe21 May 6, 2022
675773b
Add compose support
StratusFearMe21 May 6, 2022
818b73c
Add compose support
StratusFearMe21 May 6, 2022
432de8a
Add compose support
StratusFearMe21 May 6, 2022
bcdd5a4
Add compose support
StratusFearMe21 May 6, 2022
4f487c6
Custom cursor rendering
StratusFearMe21 May 6, 2022
de25634
bad cursor rendering
StratusFearMe21 May 6, 2022
caaa188
Fix seat management
StratusFearMe21 May 6, 2022
53b15f8
Add GPU enumeration
StratusFearMe21 May 6, 2022
c3fb5ae
Clarify safety
StratusFearMe21 May 6, 2022
0b1123b
Add configurability
StratusFearMe21 May 6, 2022
fc023af
Optimize emumeration function
StratusFearMe21 May 6, 2022
a31c243
Proper error handling
StratusFearMe21 May 6, 2022
d8d67c1
Remove C Style comments
StratusFearMe21 May 9, 2022
bf41767
Change naming for kms
StratusFearMe21 May 9, 2022
5338ea1
Change naming for kms
StratusFearMe21 May 9, 2022
7a10528
Add seat-ext
StratusFearMe21 May 9, 2022
01bf89b
Merge branch 'master' into master
StratusFearMe21 May 9, 2022
1c6ce63
Fix merge
StratusFearMe21 May 9, 2022
97a68ae
Fix Card in unix backend
StratusFearMe21 May 9, 2022
f693f5a
Fix Window declaration
StratusFearMe21 May 9, 2022
6eb3afe
Fix cursor position setting
StratusFearMe21 May 9, 2022
67f564a
Fix cursor position setting
StratusFearMe21 May 9, 2022
b2d8023
Fix dangerous API change
StratusFearMe21 May 9, 2022
26ac529
Fix unclear docs
StratusFearMe21 May 9, 2022
fc63f29
Fix incorrect features
StratusFearMe21 May 9, 2022
28780a1
Fix docs capitalization
StratusFearMe21 May 9, 2022
d2d8d72
Fix error messages
StratusFearMe21 May 9, 2022
acdbec6
Fix error handling
StratusFearMe21 May 9, 2022
948261a
Fix unreadable closure
StratusFearMe21 May 9, 2022
787cd25
Fix code spacing
StratusFearMe21 May 9, 2022
5e5df64
Fix building
StratusFearMe21 May 9, 2022
756a1a0
Remove full paths
StratusFearMe21 May 9, 2022
901c819
Fix 'card0' default name
StratusFearMe21 May 9, 2022
6f6654d
Fix add atomic_req macro
StratusFearMe21 May 9, 2022
5d5d1e4
Add another macro
StratusFearMe21 May 9, 2022
d3f0998
Remove wrong comment
StratusFearMe21 May 9, 2022
3de7655
Add ability to change mode
StratusFearMe21 May 9, 2022
52a79c2
Adjust readability
StratusFearMe21 May 9, 2022
5a16458
Convert to plane function
StratusFearMe21 May 9, 2022
128724d
Fix calloop reexport
StratusFearMe21 May 9, 2022
d0e05fe
Fix calloop reexport
StratusFearMe21 May 9, 2022
491bfd0
Add public documentation
StratusFearMe21 May 9, 2022
a0cc057
Add public documentation
StratusFearMe21 May 9, 2022
2c75f5a
Fix modesetting
StratusFearMe21 May 10, 2022
f39d00b
Fix clippy on kms end
StratusFearMe21 May 10, 2022
285a715
Fix Add known XKB keysyms
StratusFearMe21 May 10, 2022
76aaea0
Fix formatting
StratusFearMe21 May 10, 2022
cfe89ae
Fix CI
StratusFearMe21 May 10, 2022
b5caf34
Fix CI
StratusFearMe21 May 10, 2022
cb1e893
Update README.md
StratusFearMe21 May 10, 2022
7e6dbda
Fix OsError creation
StratusFearMe21 May 10, 2022
4a52756
Merge branch 'master' of https://github.com/StratusFearMe21/winit
StratusFearMe21 May 10, 2022
046f1a0
Fix CI
StratusFearMe21 May 10, 2022
5359a00
Fix CI
StratusFearMe21 May 10, 2022
e3ade84
Fix CI
StratusFearMe21 May 10, 2022
a285658
Fix CI
StratusFearMe21 May 10, 2022
680be41
Fix CI
StratusFearMe21 May 10, 2022
a8727fa
Fix CI
StratusFearMe21 May 10, 2022
2f45711
Fix CI
StratusFearMe21 May 10, 2022
1cf79c2
Fix CI
StratusFearMe21 May 10, 2022
35d762d
Fix CI
StratusFearMe21 May 10, 2022
0bca540
Fix CI
StratusFearMe21 May 10, 2022
b86fdb1
Fix CI
StratusFearMe21 May 10, 2022
3db2879
Fix CI
StratusFearMe21 May 10, 2022
75d11a2
Fix CI
StratusFearMe21 May 10, 2022
03fe614
Fix CI
StratusFearMe21 May 10, 2022
f1e9669
Fix CI
StratusFearMe21 May 10, 2022
11a48f4
Fix CI
StratusFearMe21 May 10, 2022
c1711c7
Fix CI
StratusFearMe21 May 11, 2022
a5c2f70
Fix CI
StratusFearMe21 May 11, 2022
690b0fb
Fix CI
StratusFearMe21 May 11, 2022
dfac034
Fix CI
StratusFearMe21 May 11, 2022
af6a6ba
Fix CI
StratusFearMe21 May 11, 2022
161c8c9
Fix CI
StratusFearMe21 May 11, 2022
12d0058
Fix CI
StratusFearMe21 May 11, 2022
aa5041e
Fix CI
StratusFearMe21 May 11, 2022
9ee4d95
Fix code duplication
StratusFearMe21 May 11, 2022
10b4578
Merge remote-tracking branch 'root/master'
mraerino May 7, 2023
4a7b46e
Fixup feature attributes to use the alias
mraerino May 7, 2023
0c2223a
Fixup input handling
mraerino May 7, 2023
3de800e
Fix event source to adhere to event loop library
mraerino May 7, 2023
46d511d
Fix generation of window id
mraerino May 7, 2023
d1e2580
Fix monitor handle implementation
mraerino May 7, 2023
2f0ec0d
Fix raw window/display handle getters
mraerino May 7, 2023
c9712f4
Fix imports
mraerino May 7, 2023
3b0ccf2
Fix fullscreen methods
mraerino May 7, 2023
971a669
Implement missing window functions
mraerino May 7, 2023
31bf479
Fix argument pass
mraerino May 7, 2023
75105d4
Replace git dependency with released version
mraerino May 7, 2023
115bfe9
Add missing config attributes
mraerino May 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
components: rustfmt
- name: Check Formatting
run: cargo +stable fmt --all -- --check

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

cargo-deny:
name: cargo-deny

Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ And please only add new entries to the top of this list, right below the `# Unre

# Unreleased

- On Linux, initial support has been added for a DRM backend. This is a breaking change
- On Wayland, fix maximized startup not taking full size on GNOME.
- On Wayland, fix initial window size not restored for maximized/fullscreened on startup window.
- On Wayland, `Window::outer_size` now accounts for **client side** decorations.
Expand Down Expand Up @@ -965,4 +966,4 @@ _Yanked_
- Changed the X11 fullscreen code to use `xrandr` instead of `xxf86vm`.
- Fixed the Wayland backend to produce `Refresh` event after window creation.
- Changed the `Suspended` event to be outside of `WindowEvent`.
- Fixed the X11 backend sometimes reporting the wrong virtual key (#273).
- Fixed the X11 backend sometimes reporting the wrong virtual key (#273).
10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ wayland-csd-adwaita-crossfont = ["sctk-adwaita", "sctk-adwaita/crossfont"]
wayland-csd-adwaita-notitle = ["sctk-adwaita"]
android-native-activity = ["android-activity/native-activity"]
android-game-activity = ["android-activity/game-activity"]
kms = ["drm", "input", "xkbcommon", "udev", "parking_lot"]
kms-ext = ["libseat"]
Comment on lines +47 to +48
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it still necessary for split the feature into kms and kms-ext like this? I forget what the original rationale for this was.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kms-ext uses (libseat)[https://sr.ht/~kennylevinsen/seatd/].

Seat management takes care of mediating access to shared devices (graphics, input), without requiring the applications needing access to be root.

So this lib links/uses existing methods such as logind to create a user "seat" and allow access to various things. The lib is also a good intermediate step between winit and systemd-logind (plus others).

In our case this would allow anyone using this feature to run via TTY without requiring root. Standard kms here does require root access.

Unfortunately this feature is broken in this PR.

❯ cargo run --example window --no-default-features --features=kms-ext
   Compiling libseat-sys v0.1.7
   Compiling slog v2.7.0
   Compiling libseat v0.1.7
   Compiling winit v0.28.4 (/home/luke/Projects/winit-drm)
error: The platform you're compiling for is not supported by winit
  --> src/platform_impl/mod.rs:68:1
   |
68 | compile_error!("The platform you're compiling for is not supported by winit");


[build-dependencies]
cfg_aliases = "0.1.1"
Expand Down Expand Up @@ -115,14 +117,20 @@ wayland-backend = { version = "0.1.0", default_features = false, features = ["cl
wayland-protocols = { version = "0.30.0", features = [ "staging"], optional = true }
calloop = "0.10.5"
x11-dl = { version = "2.18.5", optional = true }
drm = { version = "0.6.2", optional = true }
input = { version = "0.7.1", optional = true }
libseat = { version = "0.1.4", optional = true }
udev = { version = "0.6.3", optional = true }
xkbcommon = { version = "0.5.0", optional = true }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth it to just use xkbcommon-dl instead, since that's what #2789 is using.

parking_lot = { version = "0.12.0", optional = true }

[target.'cfg(target_os = "redox")'.dependencies]
orbclient = { version = "0.3.42", default-features = false }
redox_syscall = "0.3"

[target.'cfg(target_family = "wasm")'.dependencies.web_sys]
package = "web-sys"
version = "0.3.22"
version = "0.3.57"
features = [
'console',
"AddEventListenerOptions",
Expand Down
3 changes: 2 additions & 1 deletion FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ be used to create both games and applications. It supports the following main gr
- Unix
- via X11
- via Wayland
- via KMS/DRM
- Redox OS, via Orbital
- Mobile
- iOS
Expand Down Expand Up @@ -244,4 +245,4 @@ Changes in the API that have been agreed upon but aren't implemented across all
[#721]: https://github.com/rust-windowing/winit/issues/721
[#750]: https://github.com/rust-windowing/winit/issues/750
[#804]: https://github.com/rust-windowing/winit/issues/804
[#812]: https://github.com/rust-windowing/winit/issues/812
[#812]: https://github.com/rust-windowing/winit/issues/812
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Winit provides the following features, which can be enabled in your `Cargo.toml`
* `serde`: Enables serialization/deserialization of certain types with [Serde](https://crates.io/crates/serde).
* `x11` (enabled by default): On Unix platform, compiles with the X11 backend
* `wayland` (enabled by default): On Unix platform, compiles with the Wayland backend
* `kms` (enabled by default): On Unix platform, compiles with the kmsdrm backend
* `mint`: Enables mint (math interoperability standard types) conversions.

### Platform-specific usage
Expand Down
1 change: 1 addition & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ fn main() {
// Native displays.
x11_platform: { all(feature = "x11", free_unix, not(wasm), not(redox)) },
wayland_platform: { all(feature = "wayland", free_unix, not(wasm), not(redox)) },
drm_platform: { all(feature = "kms", free_unix, not(wasm), not(redox)) },
orbital_platform: { redox },
}
}
Loading