chore(m2b): TEMP cursor-meta probe — DROP BEFORE MERGE

Rate-limited journal logging of SPA_META_Cursor arrival/absence, reported
id/position/bitmap offset, and bitmap acceptance — the Linux cursor
pipeline is otherwise blind end-to-end during Mutter RecordVirtual
metadata bring-up on .21.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-22 23:47:53 +02:00
co-authored by Claude Fable 5
parent 0619af391e
commit 151adc4bcc
+34
View File
@@ -1362,8 +1362,19 @@ mod pipewire {
// that SIGSEGVs inside the PipeWire `.process` callback (a segfault `catch_unwind` cannot // that SIGSEGVs inside the PipeWire `.process` callback (a segfault `catch_unwind` cannot
// catch). Every offset below is validated against `region_size` with checked arithmetic, // catch). Every offset below is validated against `region_size` with checked arithmetic,
// mirroring the fd-length guard the main frame path already applies to xdg-desktop-portal-wlr. // mirroring the fd-length guard the main frame path already applies to xdg-desktop-portal-wlr.
// TEMP M2b on-glass probe (DROP BEFORE MERGE): the journal must show whether the
// compositor delivers SPA_META_Cursor at all, what it reports, and whether a bitmap is
// ever accepted — the cursor pipeline is otherwise blind end-to-end. Statics are fine for
// the single bring-up stream; every log is rate-limited or edge-triggered.
use std::sync::atomic::{AtomicU64, Ordering as ProbeOrd};
static PROBE_NULL: AtomicU64 = AtomicU64::new(0);
static PROBE_META: AtomicU64 = AtomicU64::new(0);
let meta = unsafe { spa::sys::spa_buffer_find_meta(spa_buf, spa::sys::SPA_META_Cursor) }; let meta = unsafe { spa::sys::spa_buffer_find_meta(spa_buf, spa::sys::SPA_META_Cursor) };
if meta.is_null() { if meta.is_null() {
let n = PROBE_NULL.fetch_add(1, ProbeOrd::Relaxed) + 1;
if n.is_power_of_two() {
tracing::info!(n, "cursor meta probe: buffer carries NO SPA_META_Cursor");
}
return; return;
} }
// SAFETY: `meta` is non-null and points into the held buffer's metadata array. // SAFETY: `meta` is non-null and points into the held buffer's metadata array.
@@ -1383,6 +1394,21 @@ mod pipewire {
(*cur).bitmap_offset, (*cur).bitmap_offset,
) )
}; };
// TEMP M2b probe (see above): what the meta reports, every 64th + the first few.
let n = PROBE_META.fetch_add(1, ProbeOrd::Relaxed) + 1;
if n <= 4 || n % 64 == 1 {
tracing::info!(
n,
id,
pos_x,
pos_y,
hot_x,
hot_y,
bmp_off,
region_size,
"cursor meta probe: SPA_META_Cursor arrived"
);
}
if id == 0 { if id == 0 {
// Compositor reports no visible pointer (e.g. a game grabbed/hid it). // Compositor reports no visible pointer (e.g. a game grabbed/hid it).
cursor.visible = false; cursor.visible = false;
@@ -1461,6 +1487,14 @@ mod pipewire {
cursor.bw = bw; cursor.bw = bw;
cursor.bh = bh; cursor.bh = bh;
cursor.serial = cursor.serial.wrapping_add(1); cursor.serial = cursor.serial.wrapping_add(1);
// TEMP M2b probe (see above): bitmap accepted — once per shape change by construction.
tracing::info!(
bw,
bh,
vfmt,
serial = cursor.serial,
"cursor meta probe: bitmap cached"
);
} }
/// Destination channel byte offsets (R,G,B) and bytes-per-pixel for a packed-RGB `PixelFormat`, /// Destination channel byte offsets (R,G,B) and bytes-per-pixel for a packed-RGB `PixelFormat`,