9front - general discussion about 9front
 help / color / mirror / Atom feed
* Fwd: [9front] Re: [9front] recent kernel changes break built-in wacom serial tablet on
@ 2024-01-15 14:18 Dave MacFarlane
  2024-01-15 14:20 ` Dave MacFarlane
  0 siblings, 1 reply; 2+ messages in thread
From: Dave MacFarlane @ 2024-01-15 14:18 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: Type: message/rfc822, Size: 3173 bytes --]

From: Stanley Lieber <sl@stanleylieber.com>
To: 9front@9front.org
Subject: [9front] Re: [9front] recent kernel changes break built-in wacom serial tablet on
Date: Sun, 14 Jan 2024 16:38:16 -0500
Message-ID: <A89E6B6B-5F58-493A-84B1-EB0F06924CE2@stanleylieber.com>

On January 14, 2024 4:28:01 PM EST, cinap_lenrek@felloff.net wrote:
>another possibility:
>
>at startup, it aux/wacom asks the device for the
>resolution that it will later use for scaling:
>
>int
>query(Tablet* t)
>{
>	uchar buf[11];
>
>	if(write(t->ser, "&0*", 3) < 3) return -1;
>	do {
>		if(read(t->ser, buf, 1) < 1) return -1;
>	} while(buf[0] != 0xC0);
>	if(readn(t->ser, buf+1, 10) < 10) return -1;
>	t->xmax = (buf[1] << 9) | (buf[2] << 2) | ((buf[6] >> 5) & 3);
>	t->ymax = (buf[3] << 9) | (buf[4] << 2) | ((buf[6] >> 3) & 3);
>	t->pmax = buf[5] | (buf[6] & 7);
>	t->version = (buf[9] << 7) | buf[10];
>	if(write(t->ser, "1", 1) < 1) return -1;
>	return 0;
>}
>
>if this procress goes wrong for some reason
>(because theres maybe garbage in the fifo?),
>we might end up with a out-of-range t->ymax,
>causing the y-corrdinate to become stuck at
>eigther extreme?
>
>adding a debug print here would be helpfull,
>and maybe just calling query() multiple times
>to see if the values stay consistent:
>
>fprint(2, "query: xmax=%d ymax=%d pmax=%d version=%d\n",
>	t->xmax, t->ymax, t->pmax, t->version);
>
>...
>
>	if(query(t) < 0) sysfatal("%r");
>+	if(query(t) < 0) sysfatal("%r");
>+	if(query(t) < 0) sysfatal("%r");
>
>and finally, we should add a debug print in
>readpacket() *BEFORE* the scaling:
>
>	m->b = head & 7;
>	m->x = (buf[0] << 9) | (buf[1] << 2) | ((buf[5] >> 5) & 3);
>	m->y = (buf[2] << 9) | (buf[3] << 2) | ((buf[5] >> 3) & 3);
>	m->p = ((buf[5] & 7) << 7) | buf[4];
>
>fprint(2, "readpacket: b=%x x=%d y=%d p=%d\n", m->b, m->x, m->y, m->p);
>
>...
>
>in any case, lets make sure we understand
>what is actually happening because i dont
>know of any way how our recent changes could
>have screwed up your tablet :(
>
>--
>cinap
>

thank you for investigating this. in case you didn't see my other message,  i was only able to trigger this weird behavior once. i rolled back to my older kernel and it worked again as normal. i installed the new kernel again and now it still works as normal. maybe the initialization just got screwed up somehow that one time? i can no longer trigger the weird behavior.

sl

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fwd: [9front] Re: [9front] recent kernel changes break built-in wacom serial tablet on
  2024-01-15 14:18 Fwd: [9front] Re: [9front] recent kernel changes break built-in wacom serial tablet on Dave MacFarlane
@ 2024-01-15 14:20 ` Dave MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: Dave MacFarlane @ 2024-01-15 14:20 UTC (permalink / raw)
  To: 9front

Sorry about that, I typed the wrong command in nedmail.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-15 14:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-15 14:18 Fwd: [9front] Re: [9front] recent kernel changes break built-in wacom serial tablet on Dave MacFarlane
2024-01-15 14:20 ` Dave MacFarlane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).