Watch
1
0
Fork
You've already forked smithay
0
Commit graph

4,161 commits

Author SHA1 Message Date
Fimeg
f3b4a24060 readme: correct the fork boundary 2026-08-24 14:04:46 -04:00
Fimeg
2e2dfc3023 project the tested ref onto the public forge
Fast-forward checked before the push, exact SHA read back after. Gitea is the
only thing that publishes.
2026-08-23 20:54:14 -04:00
Fimeg
73a3bea958 take instead of drain-collect, twice
clippy's drain_collect fires under -D warnings on a newer toolchain than
upstream pins. Two lines, same semantics.
2026-08-23 20:40:39 -04:00
Fimeg
53c6f45be8 rustfmt the fork's own patches
The gate runs cargo fmt --check and the five patches were not formatted to
upstream's style.
2026-08-23 20:20:52 -04:00
Fimeg
dbb6cf132f run the public gate on the ordinary runner class
builder was a placeholder invented to keep an internal host name out of a
public tree, and nothing serves it. The workflow now declares the toolchain and
upstream's own dependency list for test_all_features, so the build contract is
in the file rather than on one machine.
2026-08-23 18:00:05 -04:00
Fimeg
20ddbd0a85 review the one commit the gate flags
The mechanism install carries the scanner's own rule definitions; a gate cannot
enter a repository it protects without its patterns appearing in that diff. The
tree is exempted by manifest, the commit is reviewed here.
2026-08-23 17:49:04 -04:00
Fimeg
aeb3c9765d install the publication mechanism, pinned
The gate travels with the repository because this installation cannot read a
reusable workflow from a private repo. The pin makes drift a hard stop rather
than a silent change in what "checked" means.
2026-08-23 17:48:07 -04:00
Fimeg
9945db160c ci: one gate that validates the five patches
Upstream checks with test_all_features and the patches live in the paths that
flag compiles, so the fork borrows that choice rather than inventing one.
Anvil, Smallvil and the cache dance stay upstream's problem.
2026-08-23 11:56:55 -04:00
Fimeg
227c7e4338 readme: say why this fork exists
Five patches on a named upstream base, each with the failure it fixes. A
reader should not have to diff 4000 commits to find 332 lines.
2026-08-23 11:43:47 -04:00
Fimeg
257088ad13 gles: optional chromatic split on sampled textures
Red sampled ahead of the fragment and blue behind it, green and alpha left
alone, so an edge fringes red and cyan while the geometry stays put. Off is
`None` and costs a scalar compare.

Behind a CHROMATIC define rather than a bare uniform like the gamut transform:
this adds two dependent fetches and freedreno is the one compiler CI cannot ask.
A driver that refuses it links the variant without the block, GetUniformLocation
answers -1, and the writes are silently dropped — plain glass instead of no
compositor. supports_chromatic_split() reports which happened, so a caller can
refuse rather than set a look and watch nothing move.
2026-08-15 20:57:13 -04:00
Fimeg
fee1d429e6 drm/compositor: wait when there is no native fence
build_planes already documented this: with no exportable fence, or a surface
that cannot fence at all, the sync point has to be waited on. It never was, so
the atomic commit raced the renderer into the scan-out buffer. Tears on
simpledrm + llvmpipe, where supports_fencing is false and nothing held the flip.
2026-08-10 15:36:19 +00:00
Fimeg
25ef078b32 gles: optional linear-space gamut transform on sampled textures
The transform rides on a uniform rather than a shader variant, so an
unmanaged draw takes no colour arithmetic at all and stays byte-through.
Un-premultiplies around the sRGB transfer functions: a 3x3 commutes with
the alpha scalar, the transfer curve does not, so decoding premultiplied
values shifts hue at every alpha but 1.
2026-08-07 00:07:42 -04:00
Fimeg
56042fd48b session-lock: tolerate a bufferless commit before the first ack
Qt commits a window surface once while setting it up - the xdg-shell
habit of committing empty to solicit a configure - on a protocol that
configures on bind instead. That commit carries no buffer, so it puts no
content on a locked screen, but the check kills the client for it. On a
phone that takes the lock screen down and locks the owner out.

A commit that actually attaches a buffer before acking is still refused,
which is the case the error exists for.

This is a leniency for a client that is out of spec, not a fix for a
compositor that was. The real fix belongs in Qt.
2026-08-02 17:50:13 +00:00
Fimeg
44cdc80825 wlr-layer-shell: do not validate a role the client already destroyed
Destroying zwlr_layer_surface_v1 and then committing the wl_surface with
a null buffer is how the protocol says to unmap a layer surface. The
pre-commit hook stays attached to the wl_surface, and at that commit the
pending LayerSurfaceCachedState no longer describes a live role, so the
size/anchor checks read defaults - width 0 with no anchors - and post
InvalidSize to the destroyed object. The client is killed for doing
exactly what it was told to do.

Seen with quickshell: it tore down its dock layer surface and was killed
mid-teardown, then crash-looped. The surface was well-formed throughout,
set_size(0, 119) with anchor bottom|left|right, configured and acked, so
the error named a defect it did not have.

Fork base: 812bd33259
2026-08-02 16:55:07 +00:00
alter
812bd33259 renderer: cgmath -> glam 2026-07-17 13:51:59 +02:00
Ian Douglas Scott
0feaa7854a ci: Deply docs using deploy-pages action
This new mechanism of deploying Github Pages does not require pushing to
a branch.
2026-07-17 13:40:44 +02:00
Victoria Brekenfeld
73a61f3862 ci: also clippy check smithay-drm-extras 2026-07-16 18:10:30 +02:00
Victoria Brekenfeld
78ddf9e5fa chore: clippy fixes 2026-07-16 18:10:30 +02:00
Andy Wright
d1da95126d backend/renderer/gles: free orphaned EGLImage on import_egl_image failure
`import_dmabuf` allocates an `EGLImage` with `create_image_from_dmabuf`, then
binds it to a texture with `import_egl_image`. When that bind returned an error,
the already-created `EGLImage` handle was dropped on the floor: no `GlesTexture`
ever owned it, so it was never freed, leaking the handle (and, on the proprietary
NVIDIA driver, the GPU allocation backing it). Free it directly with
`DestroyImageKHR`; the deferred-destruction queue is only needed by `Drop`
implementations that run without a current context.

Developed with AI assistance (Claude Code); all changes have been reviewed and
are understood by the author.
2026-07-16 17:44:46 +02:00
Andy Wright
4e8da00808 backend/renderer: free multigpu per-surface texture cache on surface destroy
The `MultiRenderer` caches imported client textures per surface in
`MultiTextureInternal` (kept in the surface `data_map`), holding the
`GlesTexture`s and their `EGLImage`s. Unlike `RendererSurfaceState`, it had no
destruction cleanup, so its textures outlived the surface — until the last
`WlSurface` reference dropped — leaking client buffers in GPU memory.

Add `clear_surface_textures` and call it from the surface destruction hook in
`on_commit_buffer_handler`, mirroring `RendererSurfaceState`'s cleanup.

Developed with AI assistance (Claude Code); all changes have been reviewed and
are understood by the author.
2026-07-16 17:44:46 +02:00
Andy Wright
e76b1eece5 renderer/gles: clamp accumulated shm damage to current buffer size
damage_since() unions damage across commits, each rect clamped only to
the buffer dimensions of its own commit. When a client shrinks its
buffer (e.g. a cursor surface re-rendered after a fractional-scale
change), stale larger rects reach TexSubImage2D, fail the whole upload
with GL_INVALID_VALUE and leave the previous texture contents visible.
Intersect each rect with the current buffer before uploading.

Developed with AI assistance (Claude Code); all changes have been reviewed and
are understood by the author.
2026-07-16 17:44:46 +02:00
Andy Wright
9479cd6c75 renderer/gles: free PBO on ExportMem error paths
copy_framebuffer and copy_texture allocate a PIXEL_PACK_BUFFER, then build the
owning GlesMapping (which frees the PBO on Drop) only on the NO_ERROR branch.
On any GL error the bare buffer handle was dropped, leaking a region-sized GPU
buffer on every failed readback. Free the buffer on the error branches, and
compute bpp before allocating it so an early return cannot leak it either.

Developed with AI assistance (Claude Code); all changes have been reviewed and
are understood by the author.
2026-07-16 17:44:46 +02:00
Andy Wright
3aa5ab7c4a allocator: cache exported Dmabuf/GbmFramebuffer in thread-safe UserData
`Slot::export` caches the exported `Dmabuf` in the slot's `UserDataMap` via the
non-thread-safe `insert_if_missing`, which stamps it with the creating thread's
id. `UserData::drop` runs the value's destructor only on that same thread and
otherwise deliberately leaks it (to avoid dropping possibly-`!Send` data on the
wrong thread).

A slot first exported on one thread but dropped on another therefore leaks the
cached `Dmabuf`: its `Arc` strong count is never decremented and the underlying
GBM buffer stays pinned for the process lifetime. In a multi-threaded compositor
this shows up as GPU memory growing steadily across output reconfigures.

`Dmabuf` is `Send + Sync`, so cache it with `insert_if_missing_threadsafe`. The
`GbmFramebuffer` caches in `GbmBufferedSurface` have the same defect (their
`Drop` calls `destroy_framebuffer`) and are fixed the same way.

Developed with AI assistance (Claude Code); all changes have been reviewed and
are understood by the author.
2026-07-16 17:44:46 +02:00
Felipe Machado
1623fab46e wayland: retain unknown linux-dmabuf flags
Signed-off-by: Felipe Machado <felipemmachado266@gmail.com>
2026-07-15 17:15:57 +02:00
Felipe Machado
f0907b0cb1 backend: expose dmabuf flags
Expose the stored DmabufFlags so compositors can apply their own buffer policy.

Signed-off-by: Felipe Machado <felipemmachado266@gmail.com>
2026-07-15 17:15:57 +02:00
Sven Over
e76f1af141 drm_scanner: release CRTC reservations for vanished connectors
`SimpleCrtcMapper` keeps a `connector -> crtc` reservation map and, on each `map()` call, releases the reservation of any connector it is told about that is no longer connected:

```rust
for connector in connectors
    .clone()
    .filter(|conn| conn.state() != connector::State::Connected)
{
    self.crtcs.remove(&connector.handle());
}
```

This only releases connectors that are still present in the resource list and reported as disconnected. A connector whose handle disappears from the resource list entirely is never passed to `map()` again, so its reservation is never released and leaks for the lifetime of the mapper.

This happens routinely with DP-MST: the sink connectors behind an MST hub are dynamically created and destroyed, so unplugging a USB-C/Thunderbolt dock — or suspending and resuming while docked, where the connectors are torn down and recreated under fresh handles while the compositor isn't scanning — makes the old handles vanish rather than transition to `Disconnected`. Each such event leaks one reservation per vanished connector. Because a leaked reservation still counts as "taken", the reservations accumulate across cycles until every CRTC is reserved by a ghost handle. At that point `pick_next_available_for_connector` can no longer find a free CRTC for a genuinely connected connector, so `crtc_for_connector` returns `None` for it and the compositor silently never brings up that output. The only recovery is recreating the `DrmScanner`.

This was observed in niri as external monitors on a dock going missing after a number of suspend/resume cycles, getting progressively more likely over time, and only recoverable by restarting the compositor.

Fix it by releasing the reservation of every connector that is not currently connected, including connectors that are no longer present at all. At the start of `map()`, collect the set of currently connected connector handles and retain only reservations whose handle is in that set. The previously handled case (a connector present but reported as disconnected) is still covered, since such a connector is excluded from the connected set.
2026-07-13 17:04:00 +02:00
Emeka Nkurumeh
f6d7e9dc65 anvil: perform cursor x and y movements separately 2026-07-13 17:02:43 +02:00
Hichem, Ben Fekih
2fab511f55 define Yuv420 and Nv12 formats
use case:
application can advertise to the wayland client that it supports
these formats. and can create shaders to convert dmabufs or
shared memory buffers into RGBA formats

Signed-off-by: Hichem, Ben Fekih <hichem.f@live.de>
2026-07-13 16:11:53 +02:00
Ian Douglas Scott
30bd06e028 Use const instead of hard-coded role string 2026-07-13 16:10:50 +02:00
Ian Douglas Scott
e99ca0c175 Fix clippy lints
`cargo +nightly clippy --fix`
2026-07-13 16:10:50 +02:00
Seirra
d60e661c97 fix compilation errors
don't think CI normally tries compiling these, which is why it might have not been noticed until now
2026-07-13 16:03:48 +02:00
Seirra
8e1dcd3f33 fix doc tests
makes sure tests come back fully successful
2026-07-13 15:50:54 +02:00
lama2923
ec0a5b25ba Add DriftWM to the list of Wayland compositors 2026-07-13 13:02:45 +02:00
Austin Shafer
3021f619e2 drm: check for EINVAL when dropping master 2026-07-08 22:03:15 +02:00
RipleyTom
858c4e8396 xwayland/xwm: Don't error when setting primary output if already set 2026-07-08 16:51:28 +02:00
RipleyTom
eea667102e xwayland/xwm: Fix missing WM_STATE update on Unmap 2026-07-08 16:06:56 +02:00
Victoria Brekenfeld
efeb59768e allocator/udmabuf: remove plane idx 2026-07-06 16:18:59 +02:00
Victoria Brekenfeld
cd0d9f2f91 gles: Disable unrelated scissor test for BlitFrame::blit_to 2026-07-06 16:05:41 +02:00
Victoria Brekenfeld
93bf3e8550 allocator: Add udmabuf 2026-07-06 12:49:02 +02:00
Victoria Brekenfeld
9b21b0ec4c cargo: bumb MSRV to 1.87 2026-07-06 12:49:02 +02:00
Ian Douglas Scott
b5040fdc87 dmabuf: Use Arc<OwnedFd> instead of PlaneRef
This workaround is no longer needed if we `Arc` the FD.
2026-07-06 12:46:28 +02:00
Ian Douglas Scott
4f34d456d9 wayland/dmabuf: Send Incomplete error if planes not consecutive
`zwp_linux_buffer_params_v1` specifies that planes should start at 0 and
be consecutive (but can be added out of order). Add a check for this,
and send a protocol error if it fails.
2026-07-06 12:46:28 +02:00
Ian Douglas Scott
82b574b78b dmabuf: Remove plane_idx argument of add_plane
Planes being added out of order seems to just be a quirk of the
linux-dmabuf-v1 protocol, so we can handle sorting there.
2026-07-06 12:46:28 +02:00
Ian Douglas Scott
f153f6088c Remove out-dated SAFETY comments
These functions now return `OwnedFd`, so the type already implies what
this comment says. There is not an unsafe call here.
2026-07-06 12:46:28 +02:00
Ian Douglas Scott
d5e3b4e232 fix(wayland/dmabuf): Use plane_idx provided by client
It seems this was ultimately ignoring the `plane_idx` and ordering based
on the order of calls? Presumably that is not correct.
2026-07-06 12:46:28 +02:00
Ian Douglas Scott
9e24d0e590 allocator/vulkan: Clone Arc<OwnedFd> instead of using dup 2026-07-06 12:46:28 +02:00
Ian Douglas Scott
ab7a3f1d0a dmabuf: Use Arc<OwnedFd>
This makes it possible for multiple `Dmabuf`s, or multiple planes of one
`Dmabuf`, to share an fd without having to `dup`.
2026-07-06 12:46:28 +02:00
MTSyntho
cb1eb2a3f4 Fix typo in layer_map_for_output documentation
Corrected a typo in the documentation comment. Saw it on docs.rs
2026-07-02 10:20:59 -07:00
Victoria Brekenfeld
8eb4076cad renderer/multigpu: Allow disabling cross-device dmabuf exports 2026-06-29 23:10:29 +02:00
Victoria Brekenfeld
457e6a8f18 gles: Early fail dmabuf binding for external formats 2026-06-29 16:43:16 +02:00