summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86Config.c
AgeCommit message (Collapse)AuthorFilesLines
2018-03-28xfree86: Add Option "Debug" to ServerFlagsAdam Jackson1-0/+5
This provides a generic way to control obscure runtime behavior knobs without making interface promises. Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-03-21xfree86: replace all uses of xf86PrivsElevated with PrivsElevatedNicolai Hähnle1-1/+1
[... but leave it defined and exported, since we're ABI-frozen - ajax] Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Ben Crocker <bcrocker@redhat.com> Reviewed-by: Antoine Martin <antoine@nagafix.co.uk> Tested-by: Ben Crocker <bcrocker@redhat.com> restore abi
2018-01-29xfree86: Remove broken RANDR disabling logic (v4)Adam Jackson1-12/+0
The only way to get at xf86Info.disableRandR from configuration is Option "RANDR" "foo" in ServerFlags, which probably nobody is using seeing as it's not documented. The other way it could be set is if a screen supports RANDR 1.2, in which case we set it to avoid trying to use the RANDR 1.1 compat code. If the second screen is not 1.2-aware then this would mean we don't do RANDR setup on the second screen at all, which would almost certainly crash the first time you try to do RANDR operations on the second screen. Fix that all by deletion, and just check whether the screen already has RANDR initialized before installing the stub support. If you want to disable RANDR, use the Extensions section of xorg.conf instead. v2: Also remove a now entirely pointless log message, telling you to ignore a line we will no longer print. v3: Explain the fallback path in InitOutput. (Keith Packard) v4: Check whether the RANDR private key is initialized before trying to use it to look up the screen private. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2018-01-24Revert "xfree86: Remove broken RANDR disabling logic (v3)"Adam Jackson1-0/+12
Tsk. This broke vesa for me, the rrGetScrPriv in InitOutput will crash if randr's screen private key hasn't been initialized yet. That seems dumb, but let's not leave it broken. This reverts commit c08d7c1cdde6a844338ed4c3645b00bf25843a31.
2018-01-24xfree86: Remove broken RANDR disabling logic (v3)Adam Jackson1-12/+0
The only way to get at xf86Info.disableRandR from configuration is Option "RANDR" "foo" in ServerFlags, which probably nobody is using seeing as it's not documented. The other way it could be set is if a screen supports RANDR 1.2, in which case we set it to avoid trying to use the RANDR 1.1 compat code. If the second screen is not 1.2-aware then this would mean we don't do RANDR setup on the second screen at all, which would almost certainly crash the first time you try to do RANDR operations on the second screen. Fix that all by deletion, and just check whether the screen already has RANDR initialized before installing the stub support. If you want to disable RANDR, use the Extensions section of xorg.conf instead. v2: Also remove a now entirely pointless log message, telling you to ignore a line we will no longer print. v3: Explain the fallback path in InitOutput. (Keith Packard) Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2017-05-15xfree86: Hide unused variables when !XSERVER_LIBPCIACCESSJon Turney1-0/+2
../hw/xfree86/common/xf86Config.c: In function ‘xf86HandleConfigFile’: ../hw/xfree86/common/xf86Config.c:2278:10: warning: unused variable ‘singlecard’ [-Wunused-variable] ../hw/xfree86/common/xf86Config.c:2277:17: warning: unused variable ‘scanptr’ [-Wunused-variable] Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2017-05-11Replace all checks for 'linux' macro with '__linux__'Julien Cristau1-1/+1
gcc -std=c99 does not define the former, and it's a horrible namespace confusion anyway. Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-03-27dpms: Consolidate a bunch of stuff into Xext/dpms.cAdam Jackson1-1/+3
Most of this is a legacy of the old "extmod" design where you could load _some_ extensions dynamically but only if the server had been built with support for them in the first place. Note that since we now only initialize the DPMS extension if at least one screen supports it, we no longer need DPMSCapableFlag: if it would be false, we would never read its value. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-03-17xfree86: Remove 24bpp pixmap format support (v2)Adam Jackson1-32/+0
There's really no reason to pretend to support this, apps hate it, all we're doing is giving people a way to injure themselves. It doesn't work anyway with any Radeon, any NVIDIA chip, or any Intel chip since i810. Rip out all the logic for handling 24bpp pixmaps and framebuffers, and silently ignore the old options that would ask for it. The cirrus alpine driver has been updated to default to 16bpp, and both it and the i810 driver can now use the 32->24 conversion code in shadow if they want. All other drivers support 32bpp. Configurations that explicitly request 24bpp in order to fit in VRAM will be broken now though. v2: Fix command line options to silently ignore 24bpp rather than fail Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-02-16xfree86: Remove Option "BiosBase" (v2)Adam Jackson1-1/+0
Just no. The ddxDesign chunk removes the whole para about xf86FixPciResource, since it turns out that function doesn't exist at all anymore. The only drivers that reference this at all are i128 and mga, and even then only in the non-pciaccess path. v2: - Update commentary about i128/mga - Don't remove the BiosBase keyword from the config parser since that would turn a no-op into a fatal error (Aaron Plattner) Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25loader: Turn LoaderListDirs into LoaderListDirAdam Jackson1-76/+0
Callers only ever use this for a single directory anyway. While we're at it, also move xf86DriverListFromCompile near its only user in the X -configure code (and inline it out of existence), and remove LoaderFreeDirList as it's unused (since X -configure is just going to exit anyway, none of that code cares about cleanup). Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-01-25loader: Move loader list details to internal headerAdam Jackson1-1/+1
There's no reason a driver should ever care about this. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-10-05xfree86: remove aiglx cmd/xorg.conf optionEmil Velikov1-9/+0
The option is misleading and using it leads to disabling both direct and accelerated indirect GLX. In such cases the xserver GLX attempts to match DRISW (IGLX) configs with the DRI2/3 ones (direct GLX) leading to all sorts of fun experience. Remove the option until we get a clear split and control over direct vs indirect GLX. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-07-15xfree86: Fix fallback driver sort order for Xorg -configure (v2)Adam Jackson1-19/+40
The intent here was that fallback drivers would be at the end of the list in order, but if a fallback driver happened to be at the end of the list already that's not what would happen. Rather than open-code something smarter, just use qsort. Note that qsort puts things in ascending order, so somewhat backwardsly fallbacks are greater than native drivers, and vesa is greater than modesetting. v2: Use strcmp to compare non-fallback drivers so we get a predictable result if your libc's qsort isn't stable (Keith Packard) Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-06-08xfree86: Remove redundant parse of AIGLX server flagAdam Jackson1-5/+0
Not visible in the patch, but the same stanza is repeated below inside the #ifdef GLXEXT. There's no reason to bother with checking it if we built without GLXEXT so remove the unconditional one. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-05-26Remove SIGIO support for input [v5]Keith Packard1-21/+0
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-26xfree86: Add IndirectGLX server flag (v2)Adam Jackson1-0/+9
Not all display managers make it easy (or possible) to modify the command line flags passed to the server, so add a way to get to it from xorg.conf. v2: Fix the FlagOptions list to not have IGLX after the terminator (Alan Coopersmith) Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-01-28xfree86: Build parser for DRI config file subsection unconditionallyAdam Jackson1-8/+0
This applies regardless of which DRI you're asking for. Worse, leaving it out means breaking the config file syntax in a pointless way, since non-DRI servers can safely just parse it and ignore it. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-08-24configurable maximum number of clientsOlivier Fourdan1-0/+16
Make the maximum number of clients user configurable, either from the command line or from xorg.conf This patch works by using the MAXCLIENTS (raised to 512) as the maximum allowed number of clients, but allowing the actual limit to be set by the user to a lower value (keeping the default of 256). There is a limit size of 29 bits to be used to store both the client ID and the X resources ID, so by reducing the number of clients allowed to connect to the X server, the user can increase the number of X resources per client or vice-versa. Parts of this patch are based on a similar patch from Adam Jackson <ajax@redhat.com> This now requires at least xproto 7.0.28 Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-06-30xf86: restrict when we auto add devices as gpu devices.Dave Airlie1-6/+7
Michel pointed out I broke Zaphod with the initial auto add gpu devices change, Fix this, by only auto adding GPU devices if we are screen 0 and there are no other screens in the layout. Anyone who wants to assign GPU devices can specify it in the xorg.conf for this use case. Signed-off-by: Dave Airlie <airlied@redhat.com> Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2015-05-11Merge remote-tracking branch 'airlied/for-keithp'Keith Packard1-10/+50
2015-04-27xfree86: attempt to autoconfig gpu slave devices (v3)Dave Airlie1-5/+26
This allows us to skip the screen section, the first Device section will get assigned to the screen, any remaining ones will get assigned to the GPUDevice sections for the screen. v2: fix the skipping unsuitable screen logic (Aaron) v3: fix segfault if not conf file (me, 5s after sending v2) Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-04-27xserver: add xorg.conf support for gpu devices. (v2.1)Dave Airlie1-10/+29
This allows gpu devices to be specified in xorg.conf Screen sections. Section "Device" Driver "intel" Identifier "intel0" Option "AccelMethod" "uxa" EndSection Section "Device" Driver "modesetting" Identifier "usb0" EndSection Section "Screen" Identifier "screen" Device "intel0" GPUDevice "usb0" EndSection This should allow for easier tweaking of driver options which currently mess up the GPU device discovery process. v2: add error handling for more than 4 devices, (Emil) fixup CONF_ defines to consistency add MAX_GPUDEVICES define (yes there is two defines, this is consistent with everywhere else). remove braces around slp (Mark Kettenis) man page fixups (Aaron) v2.1: fixup whitespace (Aaron) Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-04-21Convert hw/xfree86 to new *allocarray functionsAlan Coopersmith1-10/+10
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-04-21Let calloc handle multiplicationAlan Coopersmith1-1/+1
It's going to multiply anyway, so if we have non-constant values, might as well let it do the multiplication instead of adding another multiply, and good versions of calloc will check for & avoid overflow in the process. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-11-12Drop trailing whitespacesPeter Hutterer1-2/+2
sed -i "s/[ ]\+$//g" **/*.(c|h) happy reviewing... git diff -w is an empty diff. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-10-02xfree86: Remove remaining return FALSE from configServerFlagsKeith Packard1-1/+1
Remove the error return path from the FLAG_PIXMAP path and leave the default value in place. There's no point skipping the rest of this function. Signed-off-by: Keith Packard <keithp@keithp.com>
2014-09-26xfree86: configServerFlags never fails, make it return voidAdam Jackson1-8/+2
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-09-26xfree86: Remove unused xf86Info.useDefaultFontPathFromAdam Jackson1-2/+0
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-09-26xfree86: Remove xf86Info.log (v2)Adam Jackson1-2/+0
SUBCLASS ALL THE THINGS v2: Remove the enum too (anholt) Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-09-26xfree86: Remove spurious xf86ConfigErrorAdam Jackson1-36/+12
READABLE. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-09-26xfree86: Remove Option "TextClockFreq"Adam Jackson1-1/+0
No modern driver pays attention to this. Presumably there existed hardware once where you couldn't just read the right values out of the CRTC. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-07-14xfree86: Only support one sysconfigdirAaron Plattner1-1/+1
When the X server is compiled with --prefix set to something other than /usr, then it ends up with a nonstandard sysconfigdir in its .pc file. This causes various other components to install their xorg.conf.d snippets there. However, the X server first looks for /usr/share/X11/xorg.conf.d before looking in sysconfigdir. That means that if the system administrator installed anything that created that path, the user's custom sysconfigdir is not searched. Rather than doing that, just look in the configured sysconfdir and nowhere else. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-02xfree86: Add "modesetting" to list of fallback driversSøren Sandmann1-1/+1
To make X -configure work properly, the output of fixup_video_driver_list() should be in order of preference. Otherwise, the config file may use the incorrect driver for some devices. In particular, the drivers that work for all (or many) devices need to be last in the list. Since the modesetting driver works for many devices, it needs to be considered a fallback driver. Signed-off-by: Søren Sandmann <ssp@redhat.com> Acked-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2014-05-12xfree86: fix warnings after MatchSeat patchLaércio de Sousa1-12/+12
This patch fixes some compile warnings that arise after commit 7070ebeebaca1b51f8a2801989120784a1c374ae (xfree86: add new key MatchSeat to xorg.conf sections "Device", "Screen", and "ServerLayout") available at git repository git://people.freedesktop.org/~whot/xserver for-keith Signed-off-by: Keith Packard <keithp@keithp.com>
2014-05-01xfree86: add new key MatchSeat to xorg.conf sections "Device", "Screen", and ↵Oleg Samarin1-9/+25
"ServerLayout" This patch introduces a new key MatchSeat in xorg.conf (also applies to any .conf file in xorg.conf.d). It will allow targeting a given "Device", "Screen", and/or "ServerLayout" section to a particular seat only (specified by option "-seat" in X server command line), so that other seats won't be affected. Without this patch, one needs to write a separate xorg.conf.custom file and pass it to X server via "-config" option, if one wants that these settings only apply for the right seat. However, in some cases, this solution is undesirable or even impossible (e.g. when using GDM, which doesn't allow X server command line customization). Example file (/etc/X11/xorg.conf.d/seat1.conf), which would be ignored by X server unless it was started with "-seat seat1" option: Section "Device" Identifier "card0" Driver "nvidia" Option "NoLogo" "True" MatchSeat "seat1" EndSection Signed-off-by: Oleg Samarin <osamarin68@gmail.com> Signed-off-by: Laércio de Sousa <lbsousajr@gmail.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-04xkb: add a call to init an XkbRMLVOSet from const charsPeter Hutterer1-8/+8
Just forcing everything to const char* is not helpful, compiler warnings are supposed to warn about broken code. Forcing everything to const when it clearly isn't less than ideal. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-01-22xfree86: Fix -Wshadow warningsKeith Packard1-2/+2
Just rename variables to eliminate -Wshadow warnings. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12Replace 'pointer' type with 'void *'Keith Packard1-4/+4
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>
2014-01-12xfree86/config: Kludge around const stringsKeith Packard1-8/+10
defaultFontPath is now a const char * so that it can be initialized from a string constant. This patch kludges around that by inserting suitable casts to eliminate warnings. Fixing this 'correctly' would involve inserting some new variables and conditionals to use them. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12xfree86/common: Warning fixes. Mostly const string handling.Keith Packard1-16/+16
Also removes DPMS functiosn from Xext/dpmsproc.h Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-09xfree86: Prefer fbdev to vesaAdam Jackson1-1/+1
On UEFI machines you'd prefer fbdev to grab efifb instead of vesa trying to initialize and failing in a way we can't unwind from. On BIOS machines this is harmless: either there is an fbdev driver and it'll probably be more capable, or there's not and vesa will kick in anyway. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-04-08Define prototypes for hw/xfree86/modes/xf86Modes.c only in xf86Modes.h.Jeremy White1-0/+1
This removes a large number of redundant declaration warnings. Signed-off-by: Jeremy White <jwhite@codeweavers.com> Reviewed-by: Robert Morell <rmorell@nvidia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10Move DRI2 from external module to built-inDaniel Stone1-3/+0
Instead of keeping a tiny amount of code in an external module, just man up and build it into the core server. v2: Fix test/Makefile.am to only link libdri2.la if DRI2 is set Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10Move DRI1 from external module to built-inDaniel Stone1-3/+0
Rather than building the tiny amount of code required for XFree86-DRI as an external module, build it in if it's enabled at configure time. v2: Fix test/Makefile.am to only link libdri.la if DRI is set Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> fixup for DRI1 move Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10Remove the last remnants of extmodDaniel Stone1-1/+0
extmod was originally a big pointless module. Now it's an empty, pointless module. This commit makes it unexist. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09Move RECORD from external module to built-inTomas Carnecky1-3/+0
Rather than languishing in its own special module, move RECORD into the core server. Signed-off-by: Tomas Carnecky <tom@dbservice.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09Move DBE from an external module to built-inTomas Carnecky1-3/+0
If DBE support is compiled in the server, just man up and build it into the server, rather than having it as an external module. Signed-off-by: Tomas Carnecky <tom@dbservice.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-06xfree86: add autoAddGPU option (v2)Dave Airlie1-1/+14
This option is to stop the X server adding non-primary devices as gpu screens. v2: fix per Keith's suggestion. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-04xfree86: fix use-after-free issue in checkInputPeter Hutterer1-0/+1
*dev is the condition of the while loop we're in, reset to NULL after freeing Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dave Airlie <airlied@redhat.com>