summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_booter.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/gsp_phys_booter.h')
-rw-r--r--kernel/gsp_phys_booter.h72
1 files changed, 70 insertions, 2 deletions
diff --git a/kernel/gsp_phys_booter.h b/kernel/gsp_phys_booter.h
index 80beb54..6f4d1ea 100644
--- a/kernel/gsp_phys_booter.h
+++ b/kernel/gsp_phys_booter.h
@@ -164,6 +164,16 @@ int gsp_phys_backend_static_wait(struct gsp_phys_backend_static_config *out,
void gsp_phys_backend_static_invalidate(void);
/*
+ * Mode-35 KGR static-data snapshots (see gsp_phys_booter.c): the live GSP's
+ * replies to the real client's KGR query set, captured at backend boot and
+ * served byte-identically by the guest-side emulation. Returns 0 with
+ * *out_len set, -ENODATA when cmd was not captured for the current backend
+ * generation, -ENOSPC when the snapshot exceeds dst_len, -EAGAIN when the
+ * backend is not READY.
+ */
+int gsp_phys_kgr_snap_get(u32 cmd, void *dst, u32 dst_len, u32 *out_len);
+
+/*
* Run one fn1+fn65 probe on a READY backend to fill the static snapshot
* cache. Takes gsp_phys_rm_lock inside (via gsp_phys_rm_probe), so it must
* run on a work item, never inline under a caller-held rm lock or on the mdev
@@ -344,7 +354,13 @@ void gsp_phys_backend_relay_counters(u64 *requested, u64 *ok, u64 *verify_fail,
*/
#define GSP_PHYS_GR_MAX_PAGES 16u
#define GSP_PHYS_GR_MAX_INLINE 8u
-#define GSP_PHYS_GR_INLINE_BYTES 64u
+/*
+ * SESSION 153-CONTINUED-88: 256 -> 2048 (must stay equal to the sema
+ * service's SVC_GR_INLINE_BYTES and the bridge's GSP_BRIDGE_INLINE_BYTES -
+ * static_asserts enforce it). The GL window's real program uploads are
+ * 1536 B / 1408 B and must be carried whole to the engine-visible page.
+ */
+#define GSP_PHYS_GR_INLINE_BYTES 2048u
#define GSP_PHYS_GR_QMD_WORDS 64u
/*
* IQ2M sentinel: written to the inline-QMD destination's word 63 after the
@@ -358,7 +374,26 @@ void gsp_phys_backend_relay_counters(u64 *requested, u64 *ok, u64 *verify_fail,
#define GSP_PHYS_GR_QMD_SENTINEL 0xdeadbeefu
#define GSP_PHYS_GR_QMD_SENTINEL_WORD 63u
#define GSP_PHYS_GR_QMD_WORD_NONE 0xffffffffu
-#define GSP_PHYS_GR_RAW_WORDS 256u
+/*
+ * SESSION 153-CONTINUED-61: dedicated backend verdict for the 3D-window
+ * MISS-ABORT (gsp_phys_rmcall_gr_miss_abort): the launch was NOT submitted
+ * because a window/attr operand's page is still unresolved. The sema
+ * service uses this code to keep the captured candidate armed (re-arm)
+ * instead of consuming it with a software completion, so the forward path
+ * retries the same chunk once the pin demand resolves the page. -ENOMSG
+ * is returned by no other path on this interface.
+ */
+#define GSP_PHYS_GR_RC_MISSABORT (-ENOMSG)
+/*
+ * r929: grown 256 -> 512 dwords so a whole GL 3D section push (the observed
+ * X server one-shot is 1524 B = 381 dwords) survives in the captured raw
+ * tail; the raw window is the source of the 3D method-stream replay.
+ * SESSION 153-CONTINUED-45: 512 -> 2048 dwords (8 KB) for the DIRECT GL
+ * client's 5016-7144 B render pushes (glcore); the raw window must carry
+ * the whole push for the section capture's `len == push_n*4` gate. Must
+ * equal SVC_GR_PUSH_WORDS (static_assert in gsp_sema_service.c).
+ */
+#define GSP_PHYS_GR_RAW_WORDS 2048u
/*
* B-2 (large-operand data path): the grown, boot-fixed GR data-bounce region.
@@ -441,6 +476,39 @@ struct gsp_phys_gr_submit {
u64 push_va; /* guest push identity (logging only) */
u32 push_len;
u32 h_object; /* guest GR channel handle (logging only) */
+ /*
+ * r929 (GL 3D path): the captured raw 3D method window - the
+ * SET_OBJECT C597 section from its class bind through the section
+ * close (state binds, LINE_LENGTH_IN + LAUNCH_DMA uploads, program/
+ * tex binds; the prelude before the bind is excluded - its host-sem
+ * VAs belong to the client's VM and are unmapped in the replay
+ * channel, r929 v1 FAULT_PDE). When stream_n > 0 and
+ * gsp_phys_rmcall_gr_3d is on, the launch block replays the window
+ * verbatim after a SET_OBJECT TURING_A bind instead of the compute
+ * prelude + QMD; the engine then executes the REAL 3D methods.
+ * stream points into the caller's raw buffer; it is a separate
+ * pointer so a caller can pass any window.
+ */
+ const u32 *stream;
+ u32 stream_n; /* dwords */
+ /*
+ * SESSION 153-CONTINUED-87: the first program VA the captured
+ * window binds (SET_PIPELINE_PROGRAM_ADDRESS pair; 0 when none).
+ * The launch builder uses its 4K page as the program family for
+ * the client's missing stage binds (sema_gl_sph_bind).
+ */
+ u64 prog_va;
+ /*
+ * SESSION 153-CONTINUED-87: every program bind the captured window
+ * itself carries (VA + pipeline slot). The launch builder re-emits
+ * them AHEAD of the window: the window's own draws (BEGIN 0x1618)
+ * precede its binds (measured word 93 vs 184), and on the replay
+ * channel's fresh context the early draws would validate an unbound
+ * stage and latch the Shader Program Header fault.
+ */
+ u32 n_prog_binds;
+ u64 prog_bind_va[8];
+ u32 prog_bind_slot[8];
};
/* True when gsp_phys_gr_forward is set and the ladder is a live GR channel