summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_booter.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/gsp_phys_booter.c')
-rw-r--r--kernel/gsp_phys_booter.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index 98bbc4a..0ea6076 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -19746,6 +19746,25 @@ MODULE_PARM_DESC(sema_gl_vp_prelude_pos,
"Insertion point of the synthesized viewport prelude in a replayed 3D window (0 = window head (legacy); 1 = before the first CALL run 0x3800..0x39fc, after the state binds (default); 2 = before the first 0x3910 run); pos 1/2 leave a window without the requested run unchanged (non-draw window), only 0 inserts without a CALL run)");
/*
+ * r1512 diagnostic export: the sema service's draw-coverage receipt needs
+ * the viewport state the replay will inject for the current launch. Pure
+ * read of the module parameter + the literal table (no side effects).
+ */
+void gsp_phys_gr_vp_state_get(int *mode, u32 *words, u32 *n)
+{
+ int m = READ_ONCE(gsp_phys_rmcall_gr_vp_prelude);
+ u32 len = gsp_phys_gr_vp_pre_len(m);
+ const u32 *src = gsp_phys_gr_vp_pre_src(m);
+
+ if (mode)
+ *mode = m;
+ if (n)
+ *n = len;
+ if (words && len && src)
+ memcpy(words, src, (size_t)len * 4u);
+}
+
+/*
* CONT-119 (r1450): the BINDING words of the synthesized stage-2/5
* REGISTER_COUNT runs. CONT-90 emitted each as a 2-word
* REGISTER_COUNT/BINDING run (`20020823 0000001a 00000000` for j=2, the