summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-16 01:03:13 -0500
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-16 01:03:13 -0500
commitaaa852aaf22d4d9b56722ad79f4f9849f5a5cd27 (patch)
tree3d2f468185aed6a769ef898fc69d3b48cf97d091
parent32e78887ec37b4977dda346ae0c7b19be51a4146 (diff)
downloadopen-iov-aaa852aaf22d4d9b56722ad79f4f9849f5a5cd27.tar.gz
open-iov-aaa852aaf22d4d9b56722ad79f4f9849f5a5cd27.zip
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.
-rw-r--r--kernel/gsp_phys_booter.c44
-rw-r--r--tools/guest-diag/params-r1624.txt1
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