Index | Thread | Search

From:
Pat <pat@patpatpat.xyz>
Subject:
Fix for Wacom One M (CTL-672)
To:
<tech@openbsd.org>
Date:
Wed, 5 Mar 2025 21:20:55 +0000

Download raw body.

Thread
  • Pat:

    Fix for Wacom One M (CTL-672)

Hi, I noticed that the Wacom One M (CTL-672) drawing tablet is using 
relative positions, rather than absolute positions like you'd expect from 
a tablet. Some people have also mentioned it over at misc@openbsd.org.

Sven M. Hallberg posted a fix for it in 2022: 
https://marc.info/?l=openbsd-tech&m=167050837707679

However, that fix was lost when uwacom.c was overhauled in 2023.

Essentially, the device presents multiple HID devices: one for relative 
positions (which is attached as a ums device), and the other for absolute 
positions (which is attached as a uwacom device). It will only send 
reports to one of those at a time, depending on which "mode" the device 
is in. Setting the mysterious feature report to non-zero seems to enable 
the desired "pen mode", rather than the default "mouse mode". I've 
attached a diff that restores the fix used in 2022.

Issues/Questions:

- I am not sure if the feature report must be set to a specific value, it 
works setting it to either 1 or 2.

- The feature report is only 1 byte (size=8), so should uhidev_set_report 
also only send 1 byte? I.e., using 1 instead of sizeof(wacom_report_buf).

- Unplugging/replugging the tablet seems to cause the tsscale to be lost. 
Restarting Xorg fixes it though.

- The HID reports have nonsense page/usage descriptors. Would it be 
worthwhile to add something to uhid_rdesc.h for them? Perhaps if the 
descriptors were detected, then it would work with the new wacom driver 
(rather than using the legacy version).

- This device presents 15 different uhid devices, which seems like a lot. 
Is it possible to tell uhidev to ignore most of them?

P.S., this is my first attempt at using a mailing list, so please let me 
know if I've made any mistakes :)

Thanks,
Pat (mostlypat@mastodon.sdf.org)

Index: uwacom.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/uwacom.c,v
diff -u -p -r1.8 uwacom.c
--- uwacom.c	12 Aug 2023 20:47:06 -0000	1.8
+++ uwacom.c	5 Mar 2025 18:50:30 -0000
@@ -158,6 +158,13 @@ uwacom_attach(struct device *parent, str
 		hidms_setup((struct device *)sc, ms, HIDMS_WACOM_SETUP,
 		    repid, desc, size);
 		break;
+	case USB_PRODUCT_WACOM_ONE_M:
+		ms->sc_tsscale.maxx = 21600;
+		ms->sc_tsscale.maxy = 13500;
+		uhidev_set_report(uha->parent, UHID_FEATURE_REPORT,
+			sc->sc_hdev.sc_report_id, &wacom_report_buf,
+			sizeof(wacom_report_buf));
+		break;
 	case USB_PRODUCT_WACOM_INTUOS_DRAW:
 		sc->sc_flags = UWACOM_USE_PRESSURE | UWACOM_BIG_ENDIAN;
 		sc->sc_loc_tip_press.pos = 43;