Re: [DIGImend-devel] PT-1001 digitizer
Brought to you by:
spb_nick
|
From: Yann V. <yan...@or...> - 2015-02-19 16:19:32
|
On Sat, 31 Jan 2015 12:35:28 +0200 Nikolai Kondrashov <sp...@gm...> wrote: > The code looks fine to me, but I have a few comments on the report descriptor. > > I think it is better to omit report ID's, features and fields that are not > used by the driver, for clarity. > > Physical extents are useless without units and probably don't even apply to > some usages below, like resolution multiplier, so it's better to remove them. > However, adding the units, unit exponent and physical extents to the pen > coordinates is useful. The result will be visible in "evtest" output and > likely used by Wayland. Okay. > I'm not sure how repeated report ID items in a single collection even work. > Also duplicate report IDs sound fishy. All-in-all, this is some really weird > report descriptor and would be difficult to reason about. I would start from > scratch, taking one of the fixed report descriptors from other tablets and > adjusting it to the bit fields this one reports. I think it's some sort of indirect description, applying resolution multipliers to the preexisting report 1, so as not to confuse the boot protocol interpretation. However, I have not gotten the device to send the multiplier reports, and Linux seems to happily ignore them. > > /* I expect patching in these values (from interface 2) > > would get Xorg to use tablet mode: */ > > 0x09, 0x42, /* Usage (Tip Switch), */ > > 0x09, 0x44, /* Usage (Barrel Switch), */ > > 0x09, 0x45, /* Usage (Eraser), */ /* Really on the barrel too */ > > I suggest to use "Tablet Pick" here. I added it to the kernel and use it for > the second barrel button on all of the tablets. It will map to the third > button. Certainly. Since this is a patch driver for Linux anyway, convention there takes priority. I don't know if other tablets also abuse eraser like this. > > /* The original usages should have mapped to mouse buttons, but Linux > > happily reports them as buttons 10-12. */ > > /* 0x05, 0x0f, / * Usage Page (Button), */ > > /* 0x19, 0x01, / * Usage Minimum (01h), */ > > /* 0x29, 0x03, / * Usage Maximum (03h), */ > > /* End of Stylus button usage */ > > I think having six usages and only three reports wouldn't work. Those were simply commented out versions of what the device originally sent. > > 0x15, 0x00, /* Logical Minimum (0), */ > > 0x25, 0x01, /* Logical Maximum (1), */ > > 0x95, 0x03, /* Report Count (3), */ > > 0x75, 0x01, /* Report Size (1), */ > > 0x81, 0x02, /* Input (Variable), */ > > 0x95, 0x05, /* Report Count (5), */ > > 0x81, 0x01, /* Input (Constant), */ > > 0x05, 0x01, /* Usage Page (Desktop), */ > > 0x09, 0x30, /* Usage (X), */ > > 0x09, 0x31, /* Usage (Y), */ > > 0x15, 0x00, /* Logical Minimum (0), */ > > 0x26, 0x00, 0x10, /* Logical Maximum (4096), */ > > 0x35, 0x00, /* Physical Minimum (0), */ > > 0x46, 0x00, 0x10, /* Physical Maximum (4096), */ > > Is the actual physical drawing area square? No. I believe it's meant to be 16:10 proportions. A quick measurement by the printed border shows: X: inner 103.65mm, outer 105mm Y: inner 65.6mm, outer 66.45mm This gives an aspect ratio somewhere from 1.56 to 1.60. Measuring the firmware limits would be a bit harder (for instance, it doesn't measure the tip but the coil position). I guess 105.6*66mm would be a reasonable approximation. I have tried to put this data into the attached descriptor. It would also be a little tricky to measure the unit of pressure, so I took the push/pop example from one of the uc-logic descriptors. The attached version uses pick, and thus reports (using input-events) stylus for the side button closer to the tip and stylus2 for the one further away. It was tested to work smoothly in inkscape and krita. Since it overrides the descriptor it doesn't care about the readout bugs, so it works on its own (but still requires the unbinding of hid-generic from the relevant interface). http://www.nybytt.se/zeniq-pen-tablet/ is a clear example of one of these tablets. Mine happen to have the Leogics brand instead. |