From 8a4463a63978b2df81703a9c22358884c431d5cf Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Tue, 27 Oct 2026 17:12:29 -0400 Subject: vgsp: xw-mirror back to plain tracking law (r867 ahead-mode rejected) r867 with member = counter + learned-delta: every check is a permanent +0x70 mismatch (the mirror re-advances right after each counter change), xorg.log shows '(2, ..., 0xa8c, 0xa1c)' timeouts and the GL client gets nothing. Plain member = counter is the correct law; the driver's re-probe cadence gives the mirror room to settle between the driver's counter increment and its next probe. --- kernel/gsp_sema_service.c | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c index 471f5ae..831f920 100644 --- a/kernel/gsp_sema_service.c +++ b/kernel/gsp_sema_service.c @@ -30528,8 +30528,6 @@ int gsp_sema_service_add_map(u64 gpu_va, u64 pa, u64 len, u32 ap) */ static u64 svc_xw_cnt_pa; static u64 svc_xw_mem_pa; -static u32 svc_xw_last_c; /* last counter read (delta learning) */ -static u32 svc_xw_delta; /* last observed per-frame counter step */ static struct task_struct *svc_xw_task; static int svc_xw_mirror_loop(void *unused) @@ -30551,31 +30549,24 @@ static int svc_xw_mirror_loop(void *unused) &c, sizeof(c)) && !svc_read_ap(vgpu, svc_xw_mem_pa, SVC_APERTURE_SYS, &cur, sizeof(cur))) { - u32 m; /* - * SESSION 148 (r866): write the member one learned - * frame-step AHEAD of the counter. The driver's - * frame path increments its counter and *then* - * enters the wait; a member that only tracks the - * counter therefore always loses that entry-check - * race (mirror latency > driver gap) and each wait - * pays the driver's ~3 s re-check sleep - measured - * as one "(0)" success print every 20-80 s and a - * client hanging on its X socket for minutes. - * With member = counter + last-delta the driver's - * check succeeds on the FIRST probe after its own - * increment (the increment lands exactly on the - * pre-written value), so frames complete at the - * driver's own pace. Delta is learned from each - * observed counter change; 0 until the first change. + * SESSION 148 (r867): member = counter (dword index, + * high bits preserved). The r867 "one learned step + * ahead" experiment produced a PERMANENT +0x70 + * mismatch at every check (member re-advances right + * after each counter change, so the driver's == test + * can never land: the xorg.log shows + * "(2, ..., member_ahead, counter)" timeouts and the + * GL client gets nothing). The plain tracking law is + * the correct one: the driver's re-check cadence + * (~3 ms-scale re-probes observed as 3 s "(0)" success + * prints) gives the mirror room to settle on the new + * counter between the driver's increment and its + * first probe. */ - if (c != svc_xw_last_c) { - if (svc_xw_last_c) - svc_xw_delta = c - svc_xw_last_c; - svc_xw_last_c = c; - } - m = (cur & 0xfffc0000u) | - (((u64)(c + svc_xw_delta) >> 2) & 0x3ffffu); + u32 m = (cur & 0xfffc0000u) | + ((c >> 2) & 0x3ffffu); + if (m != cur) svc_write_ap(vgpu, svc_xw_mem_pa, SVC_APERTURE_SYS, &m, sizeof(m)); -- cgit v1.2.3