summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_booter.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/gsp_phys_booter.c')
-rw-r--r--kernel/gsp_phys_booter.c77
1 files changed, 76 insertions, 1 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index 7b99fc4..c1d9936 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -19578,6 +19578,26 @@ static const u32 gsp_phys_gr_vp_pre_m6[GSP_PHYS_GR_VP_PRE_M6_WORDS] = {
0x2001064fu, 0x00021800u,
};
+/*
+ * SESSION 154 r1506: mode 7 = the CLIENT'S OWN window viewport (800x600 at
+ * the root origin) instead of the captured RT's 1280x720 screen viewport.
+ * The glxgears window is 800x600+0+0 on the 1280x720 root; its own GL
+ * viewport is (0,0,800,600) -> scale (400,300), offsets (400,300), clip
+ * 800x600. Mode 6 maps the geometry across the whole X screen; if the
+ * client's real draw args are window-relative, mode 7 is the faithful
+ * transform. Same encoding as mode 6 (scale/offset block, then clip,
+ * z range, pixel centre, scale-offset enable, clip control).
+ */
+#define GSP_PHYS_GR_VP_PRE_M7_WORDS 19u
+static const u32 gsp_phys_gr_vp_pre_m7[GSP_PHYS_GR_VP_PRE_M7_WORDS] = {
+ 0x20020280u, 0x43c80000u, 0x43960000u, /* scale 400, 300 */
+ 0x20040282u, 0x3f000000u, 0x43c80000u, 0x43960000u, 0x3f000000u,
+ 0x20020300u, 0x03200000u, 0x02580000u, /* clip 800x600 at 0,0 */
+ 0x20020302u, 0x00000000u, 0x3f800000u,
+ 0x20010649u, 0x00000000u, 0x8001064bu,
+ 0x2001064fu, 0x00021800u,
+};
+
static u32 gsp_phys_gr_vp_pre_len(int mode)
{
switch (mode) {
@@ -19592,6 +19612,8 @@ static u32 gsp_phys_gr_vp_pre_len(int mode)
return GSP_PHYS_GR_VP_PRE_M5_WORDS;
case 6:
return GSP_PHYS_GR_VP_PRE_M6_WORDS;
+ case 7:
+ return GSP_PHYS_GR_VP_PRE_M7_WORDS;
default:
return 0u;
}
@@ -19604,6 +19626,8 @@ static const u32 *gsp_phys_gr_vp_pre_src(int mode)
return gsp_phys_gr_vp_pre_m5;
case 6:
return gsp_phys_gr_vp_pre_m6;
+ case 7:
+ return gsp_phys_gr_vp_pre_m7;
default:
return gsp_phys_gr_vp_pre;
}
@@ -19713,7 +19737,7 @@ static int gsp_phys_rmcall_gr_vp_prelude;
module_param_named(sema_gl_vp_prelude, gsp_phys_rmcall_gr_vp_prelude,
int, 0644);
MODULE_PARM_DESC(sema_gl_vp_prelude,
- "Synthesize the missing viewport state ahead of replayed 3D windows (0 = off (default); 1 = scale/offset; 2 = + pixel centre and clip control; 3 = + clip rect; 4 = same clip rect with the verified pixel-unit encoding; 5 = driver viewport macro CALL(33) 0x3908 + appended state; 6 = raw mode-5 state without the CALL)");
+ "Synthesize the missing viewport state ahead of replayed 3D windows (0 = off (default); 1 = scale/offset; 2 = + pixel centre and clip control; 3 = + clip rect; 4 = same clip rect with the verified pixel-unit encoding; 5 = driver viewport macro CALL(33) 0x3908 + appended state; 6 = raw mode-5 state without the CALL; 7 = mode-6 encoding for the client window viewport 800x600 at 0,0)");
static int gsp_phys_rmcall_gr_vp_prelude_pos = 1;
module_param_named(sema_gl_vp_prelude_pos, gsp_phys_rmcall_gr_vp_prelude_pos,
@@ -28537,6 +28561,7 @@ int gsp_phys_backend_guest_gr_submit(const struct gsp_phys_gr_submit *req,
inl->data, len);
{
static u32 inl_alias_log;
+ static u32 inl_alias_writer_log;
if (inl_alias_log < 12u) {
inl_alias_log++;
@@ -28547,6 +28572,26 @@ int gsp_phys_backend_guest_gr_submit(const struct gsp_phys_gr_submit *req,
get_unaligned_le32(inl->data) :
0u);
}
+ if (inl_alias_writer_log < 16u &&
+ len >= 128u) {
+ inl_alias_writer_log++;
+ pr_info("vgsp-gr: INLINE-WRITER-ALIAS h=0x%x push=0x%llx dst=0x%llx len=%u pg_va=0x%llx pa=0x%llx ap=%u fb=0x%llx hpa=0x%llx first8=%08x %08x %08x %08x\n",
+ req->h_object, req->push_va,
+ inl->dst_va, len, pg_va,
+ pg->reserved &
+ 0x3fffffffuLL,
+ (pg->reserved >> 31) ?
+ 2u : 1u,
+ (pg->reserved >> 31) ?
+ (u64)(pg->reserved &
+ 0x3fffffffu) :
+ 0ULL,
+ pg->hpa,
+ len >= 4 ? get_unaligned_le32(inl->data) : 0u,
+ len >= 8 ? get_unaligned_le32(inl->data + 4) : 0u,
+ len >= 12 ? get_unaligned_le32(inl->data + 8) : 0u,
+ len >= 16 ? get_unaligned_le32(inl->data + 12) : 0u);
+ }
}
}
}
@@ -28776,6 +28821,7 @@ int gsp_phys_backend_guest_gr_submit(const struct gsp_phys_gr_submit *req,
*/
{
static u32 inl_apply_log;
+ static u32 inl_writer_log;
if (inl_apply_log < 24) {
inl_apply_log++;
@@ -28786,6 +28832,35 @@ int gsp_phys_backend_guest_gr_submit(const struct gsp_phys_gr_submit *req,
len >= 4 ? get_unaligned_le32(inl->data) : 0u,
len >= 8 ? get_unaligned_le32(inl->data + 4) : 0u);
}
+ /*
+ * r1503 (mission task 1): decisive
+ * writer receipt for every image-sized
+ * inline delivery - names the emitting
+ * launch, the VA, the resolved PA /
+ * aperture and the first payload words,
+ * so a delivery that lands in a
+ * scanout/window-buffer page is
+ * provable from the log alone.
+ */
+ if (inl_writer_log < 32u && len >= 128u) {
+ inl_writer_log++;
+ pr_info("vgsp-gr: INLINE-WRITER h=0x%x push=0x%llx dst=0x%llx len=%u pg_va=0x%llx pa=0x%llx ap=%u fb=0x%llx hpa=0x%llx first8=%08x %08x %08x %08x\n",
+ req->h_object, req->push_va,
+ inl->dst_va, len, pg_va,
+ pg->reserved &
+ 0x3fffffffuLL,
+ (pg->reserved >> 31) ?
+ 2u : 1u,
+ (pg->reserved >> 31) ?
+ (u64)(pg->reserved &
+ 0x3fffffffu) :
+ 0ULL,
+ pg->hpa,
+ len >= 4 ? get_unaligned_le32(inl->data) : 0u,
+ len >= 8 ? get_unaligned_le32(inl->data + 4) : 0u,
+ len >= 12 ? get_unaligned_le32(inl->data + 8) : 0u,
+ len >= 16 ? get_unaligned_le32(inl->data + 12) : 0u);
+ }
}
/*
* SESSION 153-CONTINUED-87: readback witness.