summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-01-30 03:20:07 +0000
committerKeith Packard <keithp@keithp.com>2013-02-08 09:06:14 -0800
commit9f79e93b6b3416055d08a0e8f9f16d5fd0649e36 (patch)
tree5a9fce08b7c8a0b6fcede5f5d0ff1d6647370d03 /dix
parentb58221f9da8c549d979215271359c6cd88b5568a (diff)
Short-cut the input device cleanup process during AbortServer()
If we're about to abort, we're already in the signal handler and cannot call down to the default device cleanup routines (which reset, free, alloc, and do a bunch of other things). Add a new DEVICE_ABORT mode to signal a driver's DeviceProc that it must reset the hardware if needed but do nothing else. An actual HW reset is only required for some drivers dealing with the HW directly. This is largely backwards-compatible, hence the input ABI minor bump only. Drivers we care about either return BadValue on a mode that's not DEVICE_{INIT|ON|OFF|CLOSE} or print an error and return BadValue. Exception here is vmmouse, which currently ignores it and would not reset anything. This should be fixed if the reset is required. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'dix')
-rw-r--r--dix/devices.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/dix/devices.c b/dix/devices.c
index 530f15d66..be236dd70 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1056,6 +1056,25 @@ CloseDownDevices(void)
}
/**
+ * Signal all devices that we're in the process of aborting.
+ * This function is called from a signal handler.
+ */
+void
+AbortDevices(void)
+{
+ DeviceIntPtr dev;
+ nt_list_for_each_entry(dev, inputInfo.devices, next) {
+ if (!IsMaster(dev))
+ (*dev->deviceProc) (dev, DEVICE_ABORT);
+ }
+
+ nt_list_for_each_entry(dev, inputInfo.off_devices, next) {
+ if (!IsMaster(dev))
+ (*dev->deviceProc) (dev, DEVICE_ABORT);
+ }
+}
+
+/**
* Remove the cursor sprite for all devices. This needs to be done before any
* resources are freed or any device is deleted.
*/