Hi Peter,

Peter Hutterer said the following on 11/28/2012 01:43 AM:
> [...]
> I have to admit, this confused me quite a bit during testing (reason was
> that I forgot to install the data files at first, so list-local-devices gave
> me wrong values).
>
> turns out integration_flags is the one read from the kernel and can only be
> DISPLAY or NONE, so we need this weird construct to keep the SYSTEM alive
> (if it is there in the database).
>
> Now, that brings up the question: do we really want to override
> the device database entries with kernel-queried ones?

It should be the other way around. The kernel flags are used only if 
the integration flags are not set in the database.

get_device_info() which is the routines that reads the kernel flags is 
called from libwacom_new_from_path();

libwacom_new_from_path() passes an "integration_flags" local variable 
to get_device_info() which is set based on the kernel flags.

Then only the display part of the flag is used to update the device flags:


     if (device) {
         if (integration_flags == WACOM_DEVICE_INTEGRATED_DISPLAY)
             ret->integration_flags |= WACOM_DEVICE_INTEGRATED_DISPLAY;
         else if (integration_flags == WACOM_DEVICE_INTEGRATED_NONE)
             ret->integration_flags &= ~WACOM_DEVICE_INTEGRATED_DISPLAY;

         return ret;
     }

(was like that with is_builtin, so nothing new here). The "system" 
part of the integration flags is left untouched and remains to 
whatever is set in the database (the kernel does not allow to 
automatically determine ISDs)

>> [...]
>> +WacomIntegrationFlags libwacom_get_integration_flags (WacomDevice *device)
>> +{
> sorry, I didn't spot this earlier, this should be const WacomDevice *device.
> (only noticed that when doing some printf testing on my device). Given that
> is_builtin, is_reversible, etc aren't const we should update all of them in
> a follow-up patch.
>

Yes, I simply copy/pasted from one of the previous functions... I'll 
send a separate global "constification" patch.

Cheers,
Olivier.

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to