Commit graph

422 commits

Author SHA1 Message Date
Victoria Brekenfeld
3935de018e kms: evdi cursor work around 2025-09-08 13:07:40 +02:00
Victoria Brekenfeld
b7fd4bc781 kms/device: Fix render_formats 2025-09-08 13:07:40 +02:00
Victoria Brekenfeld
18a1ba2d26 kms: Don't consider software devices for primary 2025-09-08 13:07:40 +02:00
Victoria Brekenfeld
6eb5ca1f94 kms: Close drm fds via session 2025-09-08 13:07:40 +02:00
Victoria Brekenfeld
cad5ed8945 kms: Don't attempt dmabuf import on software devices 2025-09-08 13:07:40 +02:00
Victoria Brekenfeld
70cd1842c1 kms/device: Don't advertise drm_node on software devices 2025-09-08 13:07:40 +02:00
Victoria Brekenfeld
a840b52930 chore: smithay update 2025-09-08 13:07:40 +02:00
Ian Douglas Scott
3f74a22cca kms/surface: Fix transform used for blits
Use the same logic used `submit_buffer`. This fixes corruption in OBS
when trying to capture a rotated output.
2025-09-02 17:12:37 +02:00
Ashley Wulber
bb8e066d6d feat(config): load cosmic-randr output Lists 2025-08-26 11:30:56 -04:00
Ashley Wulber
416b66b776 refactor(output config): move to config crate
this allows the greeter to easily sync to the user config
2025-08-26 11:30:56 -04:00
Ian Douglas Scott
905d021552 screencopy: Use send_success_when_ready for other forms of capture
A little annoying to add a `loop_handle` argument to `render_output`,
but generally straightforward.
2025-08-21 17:09:49 +02:00
Ian Douglas Scott
10c05bc1d4 kms/surface: Don't send screencopysuccess() until sync point is reached 2025-08-21 17:09:49 +02:00
Ian Douglas Scott
28e9024681 kms/surface: Define a PendingImageCopyData, instead of using tuple
Adding anything else to this tuple is awkward; defining a simple struct
makes this cleaner.

This also adds a `sync` property, which will come in handy later.
Containing simply the same-named argument that was passed to
`submit_buffer`.
2025-08-21 17:09:49 +02:00
Ian Douglas Scott
f0e0084608 Update smithay, and adjust to use sync points from blit calls 2025-08-21 17:09:49 +02:00
Vukašin Vojinović
7f7ab8bcbe chore: Rust 2024 edition
Set the formatting style to 2021 edition to avoid disrupting existing work.
Remove when possible.
2025-08-21 13:10:11 +02:00
Victoria Brekenfeld
310cf212eb kms/device: Don't reconfigure existing outputs on connector_added 2025-08-20 19:41:43 +02:00
Ian Douglas Scott
2fbf0081ea Fix compile warnings on nightly
Should fix CI test.
2025-08-12 18:03:27 -04:00
Ian Douglas Scott
4031f584ef Don't crash if GreeterAccessibilityState::config() fails
`cosmic-comp` should run without needing the greeter to be running (or
installed).
2025-08-12 18:03:27 -04:00
Ashley Wulber
b3a67bca50 feat: sync state with greeter 2025-08-12 12:51:54 -04:00
Victoria Brekenfeld
74e90f793f state/lid-inhibit: Take current lid state into account 2025-08-11 18:47:57 +02:00
Victoria Brekenfeld
cb2289e7b1 kms: Don't reload outputs for every single event 2025-08-11 18:47:57 +02:00
Victoria Brekenfeld
6897f81984 kms/device: Don't re-enumerate disabled outputs 2025-08-11 18:47:57 +02:00
Christian Duvholt
1db1d8149b output_configuration: Set wlr_output_head serial number 2025-08-11 13:59:42 +02:00
Victoria Brekenfeld
680542e4e2 kms/surface: Don't attempt to use overlay planes during animations 2025-08-07 19:40:23 +02:00
Victoria Brekenfeld
66712009fb kms/surface: Only skip cursor updates if the application renders consistently 2025-08-07 19:40:23 +02:00
Victoria Brekenfeld
a2dda33abe kms: Add min_vrr refresh rate safety margin 2025-08-07 19:40:23 +02:00
Victoria Brekenfeld
be1424f1ca render/wayland: filter scanout candidates by frametime estimation 2025-08-07 19:40:23 +02:00
Victoria Brekenfeld
db9380e6db kms: Fix direct scanout due to wrong node compare 2025-08-07 19:40:23 +02:00
Victoria Brekenfeld
7948a97334 kms/surface: Remove old feedback on node-removal 2025-08-04 17:11:22 +02:00
Victoria Brekenfeld
a409770df7 kms: Correctly handle the source node not being initialized 2025-07-31 19:12:10 +02:00
Victoria Brekenfeld
c688786d42 kms/device: Cleanup unused code 2025-07-28 17:46:46 +02:00
Victoria Brekenfeld
fd85e4ea56 kms: Don't incorrectly re-use iterator in update_surface_nodes 2025-07-28 17:46:46 +02:00
Victoria Brekenfeld
6492629f90 kms: Change awkward new trait to InnerDevice 2025-07-25 17:51:01 +02:00
Victoria Brekenfeld
87742c1e0c kms: Don't commit anything before updating the mode 2025-07-25 17:51:01 +02:00
Victoria Brekenfeld
e34a289c01 kms: lock during screen conf changes 2025-07-25 17:51:01 +02:00
Victoria Brekenfeld
bb7a6a7113 chore: smithay update 2025-07-25 17:51:01 +02:00
Victoria Brekenfeld
adedb705e7 shell: handle fullscreen windows on a dedicated layer
I hoped to split this up into multiple commits, but the api
changes to `shell/workspace.rs` were to invasive to feasibly do this.

Here is a rough list of changes:

- Fullscreen windows aren't mapped to other layers anymore
  - This they need their own logic for:
    - Sending frames
    - Dmabuf Feedback
    - Primary outputs
    - On commit handlers
    - cursor tests
  - They get their own unmap/remap logic
  - They get a new restore state similar to minimized windows
    - Refactored the minimized window state to reuse as much as possible
      here
  - They need to be part of focus stacks, which means adjusting them
    to a new type `FocusTarget` as they previously only handled
    `CosmicMapped`.
  - Various shell handlers (minimize, move, menu) now have dedicated
    logic for fullscreen surfaces
    - This was partially necessary due to relying on CosmicSurface now,
      partially because they should've had their own logic from the
      start. E.g. the context menu is now reflecting the fullscreen
      state
- Fullscreen windows may be rendered behind other windows now, when they
  loose focus.
  - This needed changes to input handling / rendering
2025-07-04 19:45:54 +02:00
Ian Douglas Scott
8ef6c161a0 screencopy: Fix damage tracking bug with shm screencopy of output
Similar to the change in https://github.com/pop-os/cosmic-comp/pull/780,
but also updates it to be a little clearer than just an uncommented `age
= 0` line.

Ideally we want some robust system to re-use the offscreen buffer (but
not allocate more buffers indefinitely if the client doesn't capture
with the same `wl_buffer`).
2025-07-03 23:36:13 +02:00
Ian Douglas Scott
e5fbf21fee Remove debug prints that probably shouldn't have been merged
Also add a comment to the one place `eprintln!` is used to explain why
it's appropriate.
2025-07-03 14:25:49 +02:00
Ian Douglas Scott
1844afde09 kms: Do not attempt to import dmabuf on device not supporting format
Previously, if `expected_node` couldn't import a buffer, it would print
an error, then try the next node. There shouldn't really be a reason to
attempt import if the format/modifier isn't in `dmabuf_texture_formats`.

It seems the issue I've been seeing with cosmic-workspaces crashing
the Nvidia driver is fixed by removing this, and disabling `dma_shadow_copy`
(which was producing the same error). Importing Nvidia buffers on the AMD
GPU seems to be causing issues.

Not sure how `dma_shadow_copy` should be fixed, but a test for supported
formats is easy to add here anyway.
2025-07-01 11:32:28 -07:00
Ian Douglas Scott
614d99fc05 Update smithay, egui, and smithay-egui 2025-06-25 20:32:53 +02:00
Ian Douglas Scott
fa4bffdbe6 Add cursor_image_status/set_cursor_image_status to SeatExt
The `cursor_image_status()` function saves some duplication in various
places. The `set_cursor_image_status()` saves a bit less, but is also
handy.
2025-06-10 19:24:05 +02:00
Ian Douglas Scott
b823dd4247 kms/surface: Split off part of redraw into take_screencopy_frames 2025-06-10 16:01:04 +02:00
Ian Douglas Scott
e80e46e911 kms/surface: Update how errors in send_screencopy_result are handled
Previously, some errors in the screencopy code resulted in `redraw`
returning an error, while others make the screencopy frame fail, and
logged a warning.

Instead, make all errors here log a warning, and call `reset()` on the
session, but continue running `redraw()`.

Calling `frame.error` explictly isn't needed, since the same error will
be sent on drop otherwise.
2025-06-10 16:01:04 +02:00
Ian Douglas Scott
ca817e2579 kms/surface: Split off part of redraw into postprocess_elements 2025-06-10 16:01:04 +02:00
Ian Douglas Scott
39b1ac2955 kms/surface: Split off part of redraw into a send_screencopy_result
This should not change behavior in any way.
2025-06-10 16:01:04 +02:00
Ian Douglas Scott
f86cd933d4 kms/surface: Call cleanup_texture_cache for each device at end of draw
Fixes an issue where a dual GPU system would keep allocating dGPU PBOs in
`cpu_copy()` every frame, but `cleanup()` was not being called, since the
surface thread for the builtin output was rendered on the
primary/integrated GPU, targeting the same GPU.

Even if a different monitor was compositing on the dGPU, That wouldn't
help since that thread has it's own `GpuManager` with it's own renderer
and cache.

Running cleanup at the end (or start) of each frame seems like a good
idea. Not sure if it would be best to avoid additional calls, or if
that's desirable/fine.
2025-06-02 18:58:49 +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
3d3a566a3c kms: Always send frame callbacks 2025-05-27 20:00:21 +02:00