tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Huion tablet support
Hi.
I'm going to do some work adding support for the drawing tablets I
discussed here:
https://mail-index.netbsd.org/netbsd-users/2023/05/14/msg029686.html
These devices use chips called uclogic that are found on many other
devices.
These devices use the same vendor:product id for different models,
don't conform to the hid standard, strings descriptors have to be
read to obtain parameters and set the tablet mode (full, phone).
These strings are different between models. Trying to make a general
algorithm to manage all models is not a great idea in my opinion.
Look at the linux driver:
https://raw.githubusercontent.com/DIGImend/digimend-kernel-drivers/master/hid-uclogic-params.c
They try first as if the device were an old one, then gess if it is
wrong and try another way, and all of this making exeptions for
different models anyway. And this driver hasn't been written by a
vendor, there is no certainty that the next chip will make something
different, for example the codification of the parameters in the
string descriptor, so the code has to be kneaded again... I really
don't like it.
In sort what I did basically was adding some code in uhidev.c and
supporting files to set the device in the adecuate mode and set
the descriptor report for the corresponding model (I made it easy
to add new models and reuse if possible the structures, &c)
The problem is that pressure is not managed by ums(4).
I've been using the old usbtablet driver still maintained in openbsd.
I don't like this workaround:
1. The driver is not in netbsd's xorg.
2. Deattaching the device will freeze the system.
3. With wscons support, it will work in whatever environment that uses
wscons, not just xorg.
This could bring support to netbsd for a lot of graphics tablets,
these chips are use by several manufactures (Huion, Yiynova, Ugee,
Monoprice, Turcom...).
One cheap solution I'm seeing is to check in ums.c for HUD_TIP_PRESSURE
at ums_attach(), when hid_start_parse() is used for calibration,
then change hidms_loc_z to match that of pressure.
A similar check should be done in sys/dev/hid/hidms.c:hidms_intr()
to add the flag WSMOUSE_INPUT_ABSOLUTE_Z. Would be a good idea
to check for the HIDMS_DIGITIZER flag and assume that z will be
absolute?
If devices have problems with that, the check could be narrow to
a list of devices instead, but I doubt those devices could work
correctly with wscons anyway...
Some thoughts or guidance before I start digging in?
Regards.
adr.
Home |
Main Index |
Thread Index |
Old Index