Hello community, here is the log from the commit of package x11-input-wacom checked in at Thu Oct 11 01:34:33 CEST 2007. -------- --- x11-input-wacom/x11-input-wacom.changes 2007-09-30 14:22:01.000000000 +0200 +++ /mounts/work_src_done/STABLE/x11-input-wacom/x11-input-wacom.changes 2007-10-10 19:03:28.000000000 +0200 @@ -1,0 +2,5 @@ +Wed Oct 10 19:03:09 CEST 2007 - mhopf@suse.de + +- Added auto-dev scanning support. + +------------------------------------------------------------------- New: ---- linuxwacom-autoprobe.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ x11-input-wacom.spec ++++++ --- /var/tmp/diff_new_pack.I31349/_old 2007-10-11 01:34:23.000000000 +0200 +++ /var/tmp/diff_new_pack.I31349/_new 2007-10-11 01:34:23.000000000 +0200 @@ -19,11 +19,12 @@ Url: http://linuxwacom.sourceforge.net/ Group: System/X11/Utilities Version: 0.7.8 -Release: 38 +Release: 41 Summary: X11 input module for wacom tablet Provides: xorg-x11-server:/usr/X11R6/%{_lib}/modules/input/wacom_drv.o Source: linuxwacom-%{version}-3.tar.bz2 Patch: linuxwacom-0.7.8-3.diff +Patch2: linuxwacom-autoprobe.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -74,6 +75,7 @@ %prep %setup -n linuxwacom-%{version}-3 %patch +%patch2 %build export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" @@ -147,6 +149,8 @@ /usr/%_lib/libwacomcfg.la /usr/%_lib/libwacomcfg.so %changelog +* Wed Oct 10 2007 - mhopf@suse.de +- Added auto-dev scanning support. * Sun Sep 30 2007 - sndirsch@suse.de - linuxwacom-0.7.8-3.diff * fixes build with xorg-server 1.4 ++++++ linuxwacom-autoprobe.diff ++++++ Only in ./src/xdrv: .xf86Wacom.c.swp diff -urp ../linuxwacom-0.7.8-3.orig/src/xdrv/wcmConfig.c ./src/xdrv/wcmConfig.c --- ../linuxwacom-0.7.8-3.orig/src/xdrv/wcmConfig.c 2007-08-15 01:12:39.000000000 +0200 +++ ./src/xdrv/wcmConfig.c 2007-10-10 15:57:37.000000000 +0200 @@ -448,26 +448,41 @@ static LocalDevicePtr xf86WcmInit(InputD local->name = dev->identifier; xfree(fakeLocal); - /* Serial Device is mandatory */ common->wcmDevice = xf86FindOptionValue(local->options, "Device"); +#ifdef LINUX_INPUT + /* Autoprobe if not given */ + if (!common->wcmDevice || !strcmp (common->wcmDevice, "auto-dev")) { + common->wcmFlags |= AUTODEV_FLAG; + if (! (common->wcmDevice = xf86WcmEventAutoDevProbe (local))) { + xf86Msg(X_ERROR, "%s: unable to probe device\n", + dev->identifier); + goto SetupProc_fail; + } + } +#else if (!common->wcmDevice) { xf86Msg(X_ERROR, "%s: No Device specified.\n", dev->identifier); goto SetupProc_fail; } +#endif + /* Lookup to see if there is another wacom device sharing * the same serial line. */ localDevices = xf86FirstLocalDevice(); - for (; localDevices != NULL; localDevices = localDevices->next) + if (common->wcmDevice) { - if (xf86WcmMatchDevice(localDevices,local)) + for (; localDevices != NULL; localDevices = localDevices->next) { - common = priv->common; - break; + if (xf86WcmMatchDevice(localDevices,local)) + { + common = priv->common; + break; + } } } diff -urp ../linuxwacom-0.7.8-3.orig/src/xdrv/xf86Wacom.c ./src/xdrv/xf86Wacom.c --- ../linuxwacom-0.7.8-3.orig/src/xdrv/xf86Wacom.c 2007-08-15 01:12:39.000000000 +0200 +++ ./src/xdrv/xf86Wacom.c 2007-10-10 17:48:41.000000000 +0200 @@ -566,6 +566,59 @@ static int xf86WcmRegisterX11Devices (Lo return TRUE; } +#ifdef LINUX_INPUT +static Bool xf86WcmIsWacomDevice (int fd, CARD16 vendor) +{ + struct input_id id; + ioctl(fd, EVIOCGID, &id); + if (id.vendor == vendor) + return TRUE; + return FALSE; +} + +/***************************************************************************** + * xf86WcmEventAutoDevProbe -- Probe for right input device + ****************************************************************************/ +#define DEV_INPUT_EVENT "/dev/input/event%d" +#define EVDEV_MINORS 32 +char *xf86WcmEventAutoDevProbe (LocalDevicePtr local) +{ + /* We are trying to find the right eventX device */ + int i; + int wait = 0; + const int max_wait = 2000; + + /* If device is not available after Resume, wait some ms */ + while (wait <= max_wait) { + for (i = 0; i < EVDEV_MINORS; i++) { + char fname[64]; + int fd = -1; + Bool is_wacom; + + sprintf(fname, DEV_INPUT_EVENT, i); + SYSCALL(fd = open(fname, O_RDONLY)); + if (fd < 0) + continue; + is_wacom = xf86WcmIsWacomDevice(fd, 0x056a); + SYSCALL(close(fd)); + if (is_wacom) { + ErrorF ("%s Wacom probed device to be %s (waited %d msec)\n", + XCONFIG_PROBED, fname, wait); + xf86ReplaceStrOption(local->options, "Device", fname); + return xf86FindOptionValue(local->options, "Device"); + } + } + wait += 100; + ErrorF("%s waiting 100 msec (total %dms) for device to become ready\n", local->name, wait); + usleep(100*1000); + } + ErrorF("%s no synaptics event device found (checked %d nodes, waited %d msec)\n", + local->name, i + 1, wait); + return FALSE; + +} +#endif + /***************************************************************************** * xf86WcmDevOpen -- * Open the physical device and init information structs. @@ -579,14 +632,22 @@ static int xf86WcmDevOpen(DeviceIntPtr p DBG(10, priv->debugLevel, ErrorF("xf86WcmDevOpen\n")); - /* Device has been open */ + /* Device has been open and not autoprobed */ if (priv->wcmDevOpenCount) return TRUE; /* open file, if not already open */ if (common->fd_refs == 0) { - if ((xf86WcmOpen (local) != Success) || (local->fd < 0)) +#ifdef LINUX_INPUT + /* Autoprobe if necessary */ + if ((common->wcmFlags & AUTODEV_FLAG) && + ! (common->wcmDevice = xf86WcmEventAutoDevProbe (local))) + ErrorF("Cannot probe device\n"); +#endif + + if (!common->wcmDevice || xf86WcmOpen (local) != Success || + local->fd < 0) { DBG(1, priv->debugLevel, ErrorF("Failed to open " "device (fd=%d)\n", local->fd)); diff -urp ../linuxwacom-0.7.8-3.orig/src/xdrv/xf86Wacom.h ./src/xdrv/xf86Wacom.h --- ../linuxwacom-0.7.8-3.orig/src/xdrv/xf86Wacom.h 2007-10-09 19:32:44.000000000 +0200 +++ ./src/xdrv/xf86Wacom.h 2007-10-10 15:10:19.000000000 +0200 @@ -446,6 +446,7 @@ struct _WacomDeviceClass /* set if the /dev/input driver should wait for SYN_REPORT events as the end of record indicator */ #define USE_SYN_REPORTS_FLAG 8 +#define AUTODEV_FLAG 16 #endif #define DEVICE_ISDV4 0x000C @@ -601,6 +602,9 @@ LocalDevicePtr xf86WcmAllocatePad(void); Bool xf86WcmOpen(LocalDevicePtr local); +/* device autoprobing */ +char *xf86WcmEventAutoDevProbe (LocalDevicePtr local); + /* common tablet initialization regime */ int xf86WcmInitTablet(LocalDevicePtr local, WacomModelPtr model, const char* id, float version); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org