feat: report on-screen cursor position in producer contract

Append cursor_seq/cursor_visible/cursor_pos to the producer block
(host-RO ABI; offsets 168/172/176, existing layout unchanged). Position
is reported every pump tick, independent of draw_cursor, so a consumer
can overlay its own cursor even when the producer does not composite it.

x and y pack into one 8-aligned 64-bit field (single atomic store, no
tear); cursor_seq bumps last to gate a consistent read. Adds the
vgpu_publish_cursor() engine setter and a lightweight cursor_sample_pos()
(position/visibility only, no shape extract) called from the pump.
This commit is contained in:
2026-06-18 22:06:55 +03:00
parent 9f1b41cf78
commit 977c056287
6 changed files with 52 additions and 0 deletions
+6
View File
@@ -100,6 +100,12 @@ void vgpu_present_run(vgpu_ctx* ctx) {
last_beat = nowt;
}
/* --- cursor position: sensor data, reported every tick independent of
* draw_cursor / compositing (host may overlay it itself) --- */
cursor_sample_pos(ctx);
vgpu_publish_cursor(rv, (int32_t)ctx->cursor.x, (int32_t)ctx->cursor.y,
(uint32_t)(ctx->cursor.visible != 0));
/* --- reconcile control (gen-seqlock -> apply -> ack) --- */
vgpu_control_view cv;
uint32_t desired = prev_state;