platform/upstream/xorg-server.git
10 years agoxkb: add XkbLoadKeymapFromString
Kristian Høgsberg [Wed, 12 Mar 2014 06:31:25 +0000 (16:31 +1000)]
xkb: add XkbLoadKeymapFromString

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
10 years agoxkb: add KeymapOrDefault
Kristian Høgsberg [Wed, 12 Mar 2014 07:20:17 +0000 (17:20 +1000)]
xkb: add KeymapOrDefault

Helper function to return a default map if the keymap compilation failed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
10 years agoxkb: factor out xkb loading to LoadXkm
Kristian Høgsberg [Wed, 12 Mar 2014 07:18:22 +0000 (17:18 +1000)]
xkb: factor out xkb loading to LoadXkm

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
10 years agoxkb: add a callback to xkbcomp
Peter Hutterer [Wed, 12 Mar 2014 06:08:15 +0000 (16:08 +1000)]
xkb: add a callback to xkbcomp

This provides a callback to write to xkbcomp's buffer once everything is
prepared.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
10 years agoxkb: constify XkbDDXOpenConfigFile
Peter Hutterer [Wed, 12 Mar 2014 07:17:25 +0000 (17:17 +1000)]
xkb: constify XkbDDXOpenConfigFile

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
10 years agoxkb: Repurpose XkbCopyDeviceKeymap to apply a given keymap to a device
Rui Matos [Fri, 7 Mar 2014 22:32:27 +0000 (14:32 -0800)]
xkb: Repurpose XkbCopyDeviceKeymap to apply a given keymap to a device

This will also make it useful for cases when we have a new keymap to
apply to a device but don't have a source device.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoxkb: Factor out a function to copy a keymap's controls onto another
Rui Matos [Fri, 7 Mar 2014 22:32:28 +0000 (14:32 -0800)]
xkb: Factor out a function to copy a keymap's controls onto another

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoconfig: search for PnPID on all parents (#75513)
Peter Hutterer [Tue, 25 Feb 2014 21:54:56 +0000 (07:54 +1000)]
config: search for PnPID on all parents (#75513)

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>
10 years agoxkb: push locked modifier state down to attached slave devices
Peter Hutterer [Wed, 26 Feb 2014 06:20:08 +0000 (16:20 +1000)]
xkb: push locked modifier state down to attached slave devices

Whenever the master changes, push the locked modifier state to the attached
slave devices, then update the indicators. This way, when NumLock or CapsLock
are hit on any device, the LED will light up on all devices. Likewise, a new
keyboard attached to a master device will light up with the correct
indicators.

The indicators are handled per-keyboard, depending on the layout, i.e. if one
keyboard has grp_led:num set, the NumLock LED won't light up on that keyboard.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
10 years agoxkb: factor out state update into a function
Peter Hutterer [Wed, 26 Feb 2014 06:16:10 +0000 (16:16 +1000)]
xkb: factor out state update into a function

No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
10 years agoxkb: factor out the StateNotify flag check
Peter Hutterer [Wed, 26 Feb 2014 06:03:19 +0000 (16:03 +1000)]
xkb: factor out the StateNotify flag check

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
10 years agoxfree86: handle xorg.conf devices with logind
Peter Hutterer [Tue, 11 Mar 2014 04:21:27 +0000 (14:21 +1000)]
xfree86: handle xorg.conf devices with logind

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>
10 years agoconfig: only free odev->attrib_name for string types
Peter Hutterer [Tue, 11 Mar 2014 04:20:51 +0000 (14:20 +1000)]
config: only free odev->attrib_name for string types

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
10 years agoxserver: fix build since system-logind.h
Dave Airlie [Sun, 9 Mar 2014 22:58:37 +0000 (08:58 +1000)]
xserver: fix build since system-logind.h

on tinderbox and irc

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoMerge remote-tracking branch 'jwrdecoede/for-keith'
Keith Packard [Sat, 8 Mar 2014 06:07:19 +0000 (22:07 -0800)]
Merge remote-tracking branch 'jwrdecoede/for-keith'

10 years agoFix xephyr build in --disable-glamor case
Jon TURNEY [Fri, 7 Mar 2014 15:59:10 +0000 (15:59 +0000)]
Fix xephyr build in --disable-glamor case

It broke after commit 9fe052d90cca90fdf750d3a45b151be2ac7f0ebd
"xephyr: Build support for rendering with glamor using a -glamor
option."

See http://tinderbox.x.org/builds/2014-03-07-0004/logs/xserver/#build

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agodix: Clear any existing selections before initializing privates
Andrew Eikum [Mon, 30 Dec 2013 15:15:41 +0000 (09:15 -0600)]
dix: Clear any existing selections before initializing privates

If there is a selection left over from a previous execution of the
main loop, and that selection has privates allocated for it, the X
server will crash. This is because dixResetPrivates() resets the
privates refcounts to zero without accounting for the reference held
by the selection object. When the selection is then deleted in
InitSelections() after the call to dixResetPrivates(), the refcount
for its privates type goes negative and bad things happen.

To fix this, we should delete any existing selections before calling
dixResetPrivates(). This will properly release the selection's
privates and avoid the crash.

A more thorough description of the problem and a test case to
reproduce the crash is available at a previous mail:
  "Negative Selection devPrivates refcount?"
  By Andrew Eikum to xorg-devel on 10 Dec 2013
  http://lists.freedesktop.org/archives/xorg-devel/2013-December/039492.html

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoglamor: Add support for DRI3.
Eric Anholt [Tue, 31 Dec 2013 08:07:42 +0000 (00:07 -0800)]
glamor: Add support for DRI3.

The render-nodes case is untested.

v2: Add a flag for wayland to suppress the native DRI3 support.
    Wayland isn't running as a master itself, so it can't do the auth
    on its own and has to ask the compositor to do it for us.  Dropped
    XXX about randr provider -- the conclusion from discussion with
    keithp was that if the driver's dri3_open for a provider on a
    different screen, that's a core dri3 bug.
v3: Don't put quite so much under GLAMOR_NO_DRI3, and add a comment
    explaining what this is about.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoglamor: Rename the DRI-related pixmap functions.
Eric Anholt [Tue, 31 Dec 2013 02:49:46 +0000 (18:49 -0800)]
glamor: Rename the DRI-related pixmap functions.

There was confusion over whether they should have egl in the name, and
they had DRI3 in the name even though they're useful to have without
DRI3.

v2: Just rename glamor_name_from_pixmap for now -- I'd accidentally
    conflict-resolved in adding new parameters from a later commit.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxorg: Connect up the glamor XV code, xorg DDX-only for now.
Eric Anholt [Sat, 28 Dec 2013 06:19:07 +0000 (22:19 -0800)]
xorg: Connect up the glamor XV code, xorg DDX-only for now.

Porting this code to be non-xorg-dependent is going to take
significant hacking, so just dump it in the glamoregl module for the
moment, so I can hack on it while regression testing.

v2: Fix compiler warnings by adding #include dix-config.h at the top,
    don't try to auto-init (I'll try to fix the xv ABI later).
v3: Fix last minute breakage of having reintroduced xf86ScrnToScreen
    (one of the compat macros).  Just use the drawable's pScreen instead.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxorg: Build a glamor_egl module.
Eric Anholt [Sat, 28 Dec 2013 00:44:15 +0000 (16:44 -0800)]
xorg: Build a glamor_egl module.

This is not exposing the API we want long term, but it should get
existing DDX drivers up and running while we massage the API into
shape.

v2: Use LIBADD instead of LDFLAGS to fix deps on libglamor.la, and use
    version 0.5.1 (the point it was forked from the external repo).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxephyr: Pass incoming XCB events to the Xlib event filter.
Eric Anholt [Fri, 20 Dec 2013 18:41:43 +0000 (10:41 -0800)]
xephyr: Pass incoming XCB events to the Xlib event filter.

This is the same thing that Qt ended up doing to get DRI2's event
mangling to happen despite using an XCB event loop.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoxephyr: Build support for rendering with glamor using a -glamor option.
Eric Anholt [Wed, 18 Dec 2013 21:24:14 +0000 (13:24 -0800)]
xephyr: Build support for rendering with glamor using a -glamor option.

v2: Avoid making the Ximage for the screen that we'll never use, and
    drive the screen pixmap creation for glamor ourselves.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com> (v1)
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agohw/xwin: More closely follow ICCCM for setting input focus
Jon TURNEY [Thu, 27 Jun 2013 22:56:23 +0000 (23:56 +0100)]
hw/xwin: More closely follow ICCCM for setting input focus

In multiwindow mode, more closely follow ICCCM section 4.1.7 when setting X
input focus to a window when the native Windows window acquires input focus:

- If InputHint is FALSE, don't use XSetInputFocus()
- If the window supports the WM_TAKE_FOCUS protocol, send a WM_TAKE_FOCUS message

This helps JDK 1.7 clients acquire the focus correctly.

Also, factor out checking client support for a given WM_PROTOCOLS protocol as a
separate function.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
10 years agohw/xwin: Remove unnecessary casts from malloc/realloc/calloc calls
Colin Harrison [Fri, 28 Feb 2014 15:02:14 +0000 (15:02 +0000)]
hw/xwin: Remove unnecessary casts from malloc/realloc/calloc calls

Remove unnecessary casts from malloc/realloc/calloc calls. This is the style
used for the majority of X server code.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Add missing FORCEEXIT token to XWin configuration file lexer
Colin Harrison [Fri, 28 Feb 2014 14:23:00 +0000 (14:23 +0000)]
hw/xwin: Add missing FORCEEXIT token to XWin configuration file lexer

Somehow this was left out of commmit f3fad371cce0f3836514ad5b29e59fa1ca0627a7

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Silence bell when volume is zero
Colin Harrison [Fri, 28 Feb 2014 14:21:46 +0000 (14:21 +0000)]
hw/xwin: Silence bell when volume is zero

Allow the bell to be turned off with X server option '-f 0', or by 'xset b off'.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Fix typo in comment
Colin Harrison [Fri, 28 Feb 2014 14:21:06 +0000 (14:21 +0000)]
hw/xwin: Fix typo in comment

'i' before 'e' except after 'c'

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Align parameter names in prototypes with definition
Colin Harrison [Fri, 28 Feb 2014 14:20:48 +0000 (14:20 +0000)]
hw/xwin: Align parameter names in prototypes with definition

A follow up to commits 2d9123fd451c5d91 and efe96a17, which changed the
parameter name in the definition from index to i, to fix shadowing index() but
didn't adjust the prototype declaration.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agohw/xwin: Just generate the WGL wrappers we need
Jon TURNEY [Wed, 1 Jan 2014 16:43:38 +0000 (16:43 +0000)]
hw/xwin: Just generate the WGL wrappers we need

Just generate the WGL wrappers we need, rather than for everything in wgl.xml

This avoids generating a lot of unused wrappers, and also avoids compilation
requiring a wglext.h at least as new as wgl.xml

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
10 years agohw/xwin: Fix implicit-function-declaration warning in XwinExtensionInit() when compil...
Yaakov Selkowitz [Wed, 10 Apr 2013 17:04:17 +0000 (18:04 +0100)]
hw/xwin: Fix implicit-function-declaration warning in XwinExtensionInit() when compiled with XWIN_GLX_WINDOWS defined

InitOutput.c: In function ‘XwinExtensionInit’:
InitOutput.c:170:9: error: implicit declaration of function ‘glxWinPushNativeProvider’ [-Werror=implicit-function-declaration]
         glxWinPushNativeProvider();
         ^
InitOutput.c:170:9: warning: nested extern declaration of ‘glxWinPushNativeProvider’ [-Wnested-externs]

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
10 years agoxf86OpenSerial: Add support server managed fds
Hans de Goede [Sat, 1 Feb 2014 12:21:15 +0000 (13:21 +0100)]
xf86OpenSerial: Add support server managed fds

Try to get a server managed fd from the Options before trying to open the
device node ourselves.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoconfig-udev: Don't try to add drm devices twice
Hans de Goede [Tue, 14 Jan 2014 14:47:48 +0000 (15:47 +0100)]
config-udev: Don't try to add drm devices twice

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>
10 years agosystemd-logind: Add delayed input device probing
Hans de Goede [Fri, 31 Jan 2014 14:21:38 +0000 (15:21 +0100)]
systemd-logind: Add delayed input device probing

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>
10 years agosystemd-logind: Hookup systemd-logind integration
Hans de Goede [Tue, 14 Jan 2014 14:37:33 +0000 (15:37 +0100)]
systemd-logind: Hookup systemd-logind integration

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>
10 years agosystemd-logind: Add systemd-logind "core"
Hans de Goede [Tue, 7 Jan 2014 11:15:12 +0000 (12:15 +0100)]
systemd-logind: Add systemd-logind "core"

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>
10 years agohotplug: Extend OdevAttributes for server-managed fd support
Hans de Goede [Mon, 13 Jan 2014 11:03:46 +0000 (12:03 +0100)]
hotplug: Extend OdevAttributes for server-managed fd support

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>
10 years agoOdevAttribute: Remove unowned flag from OdevAttributes head
Hans de Goede [Sun, 2 Feb 2014 12:54:33 +0000 (13:54 +0100)]
OdevAttribute: Remove unowned flag from OdevAttributes head

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>
10 years agoOdevAttribute: Add support for integer attributes
Hans de Goede [Sun, 2 Feb 2014 14:28:31 +0000 (15:28 +0100)]
OdevAttribute: Add support for integer attributes

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>
10 years agoOdevAttribute: config_odev_add_attribute: replace existing values
Hans de Goede [Mon, 3 Feb 2014 14:47:35 +0000 (15:47 +0100)]
OdevAttribute: config_odev_add_attribute: replace existing values

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>
10 years agoOdevAttribute: Add config_odev_get_attribute helper
Hans de Goede [Sun, 2 Feb 2014 10:25:34 +0000 (11:25 +0100)]
OdevAttribute: Add config_odev_get_attribute helper

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>
10 years agoxf86Xinput: Modify API for server-managed fd support
Hans de Goede [Mon, 13 Jan 2014 10:57:38 +0000 (11:57 +0100)]
xf86Xinput: Modify API for server-managed fd support

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>
10 years agolinux: xf86OpenConsole: Don't detach from controlling tty when it is our vt
Hans de Goede [Wed, 22 Jan 2014 10:32:56 +0000 (11:32 +0100)]
linux: xf86OpenConsole: Don't detach from controlling tty when it is our vt

Detaching from our controlling tty makes little sense when it is the same
as the vt we're asked to run on. So automatically assume -keeptty in this case.

This is useful to do because when not running as root the server can only make
various VT related ioctls when it does not detach from the tty.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agolinux: xf86OpenConsole remove root-rights check for keeptty option
Hans de Goede [Thu, 16 Jan 2014 09:37:28 +0000 (10:37 +0100)]
linux: xf86OpenConsole remove root-rights check for keeptty option

There is no reason why keeptty cannot be used without root-rights.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoV2: Add check for link from output to crtc before optimizing out a CrtcSet call
David Sodman [Mon, 10 Feb 2014 17:07:33 +0000 (09:07 -0800)]
V2: Add check for link from output to crtc before optimizing out a CrtcSet call

The function RRCrtcSet call checks to see if the config being set is
already configured, but, doesn't check that the selected outputs are
connected to the crtc before skipping.  This means that the following
sequence will omit the final CrtcSet call to the driver:

    CRTC c1 connect to output o
    CRTC c2 connect to output o
    CRTC c1 connect to output o

This change adds the check to ensure that each of the calls are made to
the driver.

Signed-off-by: David Sodman <dsodman@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoFix test/os to work on Solaris
Alan Coopersmith [Mon, 10 Feb 2014 07:13:51 +0000 (23:13 -0800)]
Fix test/os to work on Solaris

Due to bad decisions made decades ago at AT&T, on SVR4 OS'es the signal()
function resets the signal handler before calling the signal handler
(equivalent to sigaction flag SA_RESETHAND).  This is why the X server
has a OsSignal() helper function in os/utils.c that uses the portable
POSIX sigaction function to provide BSD/Linux semantics in a signal()
style API, so we switch to use that in this test case, allowing it to
pass on Solaris.

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>
10 years agoFix test/signal-logging to work on Solaris
Alan Coopersmith [Mon, 10 Feb 2014 07:13:50 +0000 (23:13 -0800)]
Fix test/signal-logging to work on Solaris

For some reason, Solaris libc sprintf() doesn't add "0x" to the %p output
as glibc does, causing the test to fail for not matching the exact output.
Since the 0x is desirable, we add it ourselves to the test string.

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>
10 years agogcc 4.2.1 doesn't support #pragma GCC diagnostic ignored
Matthieu Herrb [Sun, 9 Feb 2014 10:20:59 +0000 (11:20 +0100)]
gcc 4.2.1 doesn't support #pragma GCC diagnostic ignored

Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoMerge remote-tracking branch 'herrb/master'
Keith Packard [Tue, 25 Feb 2014 00:27:52 +0000 (16:27 -0800)]
Merge remote-tracking branch 'herrb/master'

10 years agoBump to 1.15.99.901 xorg-server-1.15.99.901
Keith Packard [Mon, 24 Feb 2014 17:51:39 +0000 (09:51 -0800)]
Bump to 1.15.99.901

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoMerge remote-tracking branch 'anholt/glamor-pull-request'
Keith Packard [Mon, 24 Feb 2014 17:40:23 +0000 (09:40 -0800)]
Merge remote-tracking branch 'anholt/glamor-pull-request'

10 years agoXi: check for invalid modifiers for XI2 passive grabs
Peter Hutterer [Thu, 20 Feb 2014 03:18:05 +0000 (13:18 +1000)]
Xi: check for invalid modifiers for XI2 passive grabs

The other values are checked correctly, but if a modifier was outside the
allowed range, it would go unnoticed and cause a out-of-bounds read error for
any mask equal or larger than 256. The DetailRec where we store the grab masks
is only sized to 8 * sizeof(Mask).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
10 years agotest: remove source file from hashtabletest LDADD
Gaetan Nadon [Wed, 19 Feb 2014 18:48:06 +0000 (13:48 -0500)]
test: remove source file from hashtabletest LDADD

LDADD is for libraries and not for source code.

Introduced in commit:  ccb3e78124fb05defd0c9b438746b79d84dfc3ae

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agotest/input: Fix alignment assertion for doubles
Thierry Reding [Wed, 19 Feb 2014 16:16:48 +0000 (17:16 +0100)]
test/input: Fix alignment assertion for doubles

The code previously tried to compute the offset of a field in the
valuator by subtracting the address of the valuator from the _value_ of
the field (rather than the field's address). The correct way to do it
would have been (note the &'s):

assert(((void *) &v->axisVal - (void *) v) % sizeof(double) == 0);
assert(((void *) &v->axes - (void *) v) % sizeof(double) == 0);

That's essentially what the offsetof() macro does. Using offsetof() has
the added benefit of not using void pointer arithmetic and therefore
silencing a warning on some compilers.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoGet rid of config/non-seat0.conf.multi-seat
Laércio de Sousa [Sun, 16 Feb 2014 22:43:49 +0000 (08:43 +1000)]
Get rid of config/non-seat0.conf.multi-seat

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>
10 years agoglamor: Move the EGL DRI3 code to GLAMOR_HAS_GBM.
Eric Anholt [Fri, 27 Dec 2013 22:21:05 +0000 (14:21 -0800)]
glamor: Move the EGL DRI3 code to GLAMOR_HAS_GBM.

There's nothing dependent on the presence of DRI3 code in the server
for this, but it does rely on GBM.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoglamor: Fix linking of the gradient shaders on GLES2.
Eric Anholt [Fri, 27 Dec 2013 21:21:21 +0000 (13:21 -0800)]
glamor: Fix linking of the gradient shaders on GLES2.

GLES2 sensibly doesn't allow you to attach multiple shaders for the
same stage to a single program.  This means we have to attach the
whole thing in one glShaderSource call.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoglamor: Don't bother keeping references to shader stages for gradients.
Eric Anholt [Fri, 27 Dec 2013 21:09:25 +0000 (13:09 -0800)]
glamor: Don't bother keeping references to shader stages for gradients.

They never get reattached to any other program, so saving them to
unreference later is a waste of code.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoglamor: Fix typo in setting v_position's attrib location.
Eric Anholt [Fri, 27 Dec 2013 19:29:27 +0000 (11:29 -0800)]
glamor: Fix typo in setting v_position's attrib location.

Assuming it was the first attribute assigned by the GL, it would have
ended up with location 0 anyway.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoglamor: Move shader precision stuff from build time to shader compile time.
Eric Anholt [Fri, 27 Dec 2013 10:13:27 +0000 (02:13 -0800)]
glamor: Move shader precision stuff from build time to shader compile time.

This is the last desktop-versus-ES2 build ifdef in core glamor.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoglamor: Unifdef the picture-format-to-format-and-type functions.
Eric Anholt [Fri, 27 Dec 2013 10:10:53 +0000 (02:10 -0800)]
glamor: Unifdef the picture-format-to-format-and-type functions.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoglamor: Move glamor_get_tex_format_type_from_pictformat to a .c file.
Eric Anholt [Sat, 28 Dec 2013 00:12:15 +0000 (16:12 -0800)]
glamor: Move glamor_get_tex_format_type_from_pictformat to a .c file.

A pair of 150 lines of inlined switch statements in a header file is
crazy.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoglamor: Unifdef the cache format indices.
Eric Anholt [Fri, 27 Dec 2013 10:04:11 +0000 (02:04 -0800)]
glamor: Unifdef the cache format indices.

We only ask for GL_RGB on desktop GL as far as I can see, but now if
GLES2 did happen to ask for GL_RGB it would return a cache index
instead of -1.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoglamor: Pass pixmaps around to unifdef glamor_iformat_for_depth().
Eric Anholt [Fri, 27 Dec 2013 09:23:15 +0000 (01:23 -0800)]
glamor: Pass pixmaps around to unifdef glamor_iformat_for_depth().

v2: Just pass in the PicturePtr to glamor_pict_format_is_compatible()
    (suggestion by keithp)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoglamor: Add a screen argument to drop an ifdef from glamor_set_alu().
Eric Anholt [Fri, 27 Dec 2013 09:17:10 +0000 (01:17 -0800)]
glamor: Add a screen argument to drop an ifdef from glamor_set_alu().

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoglamor: Drop a bunch of GLES2 ifdefs.
Eric Anholt [Wed, 25 Dec 2013 19:39:13 +0000 (11:39 -0800)]
glamor: Drop a bunch of GLES2 ifdefs.

Now that we're using epoxy, we can write code using both desktop and
ES symbols and decide what to use at runtime.

v2: Fix a spelling mistake (latter), since the lines were moved
    anyway (noticed by Rémi Cardona).  Fix condition invert in
    glamor_set_composite_texture (caught by Michel Dänzer).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com> (v1)
Reviewed-by: Adam Jackson <ajax@redhat.com> (v1)
10 years agoglamor: yInverted is a boolean value, so use the Bool type.
Eric Anholt [Wed, 25 Dec 2013 19:36:35 +0000 (11:36 -0800)]
glamor: yInverted is a boolean value, so use the Bool type.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoglamor: Drop fixed function transformation matrix setup.
Eric Anholt [Tue, 24 Dec 2013 02:00:46 +0000 (18:00 -0800)]
glamor: Drop fixed function transformation matrix setup.

gl_ModelViewProjection and friends aren't used in our shaders, so this
setup didn't do anything.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoglamor: Drop useless glEnable/glDisable(GL_TEXTURE_2D) calls.
Eric Anholt [Tue, 24 Dec 2013 01:50:46 +0000 (17:50 -0800)]
glamor: Drop useless glEnable/glDisable(GL_TEXTURE_2D) calls.

Those calls are only for enabling texture handling in the fixed
function pipeline, while everything we do is with shaders.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
10 years agoglamor: Put in a pluggable context switcher for GLX versus EGL.
Eric Anholt [Wed, 18 Dec 2013 23:27:52 +0000 (15:27 -0800)]
glamor: Put in a pluggable context switcher for GLX versus EGL.

The GLX side just gets the context from the current state.  That's
also something I want to do for EGL, so that the making a context is
separate from initializing glamor, but I think I need the modesetting
driver in the server before I think about hacking on that more.

The previous code was rather incestuous, along with pulling in xf86
dependencies to our dix code.  The new code just initializes itself
from the current state.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agoglamor: Rename glamor_get/put_dispatch to glamor_get/put_context.
Eric Anholt [Wed, 18 Dec 2013 21:10:24 +0000 (13:10 -0800)]
glamor: Rename glamor_get/put_dispatch to glamor_get/put_context.

It used to be the thing that returned your dispatch table and happeend
to set up the context, but now it just sets up the context.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agoglamor: Convert to using libepoxy.
Eric Anholt [Wed, 18 Dec 2013 20:18:20 +0000 (12:18 -0800)]
glamor: Convert to using libepoxy.

Libepoxy hides all the GL versus GLES2 dispatch handling for us, with
higher performance.

v2: Squash in the later patch to drop the later of two repeated
    glamor_get_dispatch()es instead (caught by keithp)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
10 years agoXQuartz: pointer -> void *
Jeremy Huddleston Sequoia [Fri, 14 Feb 2014 08:31:38 +0000 (00:31 -0800)]
XQuartz: pointer -> void *

Fix build regression from 60014a4a98ff924ae7f6840781f768c1cc93bbab

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
10 years agoDIST_SUBDIRS needs to include glamor, even if it isn't built
Keith Packard [Thu, 13 Feb 2014 23:25:56 +0000 (15:25 -0800)]
DIST_SUBDIRS needs to include glamor, even if it isn't built

Otherwise, glamor won't get cleaned for 'make distclean'

Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoconfig: fails to create tarball as xorg-server.conf file removed
Gaetan Nadon [Thu, 13 Feb 2014 22:36:34 +0000 (17:36 -0500)]
config: fails to create tarball as xorg-server.conf file removed

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>
10 years agoDelete stray ; in struct _DeviceChangedEvent
Alan Coopersmith [Mon, 10 Feb 2014 00:56:40 +0000 (16:56 -0800)]
Delete stray ; in struct _DeviceChangedEvent

Caused Solaris Studio cc to complain in every file which included it:
 "../include/eventstr.h", line 179: warning: syntax error:
  empty member 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>
10 years agoMerge remote-tracking branch 'whot/for-keith'
Keith Packard [Mon, 10 Feb 2014 00:05:42 +0000 (16:05 -0800)]
Merge remote-tracking branch 'whot/for-keith'

10 years agoxfree86: use xnfstrdup in the Xorg -configure code
Peter Hutterer [Wed, 5 Feb 2014 21:59:07 +0000 (07:59 +1000)]
xfree86: use xnfstrdup in the Xorg -configure code

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>
10 years agomi: fix printf warning about size_t format specifier
Peter Hutterer [Wed, 5 Feb 2014 05:12:22 +0000 (15:12 +1000)]
mi: fix printf warning about size_t format specifier

mieq.c:290:26: warning: format '%u' expects argument of type 'unsigned int',
but argument 2 has type 'size_t' [-Wformat=]

pnprintf supports size_t since 5ea21560dd071ea4ab87430000d087fd5fe1f092

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>
10 years agosync: Avoid ridiculously long timeouts
Mark Kettenis [Sun, 15 Dec 2013 13:31:10 +0000 (14:31 +0100)]
sync: Avoid ridiculously long timeouts

On OpenBSD, passing a timeout longer than 100000000 seconds to select(2) will
make it fail with EINVAL.  As this is original 4.4BSD behaviour it is not
inconceivable that other systems suffer from the same problem.  And Linux,
though not suffering from any 4.4BSD heritage, briefly did something similar:

<https://lkml.org/lkml/2012/8/31/263>

So avoid calling AdjustWaitForDelay() instead of setting the timeout to
(effectively) ULONG_MAX milliseconds.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
10 years agoephyr: Repaint entire screen when colormap is updated
Keith Packard [Fri, 7 Feb 2014 03:17:50 +0000 (19:17 -0800)]
ephyr: Repaint entire screen when colormap is updated

Any time the colormap is changed, the entire screen needs to be
repainted to match.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoconfigure.ac: add missing "test"
David Heidelberger [Fri, 7 Feb 2014 01:06:04 +0000 (02:06 +0100)]
configure.ac: add missing "test"

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
10 years ago__glGetProcAddress: explictly cast function pointers to void *
Alan Coopersmith [Tue, 4 Feb 2014 01:38:24 +0000 (17:38 -0800)]
__glGetProcAddress: explictly cast function pointers to void *

Fixes Solaris Studio compiler warning & error:

"glxext.c", line 557: warning: assignment type mismatch:
    pointer to void "=" pointer to function(void) returning void
"glxext.c", line 559: error: operands have incompatible types:
     pointer to void ":" pointer to function(void) returning void

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoxfree86: Fix a compiler warning on 64-bit.
Eric Anholt [Mon, 27 Jan 2014 19:36:08 +0000 (11:36 -0800)]
xfree86: Fix a compiler warning on 64-bit.

asm/mtrr.h makes this an unsigned long on 32, but a u64 on 64.  Cast
it to a long to win.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoglx: Delete dead NV program string functions.
Eric Anholt [Mon, 27 Jan 2014 19:36:07 +0000 (11:36 -0800)]
glx: Delete dead NV program string functions.

These have been throwing a compiler warning about missing prototypes,
since the generated code to define the prototypes stopped being
generated (possibly because the code was dead).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoglx: Reduce compiler warnings by not requesting GL extension prototypes.
Eric Anholt [Mon, 27 Jan 2014 19:36:06 +0000 (11:36 -0800)]
glx: Reduce compiler warnings by not requesting GL extension prototypes.

They're not officially in the ABI, so you shouldn't use them anyway.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoglx: Stop relying on libGL ABI bugs for glGetCompressedTexImage().
Eric Anholt [Mon, 27 Jan 2014 19:36:05 +0000 (11:36 -0800)]
glx: Stop relying on libGL ABI bugs for glGetCompressedTexImage().

In theory, the linux libGL ABI exposes just GL 1.2 plus GLX 1.3.  But,
thanks to libglapi, we're letting glGetCompressedTexImageARB() be
exposed too.  The GLX code was inappropriately relying on it by using
GL_GLEXT_PROTOTYPES.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoglx: Remove left-over glthread.c
Jon TURNEY [Mon, 6 Jan 2014 14:13:24 +0000 (14:13 +0000)]
glx: Remove left-over glthread.c

Commit be668096 "glx: convert to direct GL dispatch (v2)" removes glthread.c
from Makefile.am along with the rest of the dispatch table code, but doesn't
remove glthread.c itself.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agoconfigure: Don't add GLX_SYS_LIBS to XORG_SYS_LIBS
Adam Jackson [Wed, 5 Feb 2014 16:10:47 +0000 (11:10 -0500)]
configure: Don't add GLX_SYS_LIBS to XORG_SYS_LIBS

libglx.so is linked against libGL.so, but Xorg itself should not be.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 years agodix: fix a -Wshadow warning
Peter Hutterer [Wed, 5 Feb 2014 05:10:27 +0000 (15:10 +1000)]
dix: fix a -Wshadow warning

dispatch.c: In function 'SetVendorString':
dispatch.c:481:29: warning: declaration of 'string' shadows a global declaration [-Wshadow]
 SetVendorString(const char *string)
                             ^
dispatch.c:135:21: warning: shadowed declaration is here [-Wshadow]
 typedef const char *string;

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>
10 years agoxfree86: unconstify driver in the XF86ConfInputClassRec
Peter Hutterer [Wed, 5 Feb 2014 04:32:23 +0000 (14:32 +1000)]
xfree86: unconstify driver in the XF86ConfInputClassRec

No const value is ever assigned to it, let's not pretend it's const.

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>
10 years agoxfree86: unconstify another string
Peter Hutterer [Wed, 5 Feb 2014 04:30:50 +0000 (14:30 +1000)]
xfree86: unconstify another string

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>
10 years agoxfree86: un-constify inp_driver/inp_identifier
Peter Hutterer [Wed, 5 Feb 2014 04:24:54 +0000 (14:24 +1000)]
xfree86: un-constify inp_driver/inp_identifier

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>
10 years agoxfree86: device name and driver are not const char
Peter Hutterer [Wed, 5 Feb 2014 04:16:01 +0000 (14:16 +1000)]
xfree86: device name and driver are not const char

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>
10 years agodix: fix button state check before changing a button mapping
Peter Hutterer [Fri, 24 Jan 2014 08:16:54 +0000 (18:16 +1000)]
dix: fix button state check before changing a button mapping

dev->button->down is a bitmask, not a normal array. Use the helper function to
check, we technically allow the mapping to change after the physical button
has been pressed (but not yet processed yet), so only check BUTTON_PROCESSED.

From XSetPointerMapping(3):
"If any of the buttons to be altered are logically in the down state,
XSetPointerMapping returns MappingBusy, and the mapping is not changed."

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
10 years agoinclude: make the various button array lengths more obvious
Peter Hutterer [Fri, 24 Jan 2014 08:33:54 +0000 (18:33 +1000)]
include: make the various button array lengths more obvious

No functional changes, just making a better case for why MAP_LENGTH is 256.
"But can't we remove MAP_LENGTH then?" I hear you say? "Why, yes. Go for it!"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
10 years agodix: prevent a driver from initializing or submitting buttons > MAX_BUTTONS
Peter Hutterer [Fri, 24 Jan 2014 08:32:54 +0000 (18:32 +1000)]
dix: prevent a driver from initializing or submitting buttons > MAX_BUTTONS

The server internally relies on arrays with a MAX_BUTTONS maximum size (which
is the max the core protocol can transport). Make sure a driver adheres to
that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
10 years agoRevert "xfree86/common: handle string constants in xf86Xinput configuration"
Peter Hutterer [Wed, 29 Jan 2014 23:16:23 +0000 (09:16 +1000)]
Revert "xfree86/common: handle string constants in xf86Xinput configuration"

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>
10 years agoRevert "xfree86/parser: make strings in xf86MatchGroup const"
Peter Hutterer [Wed, 29 Jan 2014 23:12:41 +0000 (09:12 +1000)]
Revert "xfree86/parser: make strings in xf86MatchGroup const"

This reverts commit f71de60355cc76810657f40c7b5461af86b34bf7.

What warnings?

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
10 years agoinput: un-constify dev->name
Peter Hutterer [Wed, 29 Jan 2014 23:01:09 +0000 (09:01 +1000)]
input: un-constify dev->name

Fallout from fecc7eb1cf66db64728ee2d68cd9443df7e70879, and reverts most of the
rest of that patch.

The device name is allocated and may even change during PreInit. The const
warnings came from the test codes, the correct fix here is to fix the test
code.

touch.c: In function ‘touch_init’:
touch.c:254:14: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
     dev.name = "test device";

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>