summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-06 21:14:06 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-06 21:14:06 -0400
commitf8537d94ffb6895e2d1adbc9a78f0c07ab502f90 (patch)
tree6befd185015e35e4733771705b07e8bd6f696a29 /kernel
parent8ac2e33819ddd40fcbe55636aebb80ea53798924 (diff)
downloadopen-iov-f8537d94ffb6895e2d1adbc9a78f0c07ab502f90.tar.gz
open-iov-f8537d94ffb6895e2d1adbc9a78f0c07ab502f90.zip
vgsp: mode 35 F3 - send the real client's KGR static ctx-buffer query set before the channel batch (capture #388-402; a2a/a32 may prepare the server per-context tables the 0x57 companion needs)
Diffstat (limited to 'kernel')
-rw-r--r--kernel/gsp_phys_booter.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index b94a877..b223cee 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -12661,6 +12661,55 @@ static int gsp_phys_rmcall_user_lane_userd(void __iomem *bar0)
}
/*
+ * Mode 35 / F3: the real client's KGR static ctx-buffer query set. The
+ * capture sends these getters on the subdevice (#388-#402) BEFORE the TSG,
+ * the share and any channel, and the server's per-context ctx-buffer tables
+ * (CONTEXT_BUFFERS_INFO in particular) may be prepared by the query. All are
+ * zero-in best-effort getters at the capture's payload sizes; a failure
+ * warns and the lane continues.
+ */
+static void gsp_phys_rmcall_user_lane_kgr_queries(void __iomem *bar0)
+{
+ static const struct {
+ u32 cmd;
+ u32 size;
+ const char *name;
+ } q[] = {
+ { 0x20800a1fu, 184u, "KGR_GET_CAPS" },
+ { 0x20800a2au, 3712u, "KGR_GET_INFO" },
+ { 0x20800a2cu, 320u, "KGR_ZCULL_INFO" },
+ { 0x20800a2eu, 96u, "KGR_ROP_INFO" },
+ { 0x20800a30u, 384u, "KGR_PPC_MASKS" },
+ { 0x20800a32u, 1664u, "KGR_CONTEXT_BUFFERS_INFO" },
+ { 0x20800a34u, 72u, "KGR_SM_ISSUE_RATE" },
+ { 0x20800a3du, 32u, "KGR_FECS_RECORD_SIZE" },
+ { 0x20800a3fu, 256u, "KGR_FECS_TRACE_DEFINES" },
+ { 0x20800a48u, 8u, "KGR_PDB_PROPERTIES" },
+ };
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(q); i++) {
+ void *buf = kvzalloc(q[i].size, GFP_KERNEL);
+ u32 rpc_result = 0, status = 0;
+ int ret;
+
+ if (!buf) {
+ pr_warn("vgsp-boot: rm-call: mode 35 KGR query %s skipped: no memory\n",
+ q[i].name);
+ continue;
+ }
+ ret = gsp_phys_rmcall_control(bar0,
+ boot_stage.rmcall_subdevice, q[i].cmd,
+ buf, q[i].size, 24u + q[i].size,
+ buf, q[i].size, &rpc_result, &status,
+ q[i].name);
+ pr_info("vgsp-boot: rm-call: mode 35 KGR query %s: size=%u status=0x%x rpc_result=0x%x ret=%d\n",
+ q[i].name, q[i].size, status, rpc_result, ret);
+ kvfree(buf);
+ }
+}
+
+/*
* Mode 35 step 4b: the V7 real-client user-lane channel (0xcaf000a0). Every
* captured #825 field is carried: class 0xc46f, hParent = ladder TSG,
* hVASpace 0, hContextShare (the mode-34 share), flags 0x00201320,
@@ -13091,6 +13140,15 @@ static int gsp_phys_rmcall_stage3(void __iomem *bar0)
}
/*
+ * Mode 35 / F3: the real client's KGR static ctx-buffer queries before
+ * the channel batch (best-effort getters; capture #388-#402).
+ */
+ if (gsp_phys_rmcall_engine_is_gr() &&
+ boot_stage.rmcall_gr_promote ==
+ GSP_PHYS_RMCALL_GR_PROMOTE_GOLDEN_USER_LANE)
+ gsp_phys_rmcall_user_lane_kgr_queries(bar0);
+
+ /*
* Golden-image replay (gsp_phys_rmcall_golden=1 + gsp_phys_gpu=1):
* replay the stock client's post-load golden channel allocations after
* the ladder's VAS/TSG exist and before the ladder's own channel/GR