[PATCH kdrive/ephyr v7 3/9] kdrive: introduce input hot-plugging support for udev and hal backends (#33140)
Peter Hutterer
peter.hutterer at who-t.net
Thu Feb 11 02:56:48 UTC 2016
On Mon, Feb 08, 2016 at 02:45:43PM -0500, Adam Jackson wrote:
> On Fri, 2015-12-11 at 11:43 -0200, Laércio de Sousa wrote:
>
> > +void
> > +systemd_logind_release_fd(int _major, int _minor, int fd)
> > +{
> > +}
> > +
> > +void
> > +systemd_logind_vtenter(void)
> > +{
> > +}
>
> This introduces a warning:
>
> kdrive.c:1217:1: warning: no previous prototype for 'systemd_logind_release_fd' [-Wmissing-prototypes]
> systemd_logind_release_fd(int _major, int _minor, int fd)
> ^
> kdrive.c:1222:1: warning: no previous prototype for 'systemd_logind_vtenter' [-Wmissing-prototypes]
> systemd_logind_vtenter(void)
> ^
>
> > @@ -2230,5 +2348,55 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
> > void
> > DeleteInputDeviceRequest(DeviceIntPtr pDev)
> > {
> > +#if defined(CONFIG_UDEV) || defined(CONFIG_HAL)
> > + OsBlockSIGIO();
> > RemoveDevice(pDev, TRUE);
> > +
> > + /*
> > + * Search for fds that were not unregistered correctly
> > + * by RemoveDevice() call and unregister them.
> > + * Code taken from KdInputDisable() implementation.
> > + */
>
> This seems like the sort of comment where the act of writing it is a
> sign that the code must be wrong. Why is RemoveDevice not closing the
> fd for you?
we don't have a 1:1 mapping between devices and fd (e.g. wacom devices all
hang off a single fd). Even the fd itself is a DDX concept, so RemoveDevice
cannot close the fd.
What should happen here though is that the pDev->public.devicePrivate points
to something kdrive understands and that includes the fd.
Cheers,
Peter
More information about the xorg-devel
mailing list