Commit Graph

53 Commits

Author SHA1 Message Date
Eric Anholt accd32a466 xorg: Remove the XF86PM define.
We already have pm_noop.c being built most of the time for the
no-OS-PM case, so just switch to always using it.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-02 10:27:37 -04:00
Adam Jackson d732c36597 xfree86: Silence a new glibc warning
glibc would like to stop declaring major()/minor() macros in
<sys/types.h> because that header gets included absolutely everywhere
and unix device major/minor is perhaps usually not what's expected. Fair
enough. If one includes <sys/sysmacros.h> as well then glibc knows we
meant it and doesn't warn, so do that if it exists.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-05-03 15:44:06 -04:00
Eric Anholt da27ca84b4 xorg: Change __XCONFIGFILE__ to XCONFIGFILE (and DIR) to fix scan.c.
parser/scan.c was checking for #ifdef XCONFIGFILE and XCONFIGDIR and
defaulting to "xorg.conf", and "xorg.conf.d", so if you had changed
__XCONFIGFILE__ to anything else, it would have got out of sync.
Settle on the name without gratuitous underscores.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-04-25 15:01:23 -07:00
Peter Hutterer c69bd15e00 Allow compile-time selection of a fallback input driver
A new --with-fallback-input-driver=foo option allows selecting a
fallback driver for the server if the driver configured for the device
is not found.  Note that this only applies when the device has a driver
assigned and that module fails to load, devices without a driver are
ignored as usual.

This avoids the situation where a configuration assigns e.g. the
synaptics driver but that driver is not available on the system,
resulting in a dead device. A fallback driver can at least provides some
functionality.

This becomes more important as we move towards making other driver true
leaf nodes that can be installed/uninstalled as requested. Specifically,
wacom and synaptics, a config that assigns either driver should be
viable even when the driver itself is not (yet) installed on the system.

It is up to the distributions to make sure that the fallback driver is
always installed. The fallback driver can be disabled with
--without-fallback-input-driver and is disabled by default on non-Linux
systems because we don't have generic drivers on those platforms.
Default driver on Linux is libinput, evdev is the only other serious
candidate here.

Sample log output:
[  3274.421] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/event4)
[  3274.421] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad weird driver"
[  3274.421] (II) LoadModule: "banana"
[  3274.422] (WW) Warning, couldn't open module banana
[  3274.422] (II) UnloadModule: "banana"
[  3274.422] (II) Unloading banana
[  3274.422] (EE) Failed to load module "banana" (module does not exist, 0)
[  3274.422] (EE) No input driver matching `banana'
[  3274.422] (II) Falling back to input driver `libinput'
.. server proceeds to assign libinput, init the device, world peace and rainbows
everywhere, truly what a sight. Shame about the banana though.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-08 13:08:32 -04:00
Keith Packard 6a5a4e6037 Remove SIGIO support for input [v5]
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-26 16:07:54 -07:00
Adam Jackson 2e21c081d3 xfree86: Remove the memory of MTRR awareness
pciaccess does this for us, and none of our internal hooks really
remain.  This does remove a cleanup pass from the BSD code, but the case
it's covering (a previous server leaving MTRRs around) can't happen
anymore.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-09-16 11:58:53 -04:00
Hans de Goede 9d65c515d8 xf86LogInit: log to XDG_DATA_HOME when not running as root
When no logfile was specified (xf86LogFileFrom == X_DEFAULT) and we're not
running as root log to $XDG_DATA_HOME/xorg/Xorg.#.log as Xorg won't be able to
log to the default /var/log/... when it is not running as root.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-04-03 14:17:35 +10:00
Hans de Goede f37a469134 configure: Change DEFAULT_LOGPREFIX to really be a filename prefix
Rather then a full path prefix, this is a preparation patch for adding
support for logging to another location when not running as root.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-04-01 17:14:40 +10:00
Alan Coopersmith bf087659f0 Add necessary headers for major()/minor() on Solaris to xf86Xinput.c
Without these, after commit fdb4ec86c2, it fails to build on Solaris,
with errors of:
xf86Xinput.c: In function 'xf86stat':
xf86Xinput.c:816:5: error: implicit declaration of function 'major' [-Werror=implicit-function-declaration]
xf86Xinput.c:817:5: error: implicit declaration of function 'minor' [-Werror=implicit-function-declaration]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-03-22 14:42:09 -07:00
Keith Packard 914672fefa Remove dix-config.h config variables from xorg-config.h
xorg-config.h includes dix-config, so there's no need to duplicate.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-11 15:11:52 -08:00
Keith Packard f348935e7d Link with xshmfence, reference miSyncShmScreenInit in sdksyms
This gets the server to link with xshmfence again, and also ensures
that the miSyncShm code is linked into the server with the reference
from sdksyms.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-05 18:37:12 -08:00
Egbert Eich 66c5ee0ff4 config/APM: Add option to disable building of APM support on Linux
APM support in the Xserver was used to restore the console mode
    prior to a power management event. This was to ensure the mode
    upon suspend/resume was one that the system firmware or kernel
    could deal with.
    APM support is now largely obsolete, KMS drivers don't require a
    mode restoration anyhow. Therefore it should be possible to disable
    this feature.

(small modification by keithp - move test for XF86PM flag after check
for APM, then move XF86PM flag to xorg-config.h.in)

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Tested-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-01 00:28:43 -07:00
Julien Cristau c218ba8423 xfree86: improve check for posix saved ids
Replace hardcoded SVR4 || linux || CSRG_BASED with an autoconf check and
the _POSIX_SAVED_IDS macro.

Suggested-by: Mark Kettenis <mark.kettenis@xs4all.nl>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-06 13:03:25 +10:00
Dave Airlie cf66471353 xfree86: use udev to provide device enumeration for kms devices (v10)
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>
2012-07-06 10:20:19 +01:00
Antoine Martin ead968a430 xserver: check for elevated privileges not uid=0
This allows us to run the server as a normal user whilst still
being able to use the -modulepath, -logfile and -config switches
We define a xf86PrivsElevated which will do the checks and cache
the result in case it is called more than once.
Also renamed the paths #defines to match their new meaning.
Original discussion which led to this patch can be found here:
http://lists.freedesktop.org/archives/xorg-devel/2011-September/025853.html

Signed-off-by: Antoine Martin <antoine@nagafix.co.uk>
Tested-by: Michal Suchanek <hramrach at centrum.cz>
Reviewed-by: Jamey Sharp <jamey at minilop.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-16 15:38:13 -08:00
Tiago Vignatti 6817050f31 configure: wrap PCI code with macro and set it at build time
--disable-pciaccess, used together with --disable-module-int10, can be used to
disable all pci code inside the server.

Note that XSERVER_LIBPCIACCESS was previously used only in the driver side and
now it defines also whether the library is used inside the server. Also,
XORG_BUS_PCI automake variable is introduced to track PCI code needs.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-15 21:18:47 -07:00
Tiago Vignatti a319e9e697 configure: change PCI function checking by a meaningful version of the library
People that don't want VGA arbiter active can go to the library and enable the
stubs there.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:47 -07:00
Jamey Sharp 6ad7bb69ee Remove PC98 support.
Gaetan Nadon wrote:

    Alan Coopersmith wrote:

    "I think we recently dropped PC98 support from the X server, so I'd
    be okay with dropping the documentation now".

Let's make them be right, shall we?

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Acked-by: Gaetan Nadon <memsize@videotron.ca>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-15 10:11:43 -05:00
Tiago Vignatti 6eef70dc56 DRI2: Allow building without libdrm
Some drivers use DRI protocol but implement their own kernel rendering
manager. For these drivers, libdrm becomes useless. --disable-libdrm
configure parameter can be used to disable libdrm support in dri2.

To provide ABI/API compatibility for libdrm based drivers, libdrm call
is wrapped in ifdef.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2010-06-03 11:56:03 +03:00
Dan Nicholson efa5269f23 xfree86: Use xorg.conf.d directory for multiple config files
Currently there is a single file, xorg.conf, for configuring the server.
This works fine most of the time, but it becomes a problem when packages
or system services need to adjust the configuration. Instead, allow
multiple configuration files to live in a directory. Typically this will
be /etc/X11/xorg.conf.d.

Files with a suffix of .conf will be read and added to the server
configuration after xorg.conf. The server won't fall back to using the
auto configuration unless there is no config file and there are no files
in the config directory.

Right now this uses a simpler search template than the config file
search path by not using the command line or environment variable
parameters. The matching code was refactored a bit to make this more
coherent. Any DDX wanting to read the config files will need to call
xf86initConfigFiles before opening/reading them. This is to allow
xf86openConfigFile without xf86openConfigDirFiles and vice-versa.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
2009-12-22 23:20:45 -08:00
Alan Coopersmith b63912ed4c Convert checks for PC98 support from platform #ifdefs to configure flag
Default remains the same - on for most OS'es on i386 (except Solaris),
off for everyone else.   Can be manually toggled via --enable-pc98 or
--disable-pc98.

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-18 10:30:53 -08:00
Alan Coopersmith e2c6455180 Add configuration option for use of SIGIO handlers for input events
Boolean option to enable/disable SIGIO handlers is set by the first
of these found:
  - UseSIGIO option is set in xorg.conf ServerFlags
  - Default set at build time by ./configure --enable-use-sigio-by-default
  - Platform default value: Solaris = no, all others = yes

This matches the current settings on all platforms except Solaris.
This reverts Solaris (for now) to the settings used in Xorg 1.6, before
SIGIO support for Solaris was added, due to some system level bugs that
won't be resolved in time for Xorg 1.7 release, but allows us to enable
when those are resolved (or when we need to test if they're resolved).
See http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6879897

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-17 10:06:37 +10:00
Dave Airlie e454f106dc xf86 ddx: add vga arbiter support.
This adds support for using the libpciaccess interface for
vga arbitration support on top of a kernel which supports it.

Currently patches are queued for kernel 2.6.32 in jbarnes
pci tree, and shipping in Fedora kernel.

Co-authors:
Tiago Vignatti <tiago.vignatti@nokia.com>

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-08-28 11:39:42 +10:00
Aaron Zang 48ee555833 Add new VT support for OpenSolaris & future Solaris releases
Signed-off-by: Aaron Zang <Aaron.Zang@Sun.COM>
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-08-13 21:56:06 -07:00
Alan Coopersmith 613e76ff90 Remove support for Solaris x86 releases older than Solaris 8
If you want to run a pre-1999 kernel, you'll need a pre-2009 X server

[Some pre-Solaris 8 VT support is left by this patch to allow reuse by
 the new Solaris VT support that follows in the next patch.]

Signed-off-by: Aaron Zang <Aaron.Zang@Sun.COM>
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-08-13 21:56:05 -07:00
Dave Airlie 0a168401c4 pci: add support for pci is boot vga call.
This allows us to ask the kernel for the boot VGA device
instead of nasty guessing.
2009-07-28 14:19:24 +10:00
Alan Coopersmith 64b7f96dca Add SIGIO/SIGPOLL support for Solaris
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-04-24 00:23:52 -07:00
Alan Coopersmith cc78d977ca Convert Solaris #ifdef's for <sys/kd.h> to AC_CHECK_HEADERS check
Upcoming virtual terminal support changes in Solaris kernel will provide
<sys/kd.h> on SPARC too, so this gets us ready for them.
2008-08-22 10:14:11 -07:00
Daniel Stone 16e40ecf43 Remove dead code, useless #defines, et al 2008-07-17 22:37:31 +03:00
Dave Airlie ea4ec9e998 int10: add pci_device_enable support on Linux 2008-05-22 08:58:42 +10:00
Matthieu Herrb db248ffb84 test for the presence of pci_system_init_dev_mem() before calling it.
This avoids creating a dependency on -current libpciaccess for
BSD systems other than OpenBSD (which don't otherwise need it).
2008-03-16 18:46:11 +01:00
Kristian Høgsberg b71dc54352 Add DRI2 module. 2008-02-14 19:53:49 -05:00
Eamon Walsh b633d54b94 Merge branch 'master' into XACE-SELINUX
Conflicts:

	GL/glx/glxscreens.c
	hw/xnest/Screen.c
	render/glyph.c
	render/glyphstr.h
	render/render.c
2007-10-25 12:19:30 -04:00
David Nusinow d808d653d1 Define PCI_TXT_IDS_DIR more cleanly 2007-10-22 21:30:04 -04:00
Eamon Walsh 4017d31902 devPrivates rework: since API is already broken, switch everything
over to new system.

Need to update documentation and address some remaining vestiges of
old system such as CursorRec structure, fb "offman" structure, and
FontRec privates.
2007-08-28 09:28:25 -04:00
Aaron Plattner 64de3baf85 Add a -showDefaultLibPath option.
A corollary to the previous change, this option prints $libdir.
2006-11-22 14:46:51 -08:00
Daniel Stone 5a3488ccac configure.ac: fix execinfo.h test (Debian #363218)
Define HAVE_EXECINFO_H as well as HAVE_BACKTRACE, when we find execinfo.h.
2006-08-12 19:25:06 +03:00
Tilman Sauerbeck 39b2f7b218 Bug #3042: Use autoconf to get the correct name of a struct member.
This allows us to remove the kernel version ifdefs from the code, which
are ugly and broken.
2006-07-08 19:55:53 +02:00
Daniel Stone 6d594ebc66 Ditch more alternate-loader braindamage. 2006-06-01 20:22:39 +00:00
Matthieu Herrb 6fe377af5a - OpenBSD needs -Wl,-export-dynamic to export symbols from main executable
to modules.
- Probe for OpenBSD aperture driver and define HAS_APERTURE_DRV
    accordingly.
2006-03-15 21:25:38 +00:00
Daniel Stone 023d2b4e3c Add forgotten HAVE_BACKTRACE define. 2006-01-26 00:23:44 +00:00
Kevin E Martin 7c00afd0ec Define XFree86Server only where it is required. 2005-12-02 06:02:45 +00:00
Kevin E Martin da5d66f2ff Fix usage of XFree86LOADER/XFree86Module/IN_MODULE and update loadable
module builds to reflect this change.
2005-11-29 16:39:33 +00:00
Eric Anholt 12fbcfefe6 Add some initial BSD support for the xorg server. Incomplete on NetBSD,
OpenBSD, and non-i386/amd64 FreeBSD for sure. Plus I haven't actually
    run it yet.
2005-09-13 18:37:35 +00:00
Daniel Stone ade158d238 Define WITH_VGAHW, since we always build it; add to Xorg headers. 2005-09-12 07:07:59 +00:00
Daniel Stone 8d6e743bc4 Add _XSERVER64 definition to config headers. 2005-08-21 19:23:17 +00:00
Søren Sandmann Pedersen 5e6e5e6d8c Mon Aug 8 13:36:23 2005 Søren Sandmann <sandmann@redhat.com>
#undef PIXPRIV here.
2005-08-08 17:38:37 +00:00
Alan Coopersmith 3d0d95004c Add check for walkcontext() to enable stack trace dumper on Solaris 2005-08-02 20:47:47 +00:00
Kevin E Martin a407fa373b Move drm up to os-support since the files are shared by multiple platforms.
Fix the dri and drm build. Fix server-side DMX extension build. Make
    xf4bpp use the correct version of mfbline.c for mfbseg.c. Add #ifndef
    _HEADERNAME_H_/#define _HEADERNAME_H_/.../#endif to the headers.
2005-07-15 22:51:05 +00:00
Kevin E Martin 7375f4d136 Add support for Xnest 2005-07-14 03:32:09 +00:00