[RFC] X Input Driver specification

Magnus Vigerlöf Magnus.Vigerlof at home.se
Thu Apr 5 14:30:50 PDT 2007

On Thursday 05 April 2007 22:39, Simon Thum wrote:
> Hi Magnus,
> I'm in charge of bug#8583, which would benefit from some single point
> that would be called on device init (or just before). Currently my
> integration is a little hacky and I think I've seen other code which
> might be better placed in such a function.

Currently (even without my patch-set) the xserver will call PreInit and 
DEVICE_INIT at startup and at an input device hotplug add request, it will 
also call DEVICE_ON in that case. DEVICE_ON/OFF will be called at every 
VT-switch as well, maybe one/several of these points is good enough?

> What I have in mind is a single point (in DIX as well as backends) to
> perform device-class specific stuff just before the device comes to action.
> Maybe I just missed it, but I haven't seen something like that in the
> code and your proposal. So I'd just like to suggest it :)

If there's a need to make changes in DIX, maybe the functions that make the 
actual calls for DEVICE_* would be a suitable place? In DEVICE_INIT you will 
have access to all structures that will be allocated for the input device by 
the core part of the xserver, so that's the last place you may have to make 
device-specific initialization of the allocated structures.

ActivateDevice [+187 dix/devices.c] (DEVICE_INIT)
EnableDevice [+142 dix/devices.c] (DEVICE_ON)
DisableDevice [+168 dix/devices.c] (DEVICE_OFF)
CloseDevice [+408 dix/devices.c] (DEVICE_CLOSE)

I hope the current callbacks will prove sufficient for your needs.

The proposal is more a try to define what the xserver does in the current 
implementation so that the different input devices knows what they should be 
doing at the different callbacks, rather than to try to introduce changes to 
the interface. The wacom driver (at least) seems to have suffered from this 
lack of a spec, and my gut tells me that we're not the only one that might be 
affected by this.

 Magnus V

More information about the xorg mailing list