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.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index 3a8bb55..a1fefa9 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -19515,9 +19515,9 @@ static void gsp_phys_gr_mme_release_save(const struct gsp_phys_gr_submit *req,
{
static u32 vs_scan_n;
- u64 scan_va = 0;
- u32 scan_off = 0;
- bool scan_ok = false;
+ u64 scan_va = 0, slot2_va = 0;
+ u32 scan_off = 0, vcall[3];
+ bool scan_ok = false, have_call = false;
if (READ_ONCE(gsp_phys_rmcall_gr_vs_autobind) &&
vs_scan_n < 4u) {
@@ -19525,6 +19525,20 @@ static void gsp_phys_gr_mme_release_save(const struct gsp_phys_gr_submit *req,
scan_ok = gsp_phys_gr_vs_scan(req, &scan_va,
&scan_off);
}
+ /*
+ * eng79: the client's VERTEX_STREAM_TURING CALL(2)
+ * payload [0,0,VA] carries the real VTG vertex
+ * buffer VA (0x0450e100-family). The slot-2 macro
+ * itself emits location=0/size=VA (Mesa sim), so
+ * synthesize the stream-location pair with this VA
+ * as the base (the patch relocates it like any
+ * 0x1c00 pair).
+ */
+ if (gsp_sema_gl_vs_call(vcall) && vcall[2] &&
+ !(vcall[2] & 3u) && vcall[2] >= 0x1000u) {
+ slot2_va = (u64)vcall[2];
+ have_call = true;
+ }
for (vj = 0; vj < 8u; vj++) {
u64 vva = gsp_sema_gl_vs_base(vj);
bool has = false;
@@ -19534,6 +19548,10 @@ static void gsp_phys_gr_mme_release_save(const struct gsp_phys_gr_submit *req,
continue;
vfmt = gsp_phys_gr_mme_window_vs_fmt(
req->stream, req->stream_n, vj, &has);
+ if (!vva && vj == 0u && have_call &&
+ READ_ONCE(gsp_phys_rmcall_gr_vs_autobind) >=
+ 2u)
+ vva = slot2_va;
if (!vva && vj == 0u && scan_ok &&
READ_ONCE(gsp_phys_rmcall_gr_vs_autobind) >=
2u)
@@ -19549,8 +19567,12 @@ static void gsp_phys_gr_mme_release_save(const struct gsp_phys_gr_submit *req,
vs_pre[vs_n++] = vfmt;
vs_pre[vs_n++] = (u32)(vva >> 32) & 0xffu;
vs_pre[vs_n++] = (u32)vva & 0xfffffffcULL;
- pr_info("vgsp-gr: MME-VS-BIND synth j=%u base=0x%llx fmt=0x%x h=0x%x push=0x%llx\n",
+ pr_info("vgsp-gr: MME-VS-BIND synth j=%u base=0x%llx fmt=0x%x src=%s h=0x%x push=0x%llx\n",
vj, (unsigned long long)vva, vfmt,
+ (vj == 0u && have_call &&
+ vva == slot2_va) ? "slot2" :
+ (vj == 0u && scan_ok &&
+ vva == scan_va) ? "scan" : "sticky",
req->h_object, req->push_va);
/*
* Stream size (Turing binds SIZE_A/B; the