On Tue, Oct 9, 2012 at 11:32 AM, Olivier Fourdan <ofour...@redhat.com> wrote:
>
> Hi Ping,
>
> Ping Cheng said the following on 10/09/2012 07:21 PM:
>> On Mon, Oct 8, 2012 at 9:24 AM, Bastien Nocera<had...@hadess.net>  wrote:
>>> On Mon, 2012-10-08 at 18:12 +0200, Olivier Fourdan wrote:
>>> [...] Looks to me like "builtin" is "tablet is integrated with the
>>> display" and "ISD" is "tablet is integrated with the computer".
>> I agree with Bastien.
>>
>> "builtin" == "tablet is integrated with the display" ==
>> INPUT_PROP_DIRECT (defined in the kernel)
>
> That's the other thread I started, indeed ("BuiltIn flag set
> automatically, but based on what?")
>
> INPUT_PROP_DIRECT is defined as 0x01 in linux/input.h and the libwacom code 
> checks for 0x02:
>
> linux/input.h:
>
>    #define INPUT_PROP_DIRECT               0x01    /* direct input devices */
>
> in get_device_info() in libwacom/libwacom.c:
>
>   sysfs_path = g_build_filename ("/sys/class/input", devname, 
> "device/properties", NULL);
>   if (g_file_get_contents (sysfs_path,&contents, NULL, NULL)) {
>           int flag;
>           /* 0x01: POINTER flag
>            * 0x02: DIRECT flag */
>           flag = atoi(contents);
>           *builtin = (flag&  0x02) == 0x02 ? IS_BUILTIN_TRUE : 
> IS_BUILTIN_FALSE;
>           g_free (contents);
>   }
>
>
> Why is that different? 0x02 would be INPUT_PROP_BUTTONPAD according to
> linux/input.h
>
>>> I'm sure we could deprecate the _is_builtin() function, and use a
>>> bitmask for this support instead?
>>>
>>> LIBWACOM_DEVICE_INTEGRATED_WITH_NONE = 0,
>>> LIBWACOM_DEVICE_INTEGRATED_WITH_DISPLAY = 1<<  0,
>>> LIBWACOM_DEVICE_INTEGRATED_WITH_COMPUTER = 1<<  2
>> I don't care which term/function name we use as long as they are
>> consistent with what defined in the kernel/driver.
>
> Why would that need to match the kernel definitions? Would DIRECT be
> more explicit than e.g. INTEGRATED_WITH_DISPLAY?
>
> And what would be the kernel equivalent of ISD in terms of kernel then?
>
>> Plus, they are documented.
>
> What I found for kernel is:
>
>    http://permalink.gmane.org/gmane.linux.kernel.input/21661
>    http://comments.gmane.org/gmane.linux.kernel.input/23241
>
The kernel's definitions aren't what we want anyway. DIRECT
essentially means "treat my coordinates as absolute" and POINTER means
"there is no physical object above the screen which can act as a
pointer". As Jeff points out in the first link, it'd be nicer if they
actually meant "I am built into a screen" and "you should display an
on-screen pointer" since that's what most drivers and utilities care
about.

> But there's nothing about ISD (which is what the proposed patches are
> about actually), so I am not sure I understand the need to follow the
> kernel naming convention for libwacom.
>
There's no way to get ISD status from the kernel, AFAIK. You can try
to do things heuristically, but you probably won't have much luck. A
serial connection almost certainly means ISD, unless you're using the
third-party serial Intuos kernel driver. A USB connection almost
certianly means non-ISD, unless you're using one of a very few tablet
PCs with a USB digitizer.

> Corollary question, if ISD and screen tablet can be deduced from the
> device properties in kernel, why do we need to have those in the database?
>
The screen tablet property was added to the database before the logic
to read it from the kernel was in place. Its mostly vestigial now (and
should be correctly detected if left unspecified) but I wouldn't nuke
support for it just in case.

Jason

---
When you're rife with devastation / There's a simple explanation:
You're a toymaker's creation / Trapped inside a crystal ball.
And whichever way he tilts it / Know that we must be resilient
We won't let them break our spirits / As we sing our silly song.

> Cheers,
> Olivier.
>

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to