Age | Commit message (Collapse) | Author | Files | Lines |
|
for input devices we handle change like remove/add, but for
drm devices we get change events when we hotplug outputs,
so lets just ignore change at this level, and let the drivers
handle it. We may in the future want to route driver udev
from here instead.
Reported-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
This respects the seat tag for hotplugged video devices at X start.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
this is a simple clean-up that is useful to stop further propogation
of this construct.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
The indenter seems to have gotten confused by initializing arrays of
structs with the struct defined inline - for predefined structs it did
a better job, so match that.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
|
|
This adds callbacks into the ddx for udev gpu hotplug.
v2: fix some strncmp returns.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
On Linux in order for future hotplug work, we are required to interface
to udev to detect device creation/removal. In order to try and get
some earlier testing on this, this patch adds the ability to use
udev for device enumeration on Linux.
At startup the list of drm/kms devices is probed and this info is
used to load drivers.
A new driver probing method is introduced that passes the udev
device info to the driver for probing.
The probing integrates with the pci probing code and will fallback
to the pci probe and old school probe functions in turn.
The flags parameter to the probe function will be used later
to provide hotplug and gpu screen flags for the driver to behave
in a different way.
This patch changes the driver ABI, all drivers should at least
be set with a NULL udev probe function after this commit.
v2: rename to platform bus, now with 100% less udev specific,
this version passes config_odev_attribs around which are an array
of id/string pairs, then the udev code can attach the set of attribs
it understands, the OS specific code can attach its attrib, and then
the core/drivers can lookup the required attribs.
also add MATCH_PCI_DEVICES macro.
This version is mainly to address concerns raised by ajax.
v3: Address comments from Peter.
fix whitespace that snuck in.
rework to use a linked list with some core functions that
xf86 wraps.
v4: add free list, fix struct whitespace.
ajax this address most of your issues?
v5: drop probe ifdef, fix logic issue
v6: some overhaul after more testing.
Implement primaryBus for platform devices.
document hotplug.h dev attribs - drop sysname attrib
fix build with udev kms disabled
make probing work like the PCI probe code,
match against bus id if one exists, or primary device.
RFC: add new bus id support "PLAT:syspath". we probably
want to match on this a bit different, or use a different
property maybe. I was mainly wanting this for use with
specifying usb devices in xorg.conf directly, but PLAT:path
could also work I suppose.
v6.1: add missing noop platform function
v7: fix two interactions with pci probing and slot claiming, prevents
pci and platform trying to load two drivers for same slot.
v8: test with zaphod mode on -ati driver, fixup resulting issue
clean up common probe code into another function, change busid
matching to allow dropping end of strings.
v9: fix platform probing logic so it actually works.
v9.1: fix pdev init to NULL properly.
v10: address most of Keith's concerns.
v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com>
v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
In order to use udev for gpu enumeration, we need to init udev earlier
than input initialisations. This splits the config init stuff so that udev
pre init sets up before output initialisation.
this is just a prepatory patch, doesn't change anything major.
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
|
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:
-bap
-psl
-T PrivatePtr
-T pmWait
-T _XFUNCPROTOBEGIN
-T _XFUNCPROTOEND
-T _X_EXPORT
The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.
The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.
The comparison was done with this script:
dir1=$1
dir2=$2
for dir in $dir1 $dir2; do
(cd $dir && find . -name '*.o' | while read file; do
dir=`dirname $file`
base=`basename $file .o`
dump=$dir/$base.dump
objdump -d $file > $dump
done)
done
find $dir1 -name '*.dump' | while read dump; do
otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
diff -u $dump $otherdump
done
Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Pointed out by coverity scan.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
_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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
|
|
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>
|
|
input-api
Conflicts:
dix/getevents.c
hw/xfree86/common/xf86Xinput.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
"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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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.
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|