diff options
| -rw-r--r-- | kernel/gsp_phys_booter.c | 44 | ||||
| -rw-r--r-- | tools/guest-diag/params-r1624.txt | 1 |
2 files changed, 45 insertions, 0 deletions
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 <= diff --git a/tools/guest-diag/params-r1624.txt b/tools/guest-diag/params-r1624.txt index 3311100..b777c4b 100644 --- a/tools/guest-diag/params-r1624.txt +++ b/tools/guest-diag/params-r1624.txt @@ -10,3 +10,4 @@ sema_gl_mme_pack_carry=1 sema_gl_mme_pack_carry_ms=100 sema_gl_mme_pack_release= sema_gl_viewport=1 sema_gl_vs_autobind=2 sema_gl_wit_shown=40 + sema_gl_surf_alias_pref=1 |
