From aaa852aaf22d4d9b56722ad79f4f9849f5a5cd27 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Mon, 16 Nov 2026 01:03:13 -0500 Subject: vgsp: eng75 - A/B: point the SURF prelude/RT0 at the big-surface alias c824/c825: the release RT0/RT1 target is 0xa000000 (the data-rec bounce base from gsp_phys_gr_surf_launch_target's rec-over-alias preference) while the aliased 1920x1080 X-screen surface is 0x15d0000 (2025 pages). The changed pages (0x120700000/0x120704000/0x120705000) are inside the screen range but the draw's RT offsets are computed against the bounce base. sema_gl_surf_alias_pref (default 0; params=1): after the SURF prelude patch, rewrite its target words to gsp_phys_gr_surf[].alias so the prelude and the RT0 copy (r1483) both name the contiguous surface alias. SURF-ALIAS-PREF receipt. --- kernel/gsp_phys_booter.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'kernel') diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c index 395b026..10fe9c3 100644 --- a/kernel/gsp_phys_booter.c +++ b/kernel/gsp_phys_booter.c @@ -22322,6 +22322,18 @@ static u32 gsp_phys_gr_surf_pre[GSP_PHYS_GR_SURF_PRE_WORDS]; /* patched */ static u32 gsp_phys_gr_surf_pre_in[GSP_PHYS_GR_SURF_PRE_WORDS]; static u32 gsp_phys_gr_surf_pre_n; /* patched words, 0 = none */ static u32 gsp_phys_gr_surf_pre_gen; /* capture gen the patch is from */ +/* + * eng75: force the SURF prelude / RT0 target to the contiguous big-surface + * alias (gsp_phys_gr_surf[].alias) instead of the data-rec bounce base. + * c824/c825: the release RT0/RT1 target is 0xa000000 (the data-rec bounce) + * while the aliased X-screen surface is 0x15d0000 (2025 pages); the changed + * pages land in the CB/screen-range pages. A/B: prefer the alias. + */ +static u32 gsp_phys_gr_surf_alias_pref; +module_param_named(sema_gl_surf_alias_pref, gsp_phys_gr_surf_alias_pref, + uint, 0644); +MODULE_PARM_DESC(sema_gl_surf_alias_pref, + "Point the SURF prelude/RT0 target at the contiguous big-surface alias instead of the data-rec bounce base (default 0; A/B)"); static bool gsp_phys_rmcall_gr_surf_prelude = true; module_param_named(sema_gl_surf_prelude, gsp_phys_rmcall_gr_surf_prelude, bool, 0644); @@ -33682,6 +33694,38 @@ gr_page_unmapped: } } } + /* + * eng75: prefer the contiguous surface alias + * (see sema_gl_surf_alias_pref). + */ + if (READ_ONCE(gsp_phys_gr_surf_alias_pref) && + gsp_phys_gr_surf_pre_n >= 3u) { + u64 sva2 = 0; + u32 sn2 = 0, di; + + if (gsp_sema_surf_va_get(&sva2, &sn2)) { + for (di = 0; + di < gsp_phys_gr_surf_n; + di++) { + if (gsp_phys_gr_surf[di] + .va != sva2) + continue; + { + u64 al = gsp_phys_gr_surf[di].alias; + + gsp_phys_gr_surf_pre[1] = + (u32)(al >> 32) & 0xffu; + gsp_phys_gr_surf_pre[2] = + (u32)al & 0xfffffffcu; + pr_info("vgsp-gr: SURF-ALIAS-PREF target=0x%llx h=0x%x push=0x%llx\n", + (unsigned long long)al, + req->h_object, + req->push_va); + } + break; + } + } + } if (gsp_phys_gr_surf_pre_n && win3d_n + gsp_phys_gr_surf_pre_n + 2u + 8u <= -- cgit v1.2.3