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.c50
1 files changed, 49 insertions, 1 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index 10fe9c3..3a8bb55 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -19295,6 +19295,28 @@ static u32 gsp_phys_gr_vs_scan(const struct gsp_phys_gr_submit *req,
return 0;
}
+/* Does the window carry the VERTEX_STREAM_TURING CALL(2) run (0x3810)? */
+static bool gsp_phys_gr_mme_window_has_call2(const u32 *win, u32 n)
+{
+ u32 r = 0;
+
+ while (r < n) {
+ u32 h = win[r];
+ u32 op = (h >> 29) & 7u;
+ u32 cnt = (h >> 16) & 0x1fffu;
+ u32 span = 1u;
+ u32 m0 = (h & 0xfffu) << 2;
+
+ if ((op == 1u || op == 3u || op == 5u) && cnt &&
+ r + 1u + cnt <= n)
+ span = 1u + cnt;
+ if (m0 == 0x3810u)
+ return true;
+ r += span;
+ }
+ return false;
+}
+
/* Does the window already carry the Turing stream-size run (0x600)? */
static bool gsp_phys_gr_mme_window_has_vs_size(const u32 *win, u32 n)
{
@@ -19425,7 +19447,7 @@ static void gsp_phys_gr_mme_release_save(const struct gsp_phys_gr_submit *req,
bool draw_ia, keep = false;
const char *prefer = NULL;
u32 old_h = 0, old_win = 0;
- u32 vs_pre[12];
+ u32 vs_pre[24];
u32 vs_n = 0;
static u32 prefer_log;
@@ -19567,6 +19589,32 @@ static void gsp_phys_gr_mme_release_save(const struct gsp_phys_gr_submit *req,
pr_info("vgsp-gr: MME-VS-SIZE synth j=0 size=0x100000 (window has VS) h=0x%x push=0x%llx\n",
req->h_object, req->push_va);
}
+ /*
+ * eng77: the client's VERTEX_STREAM_TURING macro
+ * (CALL_MME_MACRO(2) = 0x3810) payload carries the
+ * VTG stream size/base (the 0x0450e100-family VA).
+ * The DRAW-window slices omit it; replay the last
+ * captured call before the DRAW_IAB.
+ */
+ {
+ u32 vcall[3];
+
+ if (!gsp_phys_gr_mme_window_has_call2(
+ req->stream, req->stream_n) &&
+ gsp_sema_gl_vs_call(vcall) &&
+ vs_n + 4u <= ARRAY_SIZE(vs_pre)) {
+ vs_pre[vs_n++] = (5u << 29) |
+ (3u << 16) |
+ ((0x3810u >> 2) &
+ 0xfffu);
+ vs_pre[vs_n++] = vcall[0];
+ vs_pre[vs_n++] = vcall[1];
+ vs_pre[vs_n++] = vcall[2];
+ pr_info("vgsp-gr: MME-VS-CALL synth 0x3810 payload=%08x,%08x,%08x h=0x%x push=0x%llx\n",
+ vcall[0], vcall[1], vcall[2],
+ req->h_object, req->push_va);
+ }
+ }
}
if (req->stream_n + vs_n > GSP_PHYS_GR_MME_RELEASE_WIN_MAX)
vs_n = 0;