summaryrefslogtreecommitdiff
path: root/config
AgeCommit message (Collapse)AuthorFilesLines
4 daysinclude: move dbus-core.h to configEnrico Weigelt, metux IT consult3-2/+60
This header is internal (not installed) and holds definitions for sources in config/, thus it fells more clean moving it to config/, too. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1357>
2024-04-01config: wscons: fix warning on discarded constEnrico Weigelt, metux IT consult1-1/+1
Fix warning: ../config/wscons.c:47:11: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 47 | { KB_UK, "gb" }, \ | ^~~~ ../config/wscons.c:58:5: note: in expansion of macro ‘KB_OVRENC’ 58 | KB_OVRENC, | ^~~~~~~~~ ../config/wscons.c:48:11: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 48 | { KB_SV, "se" }, \ | ^~~~ [...] Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1444>
2024-03-28config: wscons: use asprintf() instead of deprecated Xprintf()Enrico Weigelt, metux IT consult1-4/+2
The Xprintf() function is deprecated. Most of it's call sites had been moved to asprintf(), so also do it for the remaining two ones. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1449>
2024-02-17Fix build on OpenBSD.Matthieu Herrb1-0/+1
<dev/wscons/wsconsio.h> needs <sys/time.h> on OpenBSD. This doesn't cause issues on NetBSD Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
2023-01-11config: add a quirk for Apple Silicon appledrmEric Curtin1-0/+10
Xorg server does not correctly select the DCP for the display without a quirk on Apple Silicon. Signed-off-by: Eric Curtin <ecurtin@redhat.com> Suggested-by: Hector Martin <marcan@marcan.st>
2022-04-02fdi2iclass: remove unused local variableKonstantin Kharlamov1-3/+0
Fixes LGTM warning "The value assigned to local variable 'children' is never used." Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2022-04-02fdi2iclass.py: use "is" to compare with NoneKonstantin Kharlamov1-1/+1
Fixes LGTM warning "Testing for None should use the 'is' operator." Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2022-02-06config/wscons: Always attach the "ws" driver for pointer devices,nia1-2/+2
rather than "mouse". Both OpenBSD and NetBSD (the only downstream users of this code) are both patching in this currently. Signed-off-by: Nia Alarie <nia@NetBSD.org>
2022-02-06config/wscons: Fix build and add support for NetBSDnia2-3/+13
Signed-off-by: Nia Alarie <nia@NetBSD.org>
2021-10-27Remove autotools supportPovilas Kanapickas1-41/+0
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2021-06-25config: Fix platform busid parsing when there is no ID_PATH propPovilas Kanapickas1-0/+31
On at least Lenovo Thinkpad E585 udev does not have ID_PATH property for the drm node (see https://gitlab.freedesktop.org/xorg/xserver/-/issues/993). While this is likely udev bug, this causes the device to be not recognized as attribs->busid is NULL, which causes platform_find_pci_info to be not called and corresponding xf86_platform_devices[i]->pdev to be NULL. At this moment pdev being NULL will cause a crash, but this is a different bug. Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/993 Fixes: 0816e8fc linux: Make platform device probe less fragile Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com> Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2020-11-25linux: Fix udev ID_PATH parsing for udl devicesReza Arbab1-1/+6
The ID_PATH for a udl device looks like this: $ udevadm info /dev/dri/card2 | grep -w ID_PATH E: ID_PATH=pci-0000:00:14.0-usb-0:9.1:1.0 The parsing added in 0816e8fca6194 ("linux: Make platform device probe less fragile"), sets OdevAttributes::busid to "pci:0000:00:14.0", where drmGetBusid() would have returned "3-9.1:1.0". Identifying this as a "pci:*" device eventually causes the vendor/device id check in probeSingleDevice() to fail, because a USB controller isn't a supported device: $ udevadm info --path=/devices/pci0000:00/0000:00:14.0 | grep -e VENDOR -e ID_PCI_CLASS E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller E: ID_VENDOR_FROM_DATABASE=Intel Corporation Instead of parsing out "pci:0000:00:14.0" in this case, use "usb:0:9.1:1.0" so the device probe will succeed. Fixes: 0816e8fca6194 ("linux: Make platform device probe less fragile") Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2020-07-28linux: Fix platform device probe for DT-based PCIHuacai Chen1-1/+26
On a DT-base PCI platform, the sysfs path of vga device is like this: /sys/devices/platform/bus@10000000/1a000000.pci/pci0000:00/0000:00:11.0/0000:04:00.0. Then the ID_PATH from udev is platform-1a000000.pci-pci-0000:04:00.0 and the BusID will be pci-0000:04:00.0, which causes Xorg start fail. This is because config_udev_odev_setup_attribs() use strstr() to search the first "pci-" in ID_PATH. To fix this, we implement a strrstr() function and use it to search the last "pci-" in ID_PATH, which can get a correct BusID. Signed-off-by: Huacai Chen <chenhc@lemote.com>
2019-09-20udev: Fixed NULL pointer argument of strcmpMartin Weber1-5/+15
Signed-off-by: Martin Weber <martin.weber@secunet.com>
2019-06-20linux: Fix platform device PCI detection for complex bus topologiesAdam Jackson1-3/+3
Suppose you're in a Hyper-V guest and are trying to use PCI passthrough. The ID_PATH that udev will construct for that looks something like "acpi-VMBUS:00-pci-b8c8:00:00.0", and obviously looking for "pci-" in the first four characters of that is going to not work. Instead, strstr. I suppose it's possible you could have _multiple_ PCI buses in the path, in which case you'd want strrstr, if that were a thing.
2018-11-14config/udev: Include header <sys/sysmacros.h> to use major/minorManoj Gupta1-0/+4
glibc 2.25 has dropped sys/sysmacros.h from sys/types.h, so add it explicitly in config/udev.c. This is similar to the commit 84e3b96b531363e47f6789aacfcae4aa60135e2e Signed-off-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-10-18linux: Make platform device probe less fragileAdam Jackson1-5/+12
At the point where xf86BusProbe runs we haven't yet taken our own VT, which means we can't perform drm "master" operations on the device. This is tragic, because we need master to fish the bus id string out of the kernel, which we can only do after drmSetInterfaceVersion, which for some reason stores that string on the device not the file handle and thus needs master access. Fortunately we know the format of the busid string, and it happens to almost be the same as the ID_PATH variable from udev. Use that instead and stop calling drmSetInterfaceVersion. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-03-27meson: Fix install path for 10-quirks.confAdam Jackson1-1/+1
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2018-01-08config: fix NULL value detection for ID_INPUT being unsetPeter Hutterer1-1/+1
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>
2017-11-01config/udev: consider ID_INPUT_FOO=0 as 'unset'Peter Hutterer1-33/+32
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>
2017-04-26Add a Meson build system alongside autotools.Eric Anholt1-0/+35
This is a work in progress that builds Xvfb, Xephyr, Xwayland, Xnest, and Xdmx so far. The outline of Xquartz/Xwin support is in tree, but hasn't been built yet. The unit tests are also not done. The intent is to build this as a complete replacement for the autotools system, then eventually replace autotools. meson is faster to generate the build, faster to run the bulid, shorter to write the build files in, and less error-prone than autotools. v2: Fix indentation nits, move version declaration to project(), use existing meson_options for version-config.h's vendor name/web. Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-10-26ddx: add new call to purge input devices that weren't addedPeter Hutterer1-0/+2
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>
2016-09-15config/dbus: Initialize dbus fd to -1 so teardown doesn't use fd 0Keith Packard1-1/+1
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>
2016-08-16config: Hold input lock across udev socket handlingKeith Packard1-1/+5
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>
2016-05-26Remove SIGIO support for input [v5]Keith Packard1-2/+2
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>
2016-05-03xfree86: add support for MatchIsTabletPadPeter Hutterer2-0/+6
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>
2016-03-01config/udev: distinguish between real keyboards and other key devicesLaércio de Sousa3-2/+6
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>
2015-12-01config: Use NotifyFd interface for udevKeith Packard1-29/+16
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>
2015-12-01config: Use NotifyFd for dbus interfaceKeith Packard1-12/+4
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>
2015-05-18config: remove 10-evdev.conf, let the evdev driver install that filePeter Hutterer2-42/+2
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>
2015-04-21Add XNFcallocarray() to allow xnfcalloc() to check for overflowAlan Coopersmith1-1/+2
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>
2015-01-30config/udev: Respect seat assignments when assigned devicesDave Airlie1-9/+21
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>
2014-12-08config/udev: Prefix and shift "removing GPU" messageDaniel Martin1-4/+3
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>
2014-07-17config: Replace OdevAttributes linked list with structKeith Packard2-155/+16
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>
2014-07-14config_odev_add_attribute*: Check for right attribute typeHans de Goede1-0/+32
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>
2014-05-15config: revert quirk for the Evoluent Vertical MousePeter Hutterer1-16/+0
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>
2014-05-08Merge commit 'who/for-keith'Keith Packard1-4/+2
Skipping two unreviewed patches; will mark them reviewed and cherry pick
2014-05-05systemd-logind: let the logind code decided whether to close an fdPeter Hutterer1-4/+2
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>
2014-04-30dbus: don't dispatch dbus events on select() EINTRRay Strode1-2/+2
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>
2014-03-12Remove config_odev_add_*attribute checks in various placesHans de Goede1-26/+6
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>
2014-03-12config_odev*: Use XNF alloc functionsHans de Goede1-15/+3
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>
2014-03-11Merge remote-tracking branch 'whot/for-keith'Keith Packard3-8/+26
2014-03-12config: search for PnPID on all parents (#75513)Peter Hutterer2-7/+24
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>
2014-03-11config: only free odev->attrib_name for string typesPeter Hutterer1-1/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-03-10config_odev_add*_attribute: Don't add the attribute to the list twiceHans de Goede1-10/+21
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>
2014-03-03config-udev: Don't try to add drm devices twiceHans de Goede1-0/+4
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>
2014-03-03systemd-logind: Hookup systemd-logind integrationHans de Goede2-4/+48
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>
2014-03-03OdevAttribute: Add support for integer attributesHans de Goede1-0/+43
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>
2014-03-03OdevAttribute: config_odev_add_attribute: replace existing valuesHans de Goede1-1/+4
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>
2014-03-03OdevAttribute: Add config_odev_get_attribute helperHans de Goede1-0/+24
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>