diff options
Diffstat (limited to 'kernel/gsp_sema_service.c')
| -rw-r--r-- | kernel/gsp_sema_service.c | 54 |
1 files changed, 51 insertions, 3 deletions
diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c index 4a7180e..cafb0dc 100644 --- a/kernel/gsp_sema_service.c +++ b/kernel/gsp_sema_service.c @@ -9788,6 +9788,24 @@ static u8 svc_gl_shader_type[32] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; /* + * eng69: sticky SET_VERTEX_STREAM_A_LOCATION pair bases. The client's + * per-frame DRAW window carries only SET_VERTEX_STREAM_A_FORMAT + * (0x1c00 <- tid, no location run); the [fmt, BASE_UPPER, BASE_LOWER] + * pair is written by its setup push and must be replayed with the DRAW + * window or the engine fetches vertices from an unbound VA (c807: + * DRAW-STATE VS0=0, no stores). Record the last pair base per stream j + * from any decoded client push; the section capture re-adds these pages + * to the candidate page set and the booter prepends the relocated pair + * to the saved release window. + */ +static u64 svc_gl_vs_base[8]; +static u32 svc_gl_vs_log; + +u64 gsp_sema_gl_vs_base(u32 j) +{ + return j < 8u ? READ_ONCE(svc_gl_vs_base[j]) : 0; +} +/* * SESSION 153-CONTINUED-10 (task 1): the C597 class ATTACHMENT. * * A SET_OBJECT bind is sticky on real hardware: the class stays bound to @@ -11078,9 +11096,22 @@ static void svc_gl_field(u32 addr, u32 count, const u8 *data, u32 dlen) * 153-CONTINUED-10 draw-push decode). */ case 0x1c10: - if (count >= 3) - svc_gl_add_ptr(((u64)(v[1] & 0xff) << 32) | - (u64)(v[2] & 0xfffffffc)); + if (count >= 3) { + u64 vb = ((u64)(v[1] & 0xff) << 32) | + (u64)(v[2] & 0xfffffffc); + u32 vj = (addr - 0x1c00u) >> 4; + + if (vj < 8u && vb) { + if (READ_ONCE(svc_gl_vs_base[vj]) != vb && + svc_gl_vs_log < 16u) { + svc_gl_vs_log++; + pr_info("sema-gl: VS-BIND j=%u base=0x%llx\n", + vj, (unsigned long long)vb); + } + WRITE_ONCE(svc_gl_vs_base[vj], vb); + } + svc_gl_add_ptr(vb); + } return; case 0x2380: /* SET_CONSTANT_BUFFER_SELECTOR_A/B: [size, upper, * lower]. Observed [00010000 00000001 2150a500]. @@ -22957,6 +22988,23 @@ static void svc_decode_stream(struct nv_vgpu_device *vgpu, const u8 *buf, svc_gl.start_off = off; svc_gl.rel_va = keep_rel; svc_gl.rel_payload = keep_pay; + /* + * eng69: keep the client's vertex-stream + * location pages in every draw section's page + * set (the per-frame window only carries the + * FORMAT; the booter prepends the saved + * location pair to the release window). + */ + { + u32 vk; + + for (vk = 0; vk < 8u; vk++) + if (READ_ONCE( + svc_gl_vs_base[vk])) + svc_gl_add_ptr( + READ_ONCE( + svc_gl_vs_base[vk])); + } /* SESSION 153-CONTINUED-10: the bind is sticky - * remember it so the class-space recognizer * (BEGIN 0x1618, below) accepts this channel's |
