From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <9front-bounces@9front.inri.net> X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from 9front.inri.net (9front.inri.net [168.235.81.73]) by inbox.vuxu.org (Postfix) with ESMTP id 8BFD52222A for ; Mon, 15 Jan 2024 15:20:07 +0100 (CET) Received: from auth.driusan.net ([207.148.18.58]) by 9front; Mon Jan 15 09:18:39 -0500 2024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=driusan.net; s=20180128; h=From:Date:Subject:To; bh=XvHmNEsGTSX+HLzp8Q5YFcUdNECE+RmqJzFd1fORKOM=; b=Z4tiLmCS3jGseYW12wN7WkfBCY78eetTnPruLTerQ2Pd5HH0qwcLPTCZ2EJY+9XkrlYmVR5jT8MgITRRHWBiuZMvzHcDMPd3uF+S6pcUG1OvS0cVIPhrR48O05i6quX/rfVtKfpCbxWSukOIdgFczoOWch70A+qu6SYcbLBajHsPsOuAn21uHtDJWjAXchAYIzaDv0PuS+oC6tekijnUNWwYKkOa0hN3ggJ8jV30nxKE6axBAolpAckxj4KEq0AJSP91tqn8l4Tjcs68uUyPnncn+FrM6m/LQTx7ropYsJUsoqyu9/RpR4OdpB73iHv/R0brTYpRsRAAdt48RqH4Pw== Message-ID: From: "Dave MacFarlane" Date: Mon, 15 Jan 2024 09:18:39 -0500 To: 9front@9front.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-dvhearsskepbyrtnotclmzyqfp" List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: generic map/reduce injection proxy Subject: Fwd: [9front] Re: [9front] recent kernel changes break built-in wacom serial tablet on Reply-To: 9front@9front.org Precedence: bulk This is a multi-part message in MIME format. --upas-dvhearsskepbyrtnotclmzyqfp Content-Disposition: inline --upas-dvhearsskepbyrtnotclmzyqfp Content-Type: message/rfc822 Content-Disposition: inline Received: from 9front.inri.net ([168.235.81.73]) by auth; Sun Jan 14 16:39:20 -0500 2024 Received: from gaff.inri.net ([168.235.71.243]) by 9front; Sun Jan 14 16:38:17 -0500 2024 Received: from [127.0.0.1] ([168.235.81.125]) by gaff; Sun Jan 14 16:38:17 -0500 2024 Date: Sun, 14 Jan 2024 16:38:16 -0500 From: Stanley Lieber To: 9front@9front.org In-Reply-To: <0D913CCE4BB41F2B69426CB225F5D0CE@felloff.net> References: <0D913CCE4BB41F2B69426CB225F5D0CE@felloff.net> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: storage general-purpose deep-learning frontend Subject: [9front] =?US-ASCII?Q?Re=3A_=5B9front=5D_recent_kernel_changes_b?= =?US-ASCII?Q?reak_built-in_wacom_serial_tablet_on?= Reply-To: 9front@9front.org Precedence: bulk On January 14, 2024 4:28:01 PM EST, cinap_lenrek@felloff=2Enet 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] !=3D 0xC0); > if(readn(t->ser, buf+1, 10) < 10) return -1; > t->xmax =3D (buf[1] << 9) | (buf[2] << 2) | ((buf[6] >> 5) & 3); > t->ymax =3D (buf[3] << 9) | (buf[4] << 2) | ((buf[6] >> 3) & 3); > t->pmax =3D buf[5] | (buf[6] & 7); > t->version =3D (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=3D%d ymax=3D%d pmax=3D%d version=3D%d\n", > t->xmax, t->ymax, t->pmax, t->version); > >=2E=2E=2E > > 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 =3D head & 7; > m->x =3D (buf[0] << 9) | (buf[1] << 2) | ((buf[5] >> 5) & 3); > m->y =3D (buf[2] << 9) | (buf[3] << 2) | ((buf[5] >> 3) & 3); > m->p =3D ((buf[5] & 7) << 7) | buf[4]; > >fprint(2, "readpacket: b=3D%x x=3D%d y=3D%d p=3D%d\n", m->b, m->x, m->y, = m->p); > >=2E=2E=2E > >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=2E in case you didn't see my other messag= e, i was only able to trigger this weird behavior once=2E i rolled back to= my older kernel and it worked again as normal=2E i installed the new kerne= l again and now it still works as normal=2E maybe the initialization just g= ot screwed up somehow that one time? i can no longer trigger the weird beha= vior=2E sl --upas-dvhearsskepbyrtnotclmzyqfp--