[PATCH] xfree86: store the InputAttributes in the input device.

Dan Nicholson dbn.lists at gmail.com
Tue May 25 14:52:05 PDT 2010


On Tue, May 25, 2010 at 2:23 PM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> On Tue, May 25, 2010 at 08:34:29AM -0700, Dan Nicholson wrote:
>> On Tue, May 25, 2010 at 12:15 AM, Peter Hutterer
>> <peter.hutterer at who-t.net> wrote:
>> > InputAttributes largely decide which configuration values get merged from
>> > the xorg.conf.d snippets. While they are available in the config backend,
>> > they are not available for any other callers of NewInputDeviceRequest().
>> >
>> > Drivers implementing driver-side hotplugging do not have access to these
>> > attributes and cannot have xorg.conf.d snippets specific to dependent
>> > devices. For example, the following case cannot work right now:
>> >
>> > Section "InputClass"
>> >        MatchProduct "Wacom"
>> >        Option "PressCurve" "0 0 100 100"
>> >        ...
>> > EndSection
>> >
>> > Section "InputClass"
>> >        MatchProduct "Wacom"
>> >        MatchProduct "eraser"
>> >        Option "PressCurve" "10 10 50 50"
>> >        ...
>> > EndSection
>> >
>> > The second section is not triggered, as the wacom driver cannot supply the
>> > InputAttributes to NewInputDeviceRequest().
>>
>> The second section is also not entirely valid since there can only be
>> one MatchProduct used per section. :) I don't know what the best way
>> to differentiate the wacom multiple devices per device file case is.
>> Maybe you could munge the product name to "Wacom Eraser" or something.
>
> hmm, this is quite bad then. I just assumed it worked and when I tried the
> above it must have worked only because I had just one device with "eraser"
> in the name.
> scrapping the product name isn't really an option, it's complicated enough
> as it is already (at least for wacom devices) and having the model
> identifier in the name is quite useful.
>
> I think there's a distinct need for supporting & on top of the current |,
> it's quite hard to get generic matches for subdevices otherwise.

Yeah, I'd say subdevices are hard. What are you planning on setting
the product name to? Just tacking " eraser" onto the end of whatever
is currently there? Some options I can think of here:

1. Set a tag from wacom to differentiate the eraser. I.e. take
attrs->tags, realloc another slot on the array and set it to "eraser".
Then MatchTag "eraser" in the .conf.

2. Add a subdevice string in InputAttributes + MatchSubdevice in
xorg.conf. Pretty lame, but this probably won't be the last time
multiple devices per device file will be needed.

3. Handle & matching by making multiple Match* lines mean they all
have to match. This would unfortunately make the parsing and matching
more difficult, but is doable. On the other hand, you're still munging
the product name in this case, which doesn't seem that nice.

--
Dan


More information about the xorg-devel mailing list