[PATCH] xfree86: use xf86AllocateInput() for xorg.conf devices too.

Peter Hutterer peter.hutterer at who-t.net
Sun Dec 5 21:08:56 PST 2010


Single allocation point for input devices, most notably a single point to
reset default values.
Without this patch, the file descriptor default was -1 for hotplugged
devices and 0 for config devices. Drivers that don't overwrite the default
themselves would thus fail if configured in the xorg.conf.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---

Second part for the #32115 fix.

 hw/xfree86/common/xf86Config.c |    2 +-
 hw/xfree86/common/xf86Xinput.c |    2 +-
 hw/xfree86/common/xf86Xinput.h |    1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index c352f3c..ae9592e 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1458,7 +1458,7 @@ configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp)
     irp = layout->lay_input_lst;
     count = 0;
     while (irp) {
-	indp[count] = xnfalloc(sizeof(InputInfoRec));
+	indp[count] = xf86AllocateInput();
 	if (!configInput(indp[count], irp->iref_inputdev, X_CONFIG)) {
 	    while(count--)
 		free(indp[count]);
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 81bb707..2e0d80b 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -652,7 +652,7 @@ IgnoreInputClass(const InputInfoPtr idev, const InputAttributes *attrs)
     return ignore;
 }
 
-static InputInfoPtr
+InputInfoPtr
 xf86AllocateInput(void)
 {
     InputInfoPtr pInfo;
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index 3a17116..1b0b16f 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -155,6 +155,7 @@ extern _X_EXPORT void xf86DisableDevice(DeviceIntPtr dev, Bool panic);
 extern _X_EXPORT void xf86EnableDevice(DeviceIntPtr dev);
 /* not exported */
 int xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL is_auto);
+InputInfoPtr xf86AllocateInput(void);
 
 /* xf86Helper.c */
 extern _X_EXPORT void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags);
-- 
1.7.3.2


More information about the xorg-devel mailing list