xserver/hw/dmx
Peter Hutterer d13cb97442 ddx: add new call to purge input devices that weren't added
Special case for the systemd-logind case in xfree86: when we're vt-switched
away and a device is plugged in, we get a paused fd from logind. Since we
can't probe the device or do anything with it, we store that device in the
xfree86 and handle it later when we vt-switch back. The device is not added to
inputInfo.devices until that time.

When the device is removed while still vt-switched away, the the config system
never notifies the DDX. It only runs through inputInfo.devices and our device
was never added to that.

When a device is plugged in, removed, and plugged in again while vt-switched
away, we have two entries in the xfree86-specific list that refer to the same
device node, both pending for addition later. On VT switch back, the first one
(the already removed one) will be added successfully, the second one (the
still plugged-in one) fails. Since the fd is correct, the device works until
it is removed again. The removed devices' config_info (i.e. the syspath)
doesn't match the actual device we addded tough (the input number increases
with each plug), it doesn't get removed, the fd remains open and we lose track
of the fd count. Plugging the device in again leads to a dead device.

Fix this by adding a call to notify the DDX to purge any remainders of devices
with the given config_info, that's the only identifiable bit we have at this
point.

https://bugs.freedesktop.org/show_bug.cgi?id=97928

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-10-26 15:35:07 +10:00
..
config dmx: Silence unused variable warning in dmxcompat 2015-12-08 18:20:13 -05:00
doc dix: Update some comments to reflect the new non-SIGIO input model 2016-06-08 11:36:32 -04:00
doxygen dmx: Run 'doxygen -u' to upgrade the doxygen config file 2015-12-08 18:20:14 -05:00
examples Fix formatting of address operators 2012-12-05 18:09:48 -06:00
glxProxy dmx/glxProxy: don't free the glx pixmap twice if AddResource fails 2016-03-08 10:19:51 -05:00
input Switch poll() users to xserver_poll() 2016-07-21 15:04:36 -04:00
man dmx: Remove ShadowFB support 2013-09-10 13:28:23 -04:00
.gitignore .gitignore: use common defaults with custom section #24239 2009-11-11 21:40:20 -08:00
Makefile.am Build fbcmap_mi.c once, rather than once for each DDX 2014-03-27 14:34:06 +00:00
dmx-config.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmx.c Convert hw/dmx to new *allocarray functions 2015-04-21 16:58:08 -07:00
dmx.h dmx: Remove ShadowFB support 2013-09-10 13:28:23 -04:00
dmx_glxvisuals.c glx: Correctly set render type enum 2013-10-24 11:16:30 -07:00
dmx_glxvisuals.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmxcb.c dmx: remove redundant redeclarations of variables from other headers 2015-02-10 18:14:44 -08:00
dmxcb.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmxclient.h Bunch of DMX warning fixes 2014-01-12 10:14:49 -08:00
dmxcmap.c Convert hw/dmx to new *allocarray functions 2015-04-21 16:58:08 -07:00
dmxcmap.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmxcursor.c Convert hw/dmx to new *allocarray functions 2015-04-21 16:58:08 -07:00
dmxcursor.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmxdpms.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmxdpms.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmxextension.c Convert hw/dmx to new *allocarray functions 2015-04-21 16:58:08 -07:00
dmxextension.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmxfont.c dix: Switch to the libXfont2 API (v2) 2016-07-18 15:25:59 -04:00
dmxfont.h dmx: remove redundant declaration of dmxFontPrivateIndex from dmxfont.h 2015-02-10 18:14:44 -08:00
dmxgc.c Convert hw/dmx to new *allocarray functions 2015-04-21 16:58:08 -07:00
dmxgc.h dmx: constify GCOps & GCFuncs pointers 2015-02-10 18:14:45 -08:00
dmxgcops.c mi: Drop plane argument from miHandleExposures 2014-10-09 11:14:53 +02:00
dmxgcops.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
dmxinit.c Convert hw/dmx to new *allocarray functions 2015-04-21 16:58:08 -07:00
dmxinit.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmxinput.c ddx: add new call to purge input devices that weren't added 2016-10-26 15:35:07 +10:00
dmxinput.h dmx: Remove SIGIO input support here too 2016-06-08 11:36:31 -04:00
dmxlog.c dmx: Annotate dmxlog.c with _X_ATTRIBUTE_PRINTF and _X_NORETURN 2012-05-01 11:36:35 +10:00
dmxlog.h dmx: Annotate dmxlog.c with _X_ATTRIBUTE_PRINTF and _X_NORETURN 2012-05-01 11:36:35 +10:00
dmxpict.c Convert hw/dmx to new *allocarray functions 2015-04-21 16:58:08 -07:00
dmxpict.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
dmxpixmap.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmxpixmap.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmxprop.c Convert hw/dmx to new *allocarray functions 2015-04-21 16:58:08 -07:00
dmxprop.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmxscrinit.c dix: Switch to the libXfont2 API (v2) 2016-07-18 15:25:59 -04:00
dmxscrinit.h api: rework the X server driver API to avoid global arrays. 2012-06-05 13:22:18 +01:00
dmxstat.c Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
dmxstat.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmxsync.c Remove fd_set from Block/Wakeup handler API 2016-07-18 15:27:51 -04:00
dmxsync.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmxvisual.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmxvisual.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dmxwindow.c Convert hw/dmx to new *allocarray functions 2015-04-21 16:58:08 -07:00
dmxwindow.h dix: Drop the third argument from WindowExposuresProcPtr 2014-10-09 11:14:44 +02:00