summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_gpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/gsp_phys_gpu.c')
-rw-r--r--kernel/gsp_phys_gpu.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/kernel/gsp_phys_gpu.c b/kernel/gsp_phys_gpu.c
index da6d7fc..512d30b 100644
--- a/kernel/gsp_phys_gpu.c
+++ b/kernel/gsp_phys_gpu.c
@@ -201,6 +201,53 @@ bool gsp_phys_guest_mem_enabled(void)
EXPORT_SYMBOL_GPL(gsp_phys_guest_mem_enabled);
/*
+ * P6b wave-1.5 deferred guest release (default 0). When set together with
+ * gsp_phys_work_forward=1 and gsp_phys_guest_mem=1, a decoded CE push whose
+ * guest copy is forwarded to the real engine defers its guest-visible
+ * semaphore release(s) until the hardware copy completes (or its bounded
+ * window expires), then applies them from the service thread. The software
+ * copy still runs inline, exactly as in wave 1. With 0, every release is
+ * applied inline as before: byte-identical wave-1 behavior. One-line
+ * rollback: gsp_phys_work_defer_release=0.
+ */
+static bool gsp_phys_work_defer_release_param;
+module_param_named(gsp_phys_work_defer_release, gsp_phys_work_defer_release_param,
+ bool, 0644);
+MODULE_PARM_DESC(gsp_phys_work_defer_release,
+ "Defer a forwarded CE push's guest-visible release until its hardware copy completes (default 0: releases apply inline, byte-identical wave-1 behavior; requires gsp_phys_work_forward=1 and gsp_phys_guest_mem=1)");
+
+bool gsp_phys_work_defer_release_enabled(void)
+{
+ return gsp_phys_work_defer_release_param;
+}
+EXPORT_SYMBOL_GPL(gsp_phys_work_defer_release_enabled);
+
+/*
+ * P6b wave-2 hardware-primary guest copies (default 0). When set together
+ * with gsp_phys_work_forward=1, gsp_phys_guest_mem=1 and
+ * gsp_phys_work_defer_release=1, a decoded CE push whose copy is forwarded
+ * to the real engine skips the software copy (the hardware authors the
+ * data) while the wave-1.5 hold still withholds the guest-visible release
+ * until the hardware copy completes. If the hardware path fails, times out,
+ * is aborted, or the request cannot be queued as a guest copy, the service
+ * thread performs the software copy exactly once before applying the
+ * releases, so the guest always reads correct data. With 0, every behavior
+ * is byte-identical to wave 1.5 (the software copy always runs inline and
+ * copy_skipped stays 0). One-line rollback: gsp_phys_work_hw_primary=0.
+ */
+static bool gsp_phys_work_hw_primary_param;
+module_param_named(gsp_phys_work_hw_primary, gsp_phys_work_hw_primary_param,
+ bool, 0644);
+MODULE_PARM_DESC(gsp_phys_work_hw_primary,
+ "Skip the software copy for a forwarded guest CE push (hardware authors the data; the release still waits for hardware completion; one software fallback copy on any hardware/queue failure; default 0: wave-1.5 behavior; requires gsp_phys_work_forward=1 and gsp_phys_guest_mem=1 and gsp_phys_work_defer_release=1)");
+
+bool gsp_phys_work_hw_primary_enabled(void)
+{
+ return gsp_phys_work_hw_primary_param;
+}
+EXPORT_SYMBOL_GPL(gsp_phys_work_hw_primary_enabled);
+
+/*
* One-way power latch (default). Re-enabling runtime PM and D3cold after a
* claim lets the board power-gate and the host hard-freeze on resume
* (observed 2026-10-01); keep the pre-claim D0 policy instead and require