Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Feb 2011 20:28:10 +0100
From:      Cyril Brulebois <kibi@debian.org>
To:        Dan Nicholson <dbn.lists@gmail.com>
Cc:        freebsd-x11@freebsd.org, xorg-devel@lists.x.org, debian-bsd@lists.debian.org
Subject:   Re: xorg-server/*bsd: moving from hal support to devd support?
Message-ID:  <20110213192810.GB27580@debian.org>
In-Reply-To: <AANLkTikKtdLjjd5upk=J2wQVgSvmS8s7snHWe3US0TEj@mail.gmail.com>
References:  <20110213124019.GH7840@debian.org> <AANLkTikKtdLjjd5upk=J2wQVgSvmS8s7snHWe3US0TEj@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--GvznHscUikHnwW2p
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Dan,

Dan Nicholson <dbn.lists@gmail.com> (13/02/2011):
> As someone who's worked on the udev backend for input devices, what
> needs to be provided is pretty simple.

thanks!

> 1. X needs to know about devices that are already plugged in when
> the server starts

I haven't looked yet, but probably not the hardest part.

> 2. X needs to get events for devices when they are inserted or
> removed

I think that's one of the core point, but apparently devd lets people
define actions to perform when =E2=80=9Cstuff=E2=80=9D happens, based on sy=
stem,
subsystem, bus, etc. Those actions can then use variables like
$device, $class, $vendor, $product, etc. Looks like a good start.

All variables are listed on:
  http://www.freebsd.org/cgi/man.cgi?query=3Ddevd.conf&sektion=3D5

below =E2=80=9CVariables that can be used with the match statement=E2=80=9D=
 (around
the middle of the page).

> 3. X needs a basic level of metadata about the device to allow the
> user to match to the device. Basically, filling out the
> InputAttributes struct (see include/input.h):
>=20
> typedef struct _InputAttributes {
>     char                *product;
>     char                *vendor;
>     char                *device;
>     char                *pnp_id;
>     char                *usb_id;
>     char                **tags; /* null-terminated */

Should be trivial given what I wrote above.

>     uint32_t            flags;
> } InputAttributes;
>=20
> #define ATTR_KEYBOARD (1<<0)
> #define ATTR_POINTER (1<<1)
> #define ATTR_JOYSTICK (1<<2)
> #define ATTR_TABLET (1<<3)
> #define ATTR_TOUCHPAD (1<<4)
> #define ATTR_TOUCHSCREEN (1<<5)
>=20
> Where flags is currently just a bitfield for the ATTR_* macros and
> tags are freeform labels coming from the backend (optional). After
> that it gets handed off to the DDX.

Here, I guess pinging the kernel modules about $hardware they're
handling should be sufficient to get what we need.

Julien mentioned hal's hald/freebsd/probing/probe-hiddev.c on IRC, and
HID_USAGE2 seems to do what we want:
| ./hald/freebsd/probing/probe-hiddev.c:	  case HID_USAGE2(HUP_GENERIC_DESK=
TOP, HUG_MOUSE):
| ./hald/freebsd/probing/probe-hiddev.c:	  case HID_USAGE2(HUP_GENERIC_DESK=
TOP, HUG_JOYSTICK):
| ./hald/freebsd/probing/probe-hiddev.c:	  case HID_USAGE2(HUP_GENERIC_DESK=
TOP, HUG_GAME_PAD):
| ./hald/freebsd/probing/probe-hiddev.c:	  case HID_USAGE2(HUP_GENERIC_DESK=
TOP, HUG_KEYBOARD):
| ./hald/freebsd/probing/probe-hiddev.c:	  case HID_USAGE2(HUP_GENERIC_DESK=
TOP, HUG_KEYPAD):

So info to fill flags is apparently available, and just needs to be
used, either on the devd side to set some flags, or on X's side to
decide about devices to discard or take into account.

I'll try and get that to work.

KiBi.

--GvznHscUikHnwW2p
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk1YMMoACgkQeGfVPHR5Nd1O1ACdF/yPpCf4aORM8dg0SYoePcdg
U9gAn0ndVprXdFsOF2qSF8nhFXsLIIcv
=RkFn
-----END PGP SIGNATURE-----

--GvznHscUikHnwW2p--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110213192810.GB27580>