summaryrefslogtreecommitdiff
path: root/config
AgeCommit message (Collapse)AuthorFilesLines
2011-12-06hal: free tmp_val in one missing caseDave Airlie1-0/+1
Pointed out by coverity scan. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-03Merge remote-tracking branch 'herrb/master'Keith Packard4-0/+284
2011-10-03udev: make use of udev_enumerate_add_match_tag() only when it is availableLennart Poettering1-0/+4
udev_enumerate_add_match_tag() and udev_monitor_filter_add_match_tag() are mostly optimizations, hence simply skip these calls if they are not available in the installed version of libudev. This should fix the build on older versions of udev. [airlied: fixes tinderbox failures on RHEL6] Signed-off-by: Lennart Poettering <lennart@poettering.net> Reviewed-by: Dave Airlie <airlied@redhat.com> Tested-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-30Add a 'wscons' autoconf mechanism to configure input devices on BSD.Matthieu Herrb4-0/+284
This does not really handle hotplug (it's handled inside the kernel, by the 'mux' devices), but uses the wscons console driver configuration to figure out the keyboard layout and the list of pointing devices found by the kernel. Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-22input: make InputOption opaque, provide interface functions.Peter Hutterer5-101/+46
InputOptions is not switched to use struct list for a future patch to unify it with the XF86OptionRec. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-08-22config: use add_option for '_source' tooPeter Hutterer3-25/+3
_source was being allocated manually, with all other options added to that list through add_option. Skip the manual part, allocate the first option _source with add_option too. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22config: return the new InputOption from add_option.Peter Hutterer2-4/+11
Change add_option to return the new InputOption on success, or NULL failure. This way we can at least check for errors in callers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22config: fix a log messagePeter Hutterer1-1/+1
PRODUCT was taken from the parent, hence ppath. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22config: add udev/systemd multi-seat supportLennart Poettering1-0/+18
Add support for multi-seat-aware input device hotplugging. This implements the multi-seat scheme explained here: http://www.freedesktop.org/wiki/Software/systemd/multiseat This introduces a new X server switch "-seat" which allows configuration of the seat to enumerate hotplugging devices on. If specified the value of this parameter will also be exported as root window property Xorg_Seat. To properly support input hotplugging devices need to be tagged in udev according to the seat they are on. Untagged devices are assumed to be on the default seat "seat0". If no "-seat" parameter is passed only devices on "seat0" are used. This means that the new scheme is perfectly compatible with existing setups which have no tagged input devices. Note that the -seat switch takes a completely generic identifier, and that it has no effect on non-Linux systems. In fact, on other OSes a completely different identifier scheme for seats could be used but still be exposed with the Xorg_Seat and -seat. I tried to follow the coding style of the surrounding code blocks if there was any one could follow. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-27config: don't fail if a device vanished by the time we managed to look at itLennart Poettering1-0/+5
The nature of hotplug is that a device we enumerated might already be gone by the time we look at it, so don't assume otherwise. Signed-off-by: Lennart Poettering <lennart@poettering.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-27config: limit the kernel subsystems we look for devices inLennart Poettering1-0/+7
Don't enumerate/monitor all devices of the system (since that can be quite a few), but limit our search to devices from the "input" subsystem, as well as the "tty" subsystem (to cover Wacom tablets). This should make X start up a bit faster and reduce the number of unnecessary wake-ups of the X server. Signed-off-by: Lennart Poettering <lennart@poettering.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-27config: process udev "changed" and "add" events in the same code pathsLennart Poettering1-5/+3
udev gives no guarantee that before each "changed" event for a device there's an "add" event, or that before each "remove" is an "add", or that before each "add" there was no "add" already and so on. Users can trigger these events at any time with "udevadm trigger", and netlink is a lossy transport, hence the events can come in unexpected ordering. With other words: regardless which event is generated, the X server must not choke on it and make the best of it, hence make sure that if we get an "add" event for an existing device we don't add the device a second time. Signed-off-by: Lennart Poettering <lennart@poettering.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-24config: handle device change event properlyErkki Seppälä1-0/+4
wakeup_handler in udev.c wasn't dealing with udev change events. There are situations when a device can gain its input capabilities after it has been added to the system and therefore the change events must be handled as well. The change is handled as a consecutive device removal and addition. Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi> Signed-off-by: Stefan Kost <Stefan.Kost@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-09config: Ensure that stolen option list elements are released.Rami Ylimäki2-6/+6
NewInputDeviceRequest steals the contents of option list elements but doesn't use the elements themselves for anything. Therefore the list elements need to be released always. Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-12-31udev: Fix removing of the wake up handlerPauli Nieminen1-1/+1
RemoveBlockAndWakeupHandlers requires caller to pass same block data parameter as for RegisterBlockAndWakeupHandlers. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-31udev: Add strdups to kill const warningsDaniel Stone1-5/+12
InputAttributes wants non-const members, and while it appears safe to cast it, just leave it be for the moment. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-12-07Convert alloc+sprintf pairs into asprintf() & XNFasprintf() callsAlan Coopersmith1-6/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-12-07Convert existing Xprintf style calls to asprintf styleAlan Coopersmith2-7/+11
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-11-19XF86CONFIGDIR is undefined when built with --disable-xorg (#28672)Dan Horák1-0/+2
The 10-evdev.conf file gets installed as /usr/share/X11/10-evdev.conf on platforms that built the server with --disable-xorg like s390/s390x. The definition/installation should be guarded with "if XORG" because it makes sense only when built with xorg. X.Org Bug 28672 <http://bugs.freedesktop.org/show_bug.cgi?id=28672> Signed-off-by: Dan Horák <dan@danny.cz> Acked-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-11Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into ↵Peter Hutterer1-5/+0
input-api Conflicts: dix/getevents.c hw/xfree86/common/xf86Xinput.h Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-11config: remove mention of AllowEmptyInputPeter Hutterer1-5/+0
"You will probably want to add the following option to the ServerFlags of your xorg.conf: Option "AllowEmptyInput" "True"" I can't imagine why you would want to do that. My life is painful enough already. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-10-15Merge branch 'master' into input-apiPeter Hutterer1-17/+9
Conflicts: config/udev.c hw/xfree86/common/xf86Helper.c hw/xfree86/common/xf86Module.h hw/xfree86/common/xf86Xinput.h hw/xfree86/os-support/linux/lnx_init.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-09-01config: expose config_info as an input option.Peter Hutterer2-10/+3
config_info is the only reliable indicator we have in the server for duplicate devices (drivers can test for maj/min on fds as well). Don't set this after the device has been initialized but assume it's important enough to set during NIDR. This makes the option "config_info" available to the drivers as well. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-09-01Fix udev population of Bluetooth input device product IDsChase Douglas1-17/+9
The udev device_added function takes the vendor and model IDs of added devices and converts them into an attribute that can be matched for by an InputClass configuration using MatchUSBID. Currently, the udev mechanism works for USB devices, but fails to work properly for Bluetooth devices. The product IDs of the event node are actually the IDs of the Bluetooth receiver instead of the device. This patch reads the product ID from the PRODUCT property of the parent of the added device. This tag is set correctly for both USB and Bluetooth input devices. The following devices have been tested by specifying individual InputClass sections in xorg.conf: * Apple Keyboard (Bluetooth) * Apple Magic Trackpad (Bluetooth) * Apple Magic Mouse (Bluetooth) * Microsoft Bluetooth Notebook Mouse 5000 (Bluetooth) * Microsoft IntelliMouse Optical (USB) * N-Trig Touchscreen (USB) * Wacom Bamboo Touch (USB) Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-11config: Replace xstrdup with strdup in add_option()Mikhail Gusarov1-1/+1
All callers of add_option pass string literal as "key" argument except one, where non-NULL condition is guarded by if(). Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-06-11Get rid of xstrdup when argument is definitely non-NULLMikhail Gusarov4-15/+15
Replace xstrdup with strdup when either constant string is being duplicated or argument is guarded by conditionals and obviously can't be NULL Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-06-11config: remove redundant DBUS API define, require dbus-1 >= 1.0Peter Hutterer1-1/+0
It's still being pulled in by the HAL CFLAGS but the requirement to define this was dropped from DBus pre 1.0 (November 2006). This means we require dbus 1.0 now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-06-11config: Script to convert HAL fdi settings to InputClass sectionsDan Nicholson2-1/+203
In the new world of udev and InputClass, x11_* settings from HAL fdi files will not be honored. This script converts those settings into valid InputClass sections that can be dropped into xorg.conf.d. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-11xfree86: Match devices based on USB IDDan Nicholson2-0/+38
Sometimes the vendor and product names aren't specific enough to target a USB device, so expose the numeric codes in the ID. A MatchUSBID entry has been added that supports shell pattern matching when fnmatch(3) is available. For example: MatchUSBID "046d:*" The IDs are stored in lowercase hex separated by a ':' like "lsusb" or "lspci -n". Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-11xfree86: Match devices based on PnP IDDan Nicholson2-1/+11
Serial input devices lack properties such as product or vendor name. This makes matching InputClass sections difficult. Add a MatchPnPID entry to test against the PnP ID of the device. The entry supports a shell pattern match on platforms that support fnmatch(3). For example: MatchPnPID "WACf*" A match type for non-path pattern matching, match_pattern, has been added. The difference between this and match_path_pattern is the FNM_PATHNAME flag in fnmatch(3). Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-10config/hal: Missing newline in log messageDan Nicholson1-1/+1
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-10config/udev: Add verbose info when fetching udev propertiesDan Nicholson1-3/+36
Give the user a chance to see why their input devices are being ignored, even if they have to start the server with -logverbose. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-10config/hal: don't leak the input.tags propertyDan Nicholson1-1/+4
Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-06Remove more superfluous if(p) checks around free(p)Mikhail Gusarov2-36/+18
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ -if(E) { free(E); } +free(E); Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-26Revert "Add a "flags" field to DeleteInputDeviceRequest."Keith Packard2-2/+2
Peter wants to get a larger patch sequence put together and I didn't read past the commit message to see the 'don't take this patch please'. This reverts commit 531ff40301975519af7b20109c17d296312d3f2b.
2010-05-25Add a "flags" field to DeleteInputDeviceRequest.Peter Hutterer2-2/+2
Some input drivers need to implement an internal hotplugging scheme for dependent devices to provide multiple X devices off one kernel device file. Such dependent devices can be added with NewInputDeviceRequest() but they are not removed when the config backend calls DeleteInputDeviceRequest(), leaving the original device to clean up. Example of the wacom driver: config/udev calls NewInputDeviceRequest("stylus") wacom PreInit calls NewInputDeviceRequest("eraser") NewInputDeviceRequest("pad") NewInputDeviceRequest("cursor") PreInit finishes. When the device is removed, the config backend only calls DeleteInputDeviceRequest for "stylus". The driver needs to call DeleteInputDeviceRequest for the dependent devices eraser, pad and cursor to clean up properly. However, when the server terminates, DeleteInputDeviceRequest is called for all devices - the driver must not remove the dependent devices to avoid double-frees. There is no method for the driver to detect why a device is being removed, leading to elaborate guesswork and some amount of wishful thinking. Though the input driver's UnInit already supports flags, they are unused. This patch uses the flags to supply information where the DeleteInputDeviceRequest request originates from, allowing a driver to selectively call DeleteInputDeviceRequest when necessary. Also bumps XINPUT ABI. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov4-46/+46
The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-08Move 10-evdev.conf to system config dir $datadir/X11/xorg.conf.dDan Nicholson1-1/+1
Since the server searches in a vendor specific path now, we can install the evdev catchall there without disturbing local administration files. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-04-08config: only match sane devices in 10-evdev.confPeter Hutterer1-2/+34
Having a generic catchall also adds devices like accelerometers. These devices make X unusable, hence restrict matching to "known sane" devices like pointers, touchpads, keyboards, tablets and touchscreens. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Julien Cristau <jcristau@debian.org> Acked-by: Dan Nicholson <dbn.lists@gmail.com> Acked-by: James Cloos <cloos@jhcloos.com>
2010-04-01Install 10-evdev.conf in $(prefix)/etc/X11/xorg.conf.d under udevKeith Packard2-1/+12
udev needs some xorg.conf file to tell it to load a suitable input driver, 10-evdev.conf is as simple as they come, mapping all evdev devices to the evdev driver. Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-26config/udev: Prefer product name from attribute rather than ueventDan Nicholson1-2/+5
The input device product name for evdev devices in the kernel uevent has embedded quotes that aren't expected here. Use the sysfs name attribute instead, which does not suffer this problem. The uevent name will be used as a fallback if no name attribute is found. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-15udev: Don't filter subsystem "input"Thomas Jaeger1-6/+0
This allows serial wacom devices to work, whose subsystem is "tty". Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-11Add tag matching to input attributes.Peter Hutterer2-0/+19
Tags may be a list of comma-separated strings that match against a MatchTag InputClass section. If any of the tags specified for a device match against the MatchTag of the section, this match is evaluated true and passed on to the next match condition. Tags are specified as "input.tags" (hal) or "ID_INPUT.tags" (udev), the value of the tags is case-sensitive and require an exact match (not a substring match). i.e. "quirk" will not match "QUIRK", "need_quirk" or "quirk_needed". Example configuration: udev: ENV{ID_INPUT.tags}="foo,bar" hal: <merge key="input.tags" type="string">foo,bar</merge> xorg.conf: Section "InputClass" Identifier "foobar quirks" MatchTag "foo|foobar" Option "Foobar" "on" EndSection Where the xorg.conf section matches against any device with the tag "foo" or tag "foobar" set. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2009-12-30config: add libudev input-hotplug backendJulien Cristau5-72/+369
Add a backend using libudev for input hotplug, and disable the hal and dbus backends if this one is enabled. XKB configuration happens using xkb{rules,model,layout,variant,options} properties (case-insensitive) on the device. We fill in InputAttributes to allow configuration through InputClass in Xorg. Requires udev 148 for the input_id helper and ID_INPUT* properties. Signed-off-by: Julien Cristau <jcristau@debian.org> Acked-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-12-22config: Introduce InputAttributes in NewInputDeviceRequestDan Nicholson2-2/+25
In order to give NewInputDeviceRequest more information, a new InputAttributes type is introduced. Currently, this collects the product and vendor name, device path, and sets booleans for attributes such as having keys and/or a pointer. Only the HAL backend fills in the attributes, though. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
2009-08-14config: don't shutdown the libhal ctx if it failed to initialize (#23213)Peter Hutterer1-10/+11
Regression introduced by b1c3dc6ae226db178420e3b5f297b94afc87c94c. Shutting down the libhal_ctx if the init failed may cause an abort. This can happen if hald is not yet running at server startup. X.Org Bug 23213 <http://bugs.freedesktop.org/show_bug.cgi?id=23213> Tested-by: Stefan Dirsch Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-28config: add HAL error checksRémi Cardona1-10/+22
This patch simplifies error handling in the HAL code and fixes a segfault if libhal_find_device_by_capability() failed. Fixes http://bugs.gentoo.org/278760 Based on a patch by Martin von Gagern <Martin.vGagern@gmx.net> Signed-off-by: Rémi Cardona <remi@gentoo.org> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-07config: fix build after XI2 API changes to RemoveDevice.Simon Thum1-1/+1
This patch fixes the build with --enable-config-dbus is enabled (default disabled). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08Don't printf NULL pointers on HAL connection errorAlan Coopersmith1-3/+6
Fixes Solaris bug 6801386 Xorg core dumps on startup if hald not running http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6801386 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-02-10config: if we can't connect to HAL, listen for a startup notification.Peter Hutterer1-6/+105
If HAL isn't available when we try to connect, the registered NameOwnerChanged signal handler waits until HAL is available. Once we connected to HAL, we unregister the signal handler again. This allows HAL to be started in parallel or after the server has started. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>