From ec6704d03ea41677d36da5e7dde4d98ad3e714c0 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Mon, 16 Nov 2026 01:24:35 -0500 Subject: vgsp: eng79 - bind the stream location to the CALL(2) VERTEX_STREAM VA The client's VERTEX_STREAM_TURING CALL(2) payload [0,0,0x0450e100] carries the real VTG vertex buffer VA; the slot-2 macro itself emits location=0 / size= (Mesa slot-2 sim), i.e. the base is never written to 0x1c04/0x1c08. Synthesize the stream-location pair with the CALL(2) VA as the base instead: release_save takes gsp_sema_gl_vs_call() and, for stream 0, prefers payload[2] (masked) over the scanned CB candidate, emitting the usual [fmt=0x1014, upper, lower] pair + the size pair. The patch relocates the VA like any 0x1c00 pair. MME-VS-BIND receipt gains src=slot2|scan|sticky. --- kernel/gsp_phys_booter.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'kernel') 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 -- cgit v1.2.3