diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-11-15 18:25:12 -0500 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-11-15 18:25:12 -0500 |
| commit | 5ff47a9546eb9580a1fbe56706abef2a4fb87aaa (patch) | |
| tree | 280975467455ed07cc254a1ad27e85ca0c136c36 /kernel/gsp_sema_service.c | |
| parent | 3481e62d9ae97ec7f354d252aa93bb765b8a7964 (diff) | |
| download | open-iov-5ff47a9546eb9580a1fbe56706abef2a4fb87aaa.tar.gz open-iov-5ff47a9546eb9580a1fbe56706abef2a4fb87aaa.zip | |
vgsp: eng69 - persist and replay the client's vertex-stream location pairs
c807: the release DRAW window carries only SET_VERTEX_STREAM_A_FORMAT
(0x1c00 <- 0x1014); its [fmt, UPPER, LOWER] location pair lives in the
client's setup push, so the replay context's stream address is unbound
(DRAW-STATE VS0=0) and the 8x3-vertex DRAW_IAB fetches nothing (wrote=0).
- service: sticky svc_gl_vs_base[8] from every decoded 0x1c00..0x1cf0
count>=3 pair (VS-BIND receipt); re-add those pages to every GL draw
section's candidate page set so the launch can map them; getter
gsp_sema_gl_vs_base().
- booter release_save: when the held window carries the FORMAT but no
count>=3 location pair, prepend a normal INC run
[fmt, UPPER, LOWER] for streams 0 and 3 to the saved window
(MME-VS-BIND synth receipt, MME-CARRY-SAVE vs_pre=N). The normal
window patch relocates the pair to a shadow VA using the saved page
set, so the release draw can fetch its vertices.
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 |
