Age | Commit message (Collapse) | Author | Files | Lines |
|
Erroneous condition caused us to keep going with all devices that didn't have
ID_INPUT set.
Fixes: 5aad81445c8c3d6
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104382
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit a309323328d9d6e0bf5d9ea1d75920e53b9beef3)
|
|
Historically we didn't need to care about this case but more devices are
having invalid types set and they cannot be unset with a hwdb entry (which
doesn't handle the empty string). Allow for "0" to mean "unset" because
anything else would be crazy anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 5aad81445c8c3d6b7b30d503cfe26027fa482870)
|
|
Special case for the systemd-logind case in xfree86: when we're vt-switched
away and a device is plugged in, we get a paused fd from logind. Since we
can't probe the device or do anything with it, we store that device in the
xfree86 and handle it later when we vt-switch back. The device is not added to
inputInfo.devices until that time.
When the device is removed while still vt-switched away, the the config system
never notifies the DDX. It only runs through inputInfo.devices and our device
was never added to that.
When a device is plugged in, removed, and plugged in again while vt-switched
away, we have two entries in the xfree86-specific list that refer to the same
device node, both pending for addition later. On VT switch back, the first one
(the already removed one) will be added successfully, the second one (the
still plugged-in one) fails. Since the fd is correct, the device works until
it is removed again. The removed devices' config_info (i.e. the syspath)
doesn't match the actual device we addded tough (the input number increases
with each plug), it doesn't get removed, the fd remains open and we lose track
of the fd count. Plugging the device in again leads to a dead device.
Fix this by adding a call to notify the DDX to purge any remainders of devices
with the given config_info, that's the only identifiable bit we have at this
point.
https://bugs.freedesktop.org/show_bug.cgi?id=97928
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
|
|
The dbus teardown code is called when the server fatal errors even if
that is before dbus has ever been initialized. By statically
initializing the value of bus_info.fd, we avoid calling RemoveNotifyFd
on stdin.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
This avoids having the server running inside libudev from two threads
at once, which it appears to not like.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
This removes all of the SIGIO handling support used for input
throughout the X server, preparing the way for using threads for input
handling instead.
Places calling OsBlockSIGIO and OsReleaseSIGIO are marked with calls
to stub functions input_lock/input_unlock so that we don't lose this
information.
xfree86 SIGIO support is reworked to use internal versions of
OsBlockSIGIO and OsReleaseSIGIO.
v2: Don't change locking order (Peter Hutterer)
v3: Comment weird && FALSE in xf86Helper.c
Leave errno save/restore in xf86ReadInput
Squash with stub adding patch (Peter Hutterer)
v4: Leave UseSIGIO config parameter so that
existing config files don't break (Peter Hutterer)
v5: Split a couple of independent patch bits out
of kinput.c (Peter Hutterer)
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
The tablet pads have been separate kernel devices for a while now and
libwacom has labelled them with the udev ID_INPUT_TABLET_PAD for over a year
now. Add a new MatchIsTabletPad directive to apply configuration options
specifically to the Pad part of a tablet.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
|
|
This patch introduces a new flag ATTR_KEY for hotplugged input devices,
so we can better distinguish between real keyboards (i.e. devices with
udev property ID_INPUT_KEYBOARD="1") and other key input devices like
lid switches, power buttons, etc.
All supported hotplug backends (udev, hal, and wscons) will set both
flags ATTR_KEY and ATTR_KEYBOARD for real keyboards, but udev backend
will set ATTR_KEY, but not ATTR_KEYBOARD, for non-keyboard key input
devices (hal and wscons will set both flags in any case). With this
distinction, kdrive input hotplugging mechanism will be allowed to only
grab real keyboards, as other key input devices are currently not
supported.
In order to don't break current behaviour, this patch will replace all
ATTR_KEYBOARD occurrences with ATTR_KEY in hw/xfree86/common/xf86Xinput.c.
[ajax: Just add ATTR_KEY, don't re-number the other attributes]
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
|
|
This uses the NotifyFd interface to monitor the udev file descriptor
rather than adding another block/wakeup handler
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
This uses the NotifyFd interface to monitor the dbus socket rather
than a block/wakeup handler.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
Now that we have two likely drivers that fight for control over the input
devices (evdev and libinput) let's move the respective driver assignment to
each package. So you get what you install.
https://bugs.freedesktop.org/show_bug.cgi?id=89023
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
|
|
The xnfcalloc() macro took two arguments but simply multiplied them
together without checking for overflow and defeating any overflow
checking that calloc() might have done. Let's not do that.
The original XNFcalloc() function is left for now to preserve driver
ABI, but is marked as deprecated so it can be removed in a future round
of ABI break/cleanup.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
|
|
Jonathan Dieter posted a few patches to do this inside the Xorg
server but it makes no sense to do it there, just have the code
we use to probe the device list at startup check seat assignments
using the same code we check at hotplug time.
Bugilla: https://bugzilla.redhat.com/show_bug.cgi?id=1183654
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Jonathan Dieter <jdieter@lesbg.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
The message "removing GPU device ..." appeared even if the removal was
skipped (when path == NULL). Move it below the path check and make it a
LogMessage with config/udev prefix.
Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
OdevAttributes are a fixed set of values with known types; instead of
storing them in a linked list and requiring accessor/settor functions,
replace the list header, struct OdevAttributes, with a struct that
directly contains the values. This provides for compile-time
typechecking of the values, eliminates a significant amount of code
and generally simplifies using this datatype.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
|
|
Don't allow setting string attributes to integers and vice versa.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
This quick makes the mouse behaviour more obvious (LMR buttons generate LMR
events) but goes against the manufacturer's intended defaults:
Top button - left click.
Wheel button - .middle click (e.g., for pan and rotate in CAD programs).
Middle button - right click.
Bottom button - back.
Thumb button - forward.
from http://www.evoluent.com/vm3.html
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Skipping two unreviewed patches; will mark them reviewed and cherry pick
|
|
We can only request one fd per device from systemd-logind. If a fd is re-used
by the same device, releasing the fd from one device doesn't mean we can close
it. The systemd code knows when it's really released, so let it close the fd.
Test case: xorg.conf section for an input device with hotplugging enabled.
evdev detects the duplicate and closes the hotplugged device, which closes the
fd. The other instance of evdev thinks the fd is still valid so now you're
playing a double lottery. First, which client(s) will get the evdev fd?
Second, which requests will be picked up by evdev and which ones will be
picked up by the client? You'll never know, but the fun is in finding out.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
|
|
wakeup handlers are called even when select() returns EINTR,
and when they're called the passed fd set is undefined.
This commit fixes the dbus wakeup handler to avoid dispatching
into dbus spuriously.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Ray Strode <rstrode@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
Note that there are more callers but those were already not doing any
error checking.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
config_odev* functions are called in code-paths were we already use
XNF* functions in other places, so which are not oom safe already.
Besides that oom is something which should simply never happen, so aborting
when it does is as good a response as any other.
While switching to XNF functions also fixup an unchecked strdup case.
Note the function prototypes are kept unchanged, as they are part of the
server ABI.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
The PnPID for a device may not be on the immediate parent, so search up the
device tree until we find one.
X.Org Bug 75513 <http://bugs.freedesktop.org/show_bug.cgi?id=75513>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
|
|
Don't do the xorg_list_append a 2nd time when updating existing attributes,
while at it add a helper function for this to avoid code duplication.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Before this commit we were trying to add most drm devices twice, once
from xf86platformProbe() and once from config_udev_init().
This results in somewhat confusing messages in Xorg.log, ie:
(II) xfree86: Adding drm device (/dev/dri/card0)
Later followed by:
(II) config/udev: Adding drm device (/dev/dri/card0)
By filtering out duplicate drm devices we avoid these confusing messages.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
This commits makes the changes necessary outside of the systemd-logind core
to make the server use systemd-logind managed fds for input devices and drm
nodes.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Add a couple of new functions for dealing with storing integer values into
OdevAttributes.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
If an attribute already exists replace its value rather than adding a
duplicate attribute with the new value to the list.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Add a config_odev_get_attribute helper, and replace the diy looping over all
the attributes done in various places with calls to this helper.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
This file is deprecated by commits c73c36b53 and 46cf2a6093.
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Just need to update EXTRA_DIST
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
Introduced in fecc7eb1cf66db64728ee2d68cd9443df7e70879 and reverts most of
that but it's helpfully mixed with other stuff.
InputAttributes are not const, they're strdup'd everywhere but the test code
and freed properly. Revert the const char changes and fix the test up instead.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
|
|
For systemd-logind integration we need the dbus connection to be available
before enumerating input and gfx devices.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
|
|
With systemd-logind the dbus-core will be used for more then just config, so
it should be possible to build it even when using a non dbus dependent config
backend.
This patch also removes the config_ prefix from the dbus-core symbols.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
|
|
This API has been disabled by default since 1.4, the first release it came in.
There a no known users of it and even its direct replacement (HAL) has
been superseeded by udev on supported platforms since 1.8.
This code is untested, probably hasn't been compiled in years and should not
be shipped.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
|
|
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
is used throughout the X server for other things, and having duplicate
names generates compiler warnings.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
|
|
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
|
|
seats (#69478)
This patch contributes to fill the remaining gaps which make
systemd-multi-seat-x wrapper still necessary in some multiseat setups.
This also replaces previous evdev patch that does the same thing
for that particular driver.
When option "-seat" is passed with an argument different from "seat0",
option "GrabDevice" for input devices is enabled by default
(no need of enabling it in xorg.conf's "InputClass" section).
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=69478
Signed-off-by: Laércio de Sousa <lbsousajr@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Seats other than seat0 need custom configuration. Provide that with a
default configuration file so we can share it across distros.
This file intentionally does not end in .conf so it won't get picked up by
the server after a normal installation. gdm, or whatever starts up the
servers will have to explicitly specifiy this config file.
This file replaces the one currently written by systemd's multi-seat-x
binary:
http://cgit.freedesktop.org/systemd/systemd/tree/src/login/multi-seat-x.c
CC: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
|
|
This is the fedora quirks file configuring the special handling some devices
need. Rather than keeping this distro-specific add it to the tree so we can
share these quirks.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
|
|
udev.c: In function 'device_removed':
udev.c:270:9: warning: format '%d' expects argument of type 'int', but argument 3 has type 'const char *' [-Wformat]
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
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>
|