summaryrefslogtreecommitdiff
path: root/hw/xfree86/common
AgeCommit message (Collapse)AuthorFilesLines
2014-03-11Merge remote-tracking branch 'whot/for-keith'Keith Packard1-2/+20
2014-03-11xfree86: handle xorg.conf devices with logindPeter Hutterer1-2/+20
Only devices from the config backend have their attributes set, devices from the xorg.conf only have Option "Device". That option is also set by the config backend, so use it. And since the config backend sets our major/minor but xorg.conf devices don't have that set, make sure we try to stat it first where needed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-03-10Require video drivers to report that they support server managed fdsHans de Goede2-2/+15
This makes how we handle video drivers identical to what we do for input drivers, and this should make live easier for old non kms drivers. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2014-03-10xf86platformBus: Make doPlatformProbe accept a NULL gdev argumentHans de Goede1-9/+5
And use it from xf86platformAddDevice too, instead of directly calling drvp->platformProbe. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2014-03-03systemd-logind: Add delayed input device probingHans de Goede2-4/+46
With systemd-logind we cannot probe input devices while switched away, so if we're switched away, put the pInfo on a list, and probe everything on that list on VT-Enter. This is using an array grown by re-alloc, rather than a xorg_list since creating a new data-type to store a pInfo + list-entry just for this seems overkill. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-03systemd-logind: Hookup systemd-logind integrationHans de Goede2-3/+30
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-03systemd-logind: Add systemd-logind "core"Hans de Goede3-1/+6
This commits add the bulk of the systemd-logind integration code, but does not hook it up yet other then calling its init and fini functions, which don't do that much. Note the configure bits check for udev since systemd-logind use will only be supported in combination with udev. Besides that it only checks for dbus since all communication with systemd-logind is happening over dbus, so no further libs are needed. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-03hotplug: Extend OdevAttributes for server-managed fd supportHans de Goede2-0/+15
With systemd-logind support, the xserver, rather than the drivers will be responsible for opening/closing the fd for drm nodes. This commit adds a fd member to OdevAttributes to store the fd to pass it along to the driver. systemd-logind tracks devices by their chardev major + minor numbers, so also add OdevAttributes to store the major and minor. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2014-03-03OdevAttribute: Remove unowned flag from OdevAttributes headHans de Goede3-6/+13
The OdevAttributes struct should just be a head of the attributes list, and not contain various unrelated flags. Instead add a flags field to struct xf86_platform_device and use that. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2014-03-03OdevAttribute: Add support for integer attributesHans de Goede2-0/+24
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: Add config_odev_get_attribute helperHans de Goede1-15/+2
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>
2014-03-03xf86Xinput: Modify API for server-managed fd supportHans de Goede3-1/+14
With systemd-logind support, the xserver, rather than the drivers will be responsible for opening/closing the fd for input devices. This commit adds a new capabilities field to the InputDriverRec and a XI86_DRV_CAP_SERVER_FD flag for drivers to indicate that they support server managed fds. This commit adds a new XI86_SERVER_FD flag to indicate to drivers when the server is managing the fd and they should not open/close it. Note that even if drivers declare they support server managed fds there is no guarantee they will actually get them. Since this changes the input driver ABI, this commit bumps it. systemd-logind tracks devices by their chardev major + minor numbers, since we are breaking ABI anyways also add major and minor fields for easy storage / retrieval of these. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-10xfree86: use xnfstrdup in the Xorg -configure codePeter Hutterer1-21/+21
Just for consistency, I'm pretty sure the code is generally not happy for malloc failures anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-02-05xfree86: unconstify another stringPeter Hutterer1-2/+2
Only Xorg -configure uses a hardcoded value here, so let's not change the rest of the server for that. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-02-05xfree86: un-constify inp_driver/inp_identifierPeter Hutterer1-4/+4
The only place this isn't allocated is during Xorg -configure where we just statically assing "mouse"/"kbd" and the identifiers for it. Everywhere else it's strdup'd and then free'd already. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-02-05xfree86: device name and driver are not const charPeter Hutterer1-2/+2
Allocated in one place, freed in another. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-02-04Revert "xfree86/common: handle string constants in xf86Xinput configuration"Peter Hutterer1-2/+2
This reverts commit 22592855e90d23013ba7f9e945d567725cb44bf3. What warning was this supposed to fix? Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
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-29xf86Events: add Enable/DisableInputDeviceForVTSwitch functionsHans de Goede2-24/+32
Factor this code out into functions so that it can be re-used for the systemd-logind device pause/resume paths. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-29xf86Events: refactor xf86VTLeave error handlingHans de Goede1-48/+46
Use kernel goto style error handling for xf86VTSwitchAway() failure. This makes it much easier to read the straight path. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-29xf86Events: split xf86VTSwitch into xf86VTLeave and xf86VTEnter functionsHans de Goede2-130/+145
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-29dbus-core: Make dbus-core no longer mutually exclusive with udevHans de Goede1-0/+5
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>
2014-01-29xfree86: Keep a non-seat0 X server from touching VTs (#71258)Laércio de Sousa1-1/+2
Updated patch following Hans de Goede's advice. If -seat option is passed with a value different from seat0, X server won't call xf86OpenConsole(). This is needed to avoid any race condition between seat0 and non-seat0 X servers. If a non-seat0 X server opens a given VT before a seat0 one which expects to open the same VT, one can get an inactive systemd-logind graphical session for seat0. This patch was first tested in a multiseat setup with multiple video cards and works quite well. I suppose it can also make things like DontVTSwitch and -sharevts meaningless for non-seat0 seats, so it may fix bug #69477, too. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=71258 https://bugs.freedesktop.org/show_bug.cgi?id=69477 (maybe) See also: http://lists.x.org/archives/xorg-devel/2013-October/038391.html https://bugzilla.redhat.com/show_bug.cgi?id=1018196 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-01-29xf86DeleteScreen: move check for NULL pScrn before first dereferenceAlan Coopersmith1-3/+4
Flagged by cppcheck 1.62: [hw/xfree86/common/xf86Helper.c:220] -> [hw/xfree86/common/xf86Helper.c:231]: (warning) Possible null pointer dereference: pScrn - otherwise it is redundant to check it against null. 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-01-22xfree86: Fix -Wshadow warningsKeith Packard5-32/+27
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 Packard29-205/+205
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/common: handle string constants in xf86Xinput configurationKeith Packard1-2/+2
Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12xfree86/common: Const GC funcs and ops in xf86VAarbiterKeith Packard1-2/+2
Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
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-12hw/xfree86: More const declarations for stringsKeith Packard2-2/+2
Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12Just remove dpms functsion from xf86.hKeith Packard1-4/+0
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 Packard20-67/+81
Also removes DPMS functiosn from Xext/dpmsproc.h Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12hw/xfree86: Lots of constant string supportKeith Packard11-41/+43
Make lots of string pointers 'const char' so that we can use constant strings with them without eliciting warnings. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12hw/xfree86: Make strings in DriverRec and ScrnInfoRec constKeith Packard1-7/+7
This avoids compiler warnings when initializing with string constants. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-09xfree86: Prefer fbdev to vesaAdam Jackson2-9/+10
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-12-09composite: Automatically enable backing store support on the screenAdam Jackson1-0/+5
... unless you explicitly disabled it with -bs on the command line, or with the corresponding thing in xorg.conf. v2: Drop a bogus hunk from compChangeWindowAttributes [vsyrjala] v3: s/TRUE/WhenMapped/ [jcristau] Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09bs: Set the screen's bs support level to WhenMappedAdam Jackson1-1/+1
Since we're using RedirectAutomatic to do this, we don't actually preserve contents when unmapped. v2: Don't say WhenMapped if Composite didn't initialize [vsyrjala] Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-11-12xfree86: Fix build without libpciaccessJeremy Huddleston Sequoia1-1/+4
Regression fix from commit 04ab07ca19236d6c9a947e065fb69b0dd0d16639 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Reviewed-by: Connor Behan <connor.behan@gmail.com>
2013-11-06ARM64: Add support for aarch64Andreas Schwab1-1/+1
Signed-off-by: Andreas Schwab <schwab@suse.de> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-31DDX/Randr: Avoid server crash when xrandr SetConfig is called while switched ↵Egbert Eich1-7/+9
away A call to Xrandr SetScreenConfig (for randr 1.1) causes the Xserver to crash when xf86SetViewport() which does not check if the hardware is accessible. Wrap accesses to xf86SetViewport() with if (vtSema) { ... } to avoid that. Signed-off-by: Egbert Eich <eich@freedesktop.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-31DDX/Events: Distinguish between Input- and GeneralHandlers in xf86VTSwitch()Egbert Eich1-9/+22
When enabling/disabling input handlers in xf86VTSwitch() we treat Input- and GeneralHandlers equally. The result is that after a VT switch the masks for EnabledDevices and AllSockets are equal and the distiction between both types is lost. Signed-off-by: Egbert Eich <eich@freedesktop.org> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-31DDX/DPMS: Call dixSaveScreens() also when screen is turned onEgbert Eich1-1/+8
DMPS calls dixSaveScreens() when turned off but not when turned on. In most cases this is irrelevant as DPMS is done when a key is hit in which case dixSaveScreens() will be called to unblank anyhow. This isn't the case if we use xset (or the DPMS extension directly) to unblank. Check screenIsSaved to make sure the state needs to be changed before calling dixSaveScreens(). Signed-off-by: Egbert Eich <eich@freedesktop.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-31xf86AddBusDeviceToConfigure(): Store device in DevToConfig[i].pVideoSøren Sandmann Pedersen1-0/+2
After fc3ab84d the pVideo field in DevToConfig[i] is no longer initialized, so it's always NULL. This causes the duplicate finding algorithm in the beginning of the function to not work anymore as it is based on this field. The symptom of this bug is that X -configure reports Number of created screens does not match number of detected devices. Configuration failed. Server terminated with error (2). Closing log file. rather than producing a working config file. This patch fixes that bug by initializing the field before calling xf86PciConfigureNewDev(). Cc: tvignatti@gmail.com Signed-off-by: Soren Sandmann <ssp@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-30xfree86: Bump video/input/extension ABIs for 1.15Adam Jackson1-3/+3
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-30randr: send RRResourceChangeNotify eventMichal Srb1-0/+5
Send RRResourceChangeNotify event when provider, output or crtc was created or destroyed. I.e. when the list of resources returned by RRGetScreenResources and RRGetProviders changes. Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Michal Srb <msrb@suse.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-29xfree86: Find primary entity when bus types are nominally differentConnor Behan1-1/+3
As of server 1.13, systems with DRM and Udev will have BUS_PLATFORM as their primary bus type. However, drivers not implementing a platformProbe function will still create entities of type BUS_PCI. We need to account for this when checking for the primary entity. Signed-off-by: Connor Behan <connor.behan@gmail.com> Acked-by: Tormod Volden <debian.tormod@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2013-09-10mipointer: Remove EnqueueEvent from miPointerScreenFuncRecAdam Jackson1-2/+0
No DDX overrode this, and we never actually called through that slot anyway. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10mipointer: Flatten calls to mieqSwitchScreenAdam Jackson1-1/+0
No DDX was overriding this. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-08-06Replace INCLUDES with AM_CPPFLAGSPeter Hutterer1-1/+1
newer automake gets quite noisy about this. hw/xfree86/ddc/Makefile.am:7: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') and many more of these. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-22dix: scale y back instead of x up when pre-scaling coordinatesPeter Hutterer1-1/+1
The peculiar way we handle coordinates results in relative coordinates on absolute devices being added to the last value, then that value is mapped to the screen (taking the device dimensions into account). From that mapped value we get the final coordinates, both screen and device coordinates. To avoid uneven scaling on relative coordinates, they are pre-scaled by screen ratio:resolution:device ratio factor before being mapped. This ensures that a circle drawn on the device is a circle on the screen. Previously, we used the ratio to scale x up. Synaptics already does its own scaling based on the resolution and that is done by scaling y down by the ratio. So we can remove the code from the driver and get approximately the same behaviour here. Minor ABI bump, so we can remove this from synaptics. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Emmanuel Benisty <benisty.e@gmail.com>