mirror of
https://dev.lirent.ru/Vatrog/vm-vgpu-streamer.git
synced 2026-07-09 01:46:38 +03:00
feat: add graphics-context sensors to producer contract
Append three host-readable sensor groups to the producer block, ABI
frozen by offset asserts (producer still fits page 0):
- cursor Tier-1 (hotspot, glyph dims, shape identity), published under
the existing cursor_seq gate
- content_change_ns: monotonic stamp of the last scene-content change
- display geometry on its own cache line under a geom_seq seqlock:
virtual-desktop bbox, captured-output origin, DPI, refresh
Source the cursor from each backend's existing grab metadata instead of
polling GetCursorInfo in the present pump: DDA from the duplication frame
info pointer position (no extra calls), NvFBC visibility from the grab
info plus one GetCursorInfo per frame for position, GDI from
GetCursorInfo. Position sampling now rides the frame rate, not the pump
tick.
Sample display geometry once at startup and re-sample only on backend
session recreate or a captured-mode change. Drop per-tick cursor
sampling (cursor_sample_pos) from the present loop.
Add src/stream/win32/geometry.{c,h}.
This commit is contained in:
@@ -60,4 +60,29 @@ void vgpu_publish_full_frame_ack(const vgpu_region_view* rv, uint32_t req);
|
||||
* field (single atomic store) and bumps cursor_seq last. */
|
||||
void vgpu_publish_cursor(const vgpu_region_view* rv, int32_t x, int32_t y, uint32_t visible);
|
||||
|
||||
/* Publish Tier-1 cursor shape data (host-RO), written under the same cursor_seq gate as
|
||||
* vgpu_publish_cursor: call this BEFORE vgpu_publish_cursor so the position publish bumps
|
||||
* cursor_seq last and gates the whole cursor line consistently. hot_x/hot_y are the glyph
|
||||
* hotspot; gw/gh are glyph dims; cursor_id is a VGPU_CURSOR_ID_* shape identity. */
|
||||
void vgpu_publish_cursor_shape(const vgpu_region_view* rv,
|
||||
uint32_t hot_x, uint32_t hot_y,
|
||||
uint32_t gw, uint32_t gh, uint32_t cursor_id);
|
||||
|
||||
/* Publish the monotonic timestamp (ns) of the last scene-content change. Single 8-aligned
|
||||
* atomic store (heartbeat pattern). The producer reports the raw stamp only; the host derives
|
||||
* "ms idle" by subtracting from its own clock — no behavioural distillation in the producer. */
|
||||
void vgpu_publish_content_change(const vgpu_region_view* rv, uint64_t change_ns);
|
||||
|
||||
/* Publish display geometry under the geom_seq seqlock (odd/even, like the frame seqlock).
|
||||
* Sampled rarely (session start + reactive resample on desc-size delta / backend recreate),
|
||||
* read by the host with bounded retry. virt_* is the virtual-desktop bbox (interprets negative
|
||||
* cursor_pos); cap_x/cap_y is the captured output's origin in virtual-desktop coords (the
|
||||
* captured surface SIZE comes from desc.width/height, not from here). dpi/refresh_mhz describe
|
||||
* the captured output (96=100% / milli-Hz; 0=unknown). */
|
||||
void vgpu_publish_geometry(const vgpu_region_view* rv,
|
||||
int32_t virt_x, int32_t virt_y,
|
||||
uint32_t virt_w, uint32_t virt_h,
|
||||
int32_t cap_x, int32_t cap_y,
|
||||
uint32_t dpi, uint32_t refresh_mhz);
|
||||
|
||||
#endif /* VGPU_STREAM_ENGINE_H */
|
||||
|
||||
Reference in New Issue
Block a user