Commit graph

35 commits

Author SHA1 Message Date
Ian Douglas Scott
614d99fc05 Update smithay, egui, and smithay-egui 2025-06-25 20:32:53 +02:00
Ian Douglas Scott
619e994955 kms: Fix inconsistent selection of primary GPU
Instead of choosing a primary GPU the first time `device_added` is
called (and then not updating it on the next call, even if that should
be the primary GPU), set the primary GPU only after all devices have
been initially added, and on future changes.

Alternately, the `was_empty` test can just be removed, but it's probably
best not to select the primary GPU multiple times each time the
compositor starts on a multi-GPU system.

Fixes https://github.com/pop-os/cosmic-comp/issues/1437.
2025-06-02 12:22:13 +02:00
Victoria Brekenfeld
359c3ad899 kms: Various gpu removal fixes
- Remove gpu from `kms_state.api` as well
- Don't use `from_node_id` on device removal
- Free resources asap via `refresh_used_devices`
2025-05-27 20:00:21 +02:00
Victoria Brekenfeld
465813c1c5 shell: Using parking_lot's RwLock for fairness guarantees 2025-05-27 20:00:21 +02:00
Victoria Brekenfeld
8194be30c6 kms: Allow updating the primary node
Add more sophisticated code to handle the primary node disappearing.

Also overhaul the selection logic to respect our allow/deny-list and
prefer devices with built-in connectors before using the boot gpu.

This will also allow triggering a primary node switch at runtime
for debugging purposes in the future.
2025-05-27 20:00:21 +02:00
Victoria Brekenfeld
913ed90b04 kms: Add allow/deny-listing of drm devices 2025-05-27 20:00:21 +02:00
Ian Douglas Scott
194d5c8967 protocols/screencopy: Make frame/session send stopped/fail on drop
Previously, `Frame` was stored in KMS frame udata, but in some cases the
udata was dropped without a capture happening, and `Frame` did not
implement `Drop`, so `fail` was never sent.

Instead, rename `DropableFrame` to `Frame` and `Frame` to `FrameRef`, so
we can have a single instance of `Frame`, that will send `fail` on drop.
This guarantees either `.success` or `.fail` are send, as long as its
not leaked.

This seems to fix https://github.com/pop-os/cosmic-comp/issues/1305.
xdg-desktop-portal-cosmic prints an error, buy retries (as it should for
an `Unknown` error; though maybe there should be a retry limit) and the
session continues working.

(Not sure if it should be sending `failed`, or queing it with the next
frame so it can send `success` to the client, but this works and is
desirable as a failsafe anyway.)

`Session` and `CursorSession` are similiarly updated.

`.fail()`, `.success()`, and `.stop()` now consume
`Frame`/`Session`/`CursorSession`. So to stop a session, it is now
necessary to call `.remove_session()`, but then simply dropping with
send `.stop()`.

Factoring out some `Request::Capture` handling into a `capture_frame`
function seems to clean up error handling and such a bit.
2025-05-19 16:53:46 -07:00
Ian Douglas Scott
d7b37cfde5 Update smithay
Updates to use `GbmFramebufferExporter`.
2025-04-29 14:42:07 +02:00
Victoria Brekenfeld
d1e0e28d3c kms: Add tracy profiling 2025-04-28 18:03:09 +02:00
Ian Douglas Scott
e74eafce2c Add EdidProduct, as user data for kms Outputs
This is the same as `libdisplay_info::edid::VendorProduct`, but with
implementations for `Serialize`, `Eq`, etc.
2025-04-02 13:40:56 +02:00
Victoria Brekenfeld
7929e25966 kms: Support screen filters 2025-03-24 19:10:52 +01:00
Victoria Brekenfeld
605bb63a4d kms: Don't try to render inactive outputs 2025-01-21 13:35:53 +01:00
Victoria Brekenfeld
870e5be2a6 kms: Use scaled sizes for placing new outputs 2025-01-06 20:23:05 +01:00
Victoria Brekenfeld
bebd7c5c40 kms: Cleanup now that output_elements won't panic for uninitialized outputs 2025-01-06 20:23:05 +01:00
Victoria Brekenfeld
6be5009b37 kms: Allow diverging primary plane formats under certain conditions 2025-01-06 20:23:05 +01:00
Victoria Brekenfeld
adcb81bbe0 deps: Switch from edid-rs to libdisplay-info 2025-01-06 20:23:05 +01:00
Victoria Brekenfeld
546966bf15 drm_lease: Disable overlay planes when active 2025-01-06 20:23:05 +01:00
Victoria Brekenfeld
8b87d6524e kms: Use new DrmOutput api 2025-01-06 20:23:05 +01:00
Victoria Brekenfeld
81b9fb179b output-configuration: Support cosmic-ext v2 2024-11-27 09:37:01 +01:00
Victoria Brekenfeld
dbb51e827d kms: Fix enabling outputs 2024-11-27 09:37:01 +01:00
Ian Douglas Scott
61692b21ad Run cargo format 2024-11-18 18:24:53 +01:00
Victoria Brekenfeld
5207453157 kms: Don't substract for mirrored outputs 2024-10-25 10:42:38 +02:00
Ian Douglas Scott
15a6425836
Set default output transform based on DRM panel orientation (#901) 2024-10-07 18:12:40 +02:00
Jeremy Soller
a3c81119e8 Use fallback scale if size is invalid 2024-08-16 06:59:51 -06:00
Victoria Brekenfeld
8d2cc05f03
kms: Try to calculate dpi and scale factor (Take 2)
Co-authored-by: Jeremy Soller <jackpot51@gmail.com>
2024-08-15 15:10:40 -06:00
Victoria Brekenfeld
2cef99ae78 Revert "kms: Try to calculate dpi and scale factor"
This reverts commit 607bd71aeb.
2024-08-01 23:38:11 +02:00
Victoria Brekenfeld
607bd71aeb kms: Try to calculate dpi and scale factor 2024-07-31 13:02:08 +02:00
Victoria Brekenfeld
8971d8f430 kms: Fix previous commit.. 2024-07-26 14:07:21 +02:00
Victoria Brekenfeld
64e03d11d7 kms: Fix potential panic when enumerating connectors 2024-07-26 14:00:16 +02:00
Victoria Brekenfeld
26ccb653b7 output: Store position as u32 and offset bad configs 2024-06-27 12:34:51 +02:00
Victoria Brekenfeld
76fca0c591 chore: Fix smithay version 2024-06-26 16:18:08 +02:00
Victoria Brekenfeld
977ad674e5 kms: Fix initial output placement 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
12fab6e220 kms: Don't block surface-threads on startup cond 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
92f3dbce01 chore: Cleanup 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
469a366207 kms: New backend
New backend utilizing a thread per surface for precise frame
scheduling.
2024-06-26 12:59:33 +02:00