From 33121ece4d88ca92fde4d0a3186ed9d272f6fcb2 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Wed, 22 Jul 2026 19:08:59 +0200 Subject: [PATCH] =?UTF-8?q?chore(kwin-composite):=20TEMP=20blend-path=20pr?= =?UTF-8?q?obes=20=E2=80=94=20DROP=20BEFORE=20MERGE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rate-limited journal logging bracketing the silent segment of the Linux composite path: what overlay (if any) the encode loop's composite arm hands the encoder, and whether the NVENC cursor-blend kernel launches and with what geometry. On-glass (KWin leg) the blend module loads yet the composite cursor stays invisible — these two probes attribute it to no-overlay / stripped-en-route / kernel-draws-nothing. The module-loaded INFO line is permanent (success must be as attributable as failure); everything else in this commit is temporary. Co-Authored-By: Claude Fable 5 --- crates/pf-encode/src/enc/linux/nvenc_cuda.rs | 29 +++++++++++++++++++- crates/punktfunk-host/src/native/stream.rs | 28 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/crates/pf-encode/src/enc/linux/nvenc_cuda.rs b/crates/pf-encode/src/enc/linux/nvenc_cuda.rs index 572c7faf..38bbfed1 100644 --- a/crates/pf-encode/src/enc/linux/nvenc_cuda.rs +++ b/crates/pf-encode/src/enc/linux/nvenc_cuda.rs @@ -1415,7 +1415,12 @@ impl Encoder for NvencCudaEncoder { if !self.cursor_tried { self.cursor_tried = true; match cuda::CursorBlend::new(CURSOR_PTX) { - Ok(cb) => self.cursor = Some(cb), + Ok(cb) => { + // Success is as diagnosis-critical as failure: a silent no-cursor session + // must be attributable to "overlay never arrived", not "module never said". + tracing::info!("NVENC (Linux): cursor blend module loaded"); + self.cursor = Some(cb); + } Err(e) => tracing::warn!( error = %format!("{e:#}"), "NVENC (Linux): cursor blend module load failed — cursor not composited" @@ -1465,6 +1470,28 @@ impl Encoder for NvencCudaEncoder { } } else { self.cursor_blend_warned = false; + // TEMP KWin composite probe (DROP BEFORE MERGE): prove the blend launches and + // with what geometry — the on-glass symptom is a loaded module and a silent, + // invisible cursor. + { + use std::sync::atomic::{AtomicU64, Ordering as ProbeOrd}; + static PROBE_BLEND: AtomicU64 = AtomicU64::new(0); + let n = PROBE_BLEND.fetch_add(1, ProbeOrd::Relaxed) + 1; + if n == 1 || n % 512 == 0 { + tracing::info!( + n, + fmt = ?self.buffer_fmt, + ov_x = ov.x, + ov_y = ov.y, + ov_w = ov.w, + ov_h = ov.h, + surf_w = w, + surf_h = h, + visible = ov.visible, + "cursor blend probe: kernel launched" + ); + } + } } } } diff --git a/crates/punktfunk-host/src/native/stream.rs b/crates/punktfunk-host/src/native/stream.rs index 774e2789..a7c059c9 100644 --- a/crates/punktfunk-host/src/native/stream.rs +++ b/crates/punktfunk-host/src/native/stream.rs @@ -2077,6 +2077,34 @@ pub(super) fn virtual_stream(ctx: SessionContext, prepared: Option tracing::info!( + n, + x = c.x, + y = c.y, + w = c.w, + h = c.h, + visible = c.visible, + serial = c.serial, + "composite probe: overlay riding to the encoder" + ), + None => tracing::info!( + n, + "composite probe: NO overlay on the frame (capturer.cursor() None \ + and no frame-attached overlay)" + ), + } + } + } } } // The overlay surfaces hidden pointers too (for the hint above) — strip them