platform/upstream/xorg-server.git
11 years agoephyr: Refactor XV adaptor feature detection.
Eric Anholt [Sun, 18 Aug 2013 18:08:32 +0000 (20:08 +0200)]
ephyr: Refactor XV adaptor feature detection.

This obviously wanted a helper function beforehand, but even more so
now that we have XCB.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoephyr: Remove some pointless indirection in the XV code.
Eric Anholt [Sun, 18 Aug 2013 18:02:53 +0000 (20:02 +0200)]
ephyr: Remove some pointless indirection in the XV code.

Now that we have XCB on the server side, we don't need to split these
functions out.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoephyr: Move event processing into ephyr.c.
Eric Anholt [Sun, 18 Aug 2013 16:38:29 +0000 (18:38 +0200)]
ephyr: Move event processing into ephyr.c.

No more extra event structure to translate between hostx.c and
ephyr.c!

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoephyr: Move the host screen info into the kdrive screen private.
Eric Anholt [Sun, 18 Aug 2013 15:28:08 +0000 (17:28 +0200)]
ephyr: Move the host screen info into the kdrive screen private.

We can include xcb bits from the same place as server headers, so
there's no need to hide them any more.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoephyr: Rename and use the proper type for what was host_screen->info.
Eric Anholt [Sun, 18 Aug 2013 14:45:06 +0000 (16:45 +0200)]
ephyr: Rename and use the proper type for what was host_screen->info.

Now that we can include server headers in talking to host X, we don't
need to hide any more.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoephyr: Expose a single function for detecting extensions.
Eric Anholt [Sun, 18 Aug 2013 12:12:45 +0000 (14:12 +0200)]
ephyr: Expose a single function for detecting extensions.

v2: Fix trying to include xcb-dri in the non-dri-build case (Noted by
    Julien)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoephyr: Drop dead ephyrHostAtomToLocal code.
Eric Anholt [Sun, 18 Aug 2013 12:01:53 +0000 (14:01 +0200)]
ephyr: Drop dead ephyrHostAtomToLocal code.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoXephyr: we're not using Xlib anymore, no need to undef _XSERVER64
Julien Cristau [Wed, 20 Oct 2010 18:10:43 +0000 (20:10 +0200)]
Xephyr: we're not using Xlib anymore, no need to undef _XSERVER64

Drop obsolete comments about interaction between Xlib code and that
macro, and stop undefining it.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoXephyr: handle errors in event loop
Julien Cristau [Sat, 25 Sep 2010 14:05:07 +0000 (16:05 +0200)]
Xephyr: handle errors in event loop

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
11 years agoXephyr: drop remaining Xlib dependency
Julien Cristau [Fri, 25 Jun 2010 13:20:57 +0000 (14:20 +0100)]
Xephyr: drop remaining Xlib dependency

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
11 years agoXephyr: move glx code to xcb
Julien Cristau [Mon, 21 Jun 2010 13:39:03 +0000 (14:39 +0100)]
Xephyr: move glx code to xcb

v2: Rebase on master, notably adding XCB for
    X_GLXvop_MakeCurrentReadSGI (anholt).
v3: Fix use-after-free (caught by Julien).

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
11 years agoXephyr: remove unused DRI1 code
Julien Cristau [Wed, 23 Jun 2010 17:36:00 +0000 (18:36 +0100)]
Xephyr: remove unused DRI1 code

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
11 years agoXephyr: move ephyrdri over to xcb
Julien Cristau [Sat, 19 Jun 2010 23:07:08 +0000 (00:07 +0100)]
Xephyr: move ephyrdri over to xcb

Require new xcb-xf86dri to get fixed GetDrawableInfo.

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
11 years agoXephyr: use xcb-xv instead of libXv
Julien Cristau [Sun, 20 Jun 2010 10:13:26 +0000 (11:13 +0100)]
Xephyr: use xcb-xv instead of libXv

v2: Massive, conflict-filled rebase.  I think I resolved everything
    right, but this host xv code makes my eyes bleed.  Touch-tested XV
    after the rebase (anholt).

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
11 years agoXephyr: use xcb for event handling
Julien Cristau [Mon, 21 Jun 2010 16:20:32 +0000 (17:20 +0100)]
Xephyr: use xcb for event handling

v2: Rebase on indentation changes, squash in a simpler variant of the
    later event compression patch, fix server hang or segfault on
    window close by reimplementing the x_io_error_handler in the new
    XCB event loop (anholt).

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
11 years agoXephyr: some more hostx.c xcb-ification
Julien Cristau [Thu, 24 Jun 2010 22:45:16 +0000 (23:45 +0100)]
Xephyr: some more hostx.c xcb-ification

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
11 years agoXephyr: move HostX.visual to xcb
Julien Cristau [Thu, 24 Jun 2010 22:35:15 +0000 (23:35 +0100)]
Xephyr: move HostX.visual to xcb

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
11 years agoXephyr: replace XKeycodeToKeysym with xcb-keysyms
Julien Cristau [Thu, 24 Jun 2010 22:26:48 +0000 (23:26 +0100)]
Xephyr: replace XKeycodeToKeysym with xcb-keysyms

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
11 years agoXephyr: delete unused hostx_get_extension_info function
Julien Cristau [Thu, 24 Jun 2010 22:17:32 +0000 (23:17 +0100)]
Xephyr: delete unused hostx_get_extension_info function

v2: Also remove the prototype (anholt)

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
11 years agoXephyr: delete unused proxy code
Julien Cristau [Mon, 21 Jun 2010 13:25:11 +0000 (14:25 +0100)]
Xephyr: delete unused proxy code

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
11 years agoXephyr: xcb-ify visual list construction
Julien Cristau [Sun, 20 Jun 2010 22:34:54 +0000 (23:34 +0100)]
Xephyr: xcb-ify visual list construction

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
11 years agoXephyr: xcb-ify pointer/keyboard grab
Julien Cristau [Sun, 20 Jun 2010 22:34:39 +0000 (23:34 +0100)]
Xephyr: xcb-ify pointer/keyboard grab

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
11 years agoXephyr: no need for XDisplayKeycodes
Julien Cristau [Sun, 20 Jun 2010 22:34:03 +0000 (23:34 +0100)]
Xephyr: no need for XDisplayKeycodes

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
11 years agoXephyr: use xcb-shape instead of XShape*
Julien Cristau [Thu, 24 Jun 2010 22:00:38 +0000 (23:00 +0100)]
Xephyr: use xcb-shape instead of XShape*

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
11 years agoXephyr: start converting hostx.c over to xcb
Julien Cristau [Sat, 19 Jun 2010 23:05:40 +0000 (00:05 +0100)]
Xephyr: start converting hostx.c over to xcb

v2: Dropped the hostx_load_keymap changes, now that that function is
    gutted (anholt).

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
11 years agoXephyr: stop loading the host's keymap
Julien Cristau [Fri, 25 Jun 2010 16:59:13 +0000 (17:59 +0100)]
Xephyr: stop loading the host's keymap

This isn't used anywhere.

v2: Rebase to the top of the patch series (anholt)

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
11 years agoXi: allow for XIAllowEvent requests larger than XI < 2.2 size (#68554)
Peter Hutterer [Mon, 26 Aug 2013 05:51:46 +0000 (15:51 +1000)]
Xi: allow for XIAllowEvent requests larger than XI < 2.2 size (#68554)

XIAllowEvents changed length in XI 2.2 (for the touchid). A bug in libXi
causes libXi to always use the new request length if the server supports
2.2, regardless of the client's XIQueryVersion request.

The server takes the client's XIQueryVersion request into account though,
resulting in a BadLength error if a 2.[0,1] client calls XIAllowEvents on a
XI 2.2+ server.

Can't fix this in libXi, so work around this in the server.

X.Org Bug 68554 <http://bugs.freedesktop.org/show_bug.cgi?id=68554>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
11 years agodix: check for grab type before checking XI2 mask
Peter Hutterer [Fri, 16 Aug 2013 05:30:59 +0000 (15:30 +1000)]
dix: check for grab type before checking XI2 mask

if the grab type isn't XI2, grab->xi2mask is random. That random data may
have the enter/leave mask set, leading to events sent to the client that the
client can't handler.

Source of these errors:
  _xgeWireToEvent: Unknown extension 131, this should never happen.

Simplest reproducer:
   Start Xephyr, press button inside window, move out. As the pointer leaves
   the Xephyr window, the errors appear.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
11 years agoXi: replace loop with memset
Peter Hutterer [Fri, 16 Aug 2013 00:55:09 +0000 (10:55 +1000)]
Xi: replace loop with memset

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
11 years agoinclude: wrap EMASKSIZE in parentheses
Peter Hutterer [Fri, 16 Aug 2013 01:05:49 +0000 (11:05 +1000)]
include: wrap EMASKSIZE in parentheses

Otherwise things like EMASKSIZE * foo will yield interesting results.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
11 years agotest: fix the gcc diagnostics pragma
Peter Hutterer [Thu, 22 Aug 2013 23:04:01 +0000 (09:04 +1000)]
test: fix the gcc diagnostics pragma

pop without push restores the commandline options. The proper way is to
push, then ignore, then pop.

And while we're at it, change the pop argument to a comment - pop ignores
the argument, but be proper about it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoDIX/Xi: Pass correct client to CheckDeviceGrabAndHintWindow()
Egbert Eich [Fri, 16 Aug 2013 17:52:16 +0000 (19:52 +0200)]
DIX/Xi: Pass correct client to CheckDeviceGrabAndHintWindow()

If we have a client which has registered for a DeviceButton grab
be sure to pass this to CheckDeviceGrabAndHintWindow(). Since the
order of clients is arbitrary there is no guarantee that the last
client in the list is the one that belongs to this class.

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoephyr: Fix warning about XID vs unsigned long * by changing function args
Eric Anholt [Sat, 17 Aug 2013 12:50:37 +0000 (14:50 +0200)]
ephyr: Fix warning about XID vs unsigned long * by changing function args

There's no reason to pass the data back out to the caller, since the
caller was dropping it on the floor.  The original data is a CARD32,
so no need to mess with weird unsigned longs.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoephyr: Drop is_ok logging.
Eric Anholt [Sat, 17 Aug 2013 12:38:08 +0000 (14:38 +0200)]
ephyr: Drop is_ok logging.

The only cases that lead to !is_ok are already EPHYR_LOG_ERROR, and it
fixes set-but-unused compiler warnings.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agokdrive: Fix const cast warnings in arguments processing.
Eric Anholt [Sat, 17 Aug 2013 12:36:09 +0000 (14:36 +0200)]
kdrive: Fix const cast warnings in arguments processing.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agokdrive: Fix const cast warnings in driver name handling.
Eric Anholt [Sat, 17 Aug 2013 11:11:17 +0000 (13:11 +0200)]
kdrive: Fix const cast warnings in driver name handling.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agokdrive: Fix a few easy cast warnings.
Eric Anholt [Sat, 17 Aug 2013 11:07:23 +0000 (13:07 +0200)]
kdrive: Fix a few easy cast warnings.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agokdrive: Drop dead code.
Eric Anholt [Sat, 17 Aug 2013 11:06:23 +0000 (13:06 +0200)]
kdrive: Drop dead code.

This is unused as of the introduction of a helper in
e7150db5350bc2113ff4126019b489847a4dc217

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoephyr: Fix dead code warning.
Eric Anholt [Sat, 17 Aug 2013 11:01:57 +0000 (13:01 +0200)]
ephyr: Fix dead code warning.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoephyr: Fix const-cast warnings for setting window title.
Eric Anholt [Sat, 17 Aug 2013 11:01:32 +0000 (13:01 +0200)]
ephyr: Fix const-cast warnings for setting window title.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoephyr: Fix const cast warnings in ephyrhostvideo.
Eric Anholt [Sat, 17 Aug 2013 10:54:33 +0000 (12:54 +0200)]
ephyr: Fix const cast warnings in ephyrhostvideo.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agodix: add missing include for DeleteWindowFromAnySelections
Julien Cristau [Sat, 27 Jul 2013 10:09:07 +0000 (12:09 +0200)]
dix: add missing include for DeleteWindowFromAnySelections

Fixes build error with XACE disabled:
window.c:886:5: error: implicit declaration of function 'DeleteWindowFromAnySelections' [-Werror=implicit-function-declaration]
     DeleteWindowFromAnySelections(pWin);
     ^

Debian bug#701372

Reported-by: Matthias Klose <doko@debian.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoAdd .dir-locals.el
Keith Packard [Sat, 17 Aug 2013 10:17:36 +0000 (12:17 +0200)]
Add .dir-locals.el

Enforce X.org style with an emacs configuration file

Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoMerge commit '9680f6a12d642c2e4bfa09bf459d678214059d74'
Keith Packard [Tue, 6 Aug 2013 05:12:12 +0000 (07:12 +0200)]
Merge commit '9680f6a12d642c2e4bfa09bf459d678214059d74'

11 years agoAllow disabling XFree86-DGA, DRI, VidModeExtension extensions
Alan Coopersmith [Tue, 6 Aug 2013 03:46:45 +0000 (20:46 -0700)]
Allow disabling XFree86-DGA, DRI, VidModeExtension extensions

Code to recognize these in extension enable/disable options was wrapped
in #ifdef XorgLoader, but that's not defined when building miinitext.c
since the great module merge of 1.13.  Change to an #ifdef that is defined.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Robert Hooker <robert.hooker@canonical.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoxfree86: de-duplicate some AM_CPPFLAGS
Peter Hutterer [Tue, 6 Aug 2013 03:14:56 +0000 (13:14 +1000)]
xfree86: de-duplicate some AM_CPPFLAGS

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
11 years agoReplace INCLUDES with AM_CPPFLAGS
Peter Hutterer [Tue, 6 Aug 2013 03:08:13 +0000 (13:08 +1000)]
Replace INCLUDES with AM_CPPFLAGS

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>
11 years agoxfree86: improve check for posix saved ids
Julien Cristau [Fri, 2 Aug 2013 18:07:36 +0000 (20:07 +0200)]
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>
11 years agotest: include dix-config.h in hashtabletest.c
Julien Cristau [Fri, 2 Aug 2013 21:46:00 +0000 (23:46 +0200)]
test: include dix-config.h in hashtabletest.c

Missing _XSERVER64 define caused inconsistent sizeof(XID) between the
test and hashtable code, leading to test failures on 64bit big endian
archs like s390x or ppc64.

Signed-off-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>
11 years agotest/xi2: fix protocol-xiqueryversion test
Maarten Lankhorst [Tue, 30 Jul 2013 13:31:24 +0000 (15:31 +0200)]
test/xi2: fix protocol-xiqueryversion test

The old code was broken and allowed setting client version >= XIVersion,
this was fixed in the previous patch, but updating the value for XIVersion
broke the tests, so fix the tests too.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoXi: Clamp XIClient maximal version to XIVersion
Maarten Lankhorst [Tue, 30 Jul 2013 12:45:21 +0000 (14:45 +0200)]
Xi: Clamp XIClient maximal version to XIVersion

Do not allow setting client version to an arbitrary value >= XIVersion.
Fixes a test error with test/xi2/protocol-xiqueryversion.c, introduced by
commit 4360514d1c "Xi: Allow clients to ask for 2.3 and then 2.2 without failing"

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoxfree86/man: document AutoAddGPU
Dave Airlie [Wed, 31 Jul 2013 01:35:44 +0000 (11:35 +1000)]
xfree86/man: document AutoAddGPU

This at least mentions AutoAddGPU and hints at when you might
want to disable it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoMerge remote-tracking branch 'whot/for-keith'
Keith Packard [Fri, 26 Jul 2013 05:50:27 +0000 (22:50 -0700)]
Merge remote-tracking branch 'whot/for-keith'

11 years agoXi: Allow clients to ask for 2.3 and then 2.2 without failing
Keith Packard [Thu, 11 Jul 2013 05:42:55 +0000 (22:42 -0700)]
Xi: Allow clients to ask for 2.3 and then 2.2 without failing

This allows different sub-systems within the same application to
request different Xi versions without either getting old behaviour
everywhere or simply failing with a BadValue.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoxfree86: detach scanout pixmaps when detaching output GPUs
Aaron Plattner [Tue, 30 Apr 2013 21:14:23 +0000 (14:14 -0700)]
xfree86: detach scanout pixmaps when detaching output GPUs

Commit 8f4640bdb9d3988148e09a08d2c7e3bab1d538d6 fixed a bit of a
chicken-and-egg problem by detaching GPU screens when their providers
are destroyed, which happens before CloseScreen is called.  However,
this created a new problem: the GPU screen tears down its RandR crtc
objects during CloseScreen and if one of them is active, it tries to
detach the scanout pixmap then.  This crashes because
RRCrtcDetachScanoutPixmap tries to get the master screen's screen
pixmap, but crtc->pScreen->current_master is already NULL at that
point.

It doesn't make sense for an unbound GPU screen to still be scanning
out its former master screen's pixmap, so detach them first when the
provider is destroyed.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agodix: set the valuator mask to ensure XI 1.x events have data
Peter Hutterer [Mon, 22 Jul 2013 03:43:07 +0000 (13:43 +1000)]
dix: set the valuator mask to ensure XI 1.x events have data

XI 1.x only allows for first + num valuators, so if a device sends data for
valuators 0 and 2+ only (i.e. valuator 1 is missing) we still need to get
the data for that from somewhere.
XI 1.x uses the hack of an unset valuator mask to get the right coordinates,
i.e. we set the value but don't set the mask for it so XI2 events have the
right mask.

For an absolute device in relative mode, this broke in b28a1af55cf, the
value was now always 0. This wasn't visible on the cursor, only in an XI 1.x
client. The GIMP e.g. sees jumps to x/0 every few events.

Drop the condition introduced in b28a1af55cf, data in valuators is always
absolute, regardless of the mode.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodix: check the xi2mask, not the grab type for touch listeners
Peter Hutterer [Wed, 24 Jul 2013 01:50:00 +0000 (11:50 +1000)]
dix: check the xi2mask, not the grab type for touch listeners

grab->type is only non-zero for passive grabs. We're checking an active grab
here, so we need to check if the touch mask is set on the grab.

Test case: grab the device, then start two simultaneous touches. The
grabbing client won't see the second touchpoints because grab->type is 0
and the second touch is not an emulating pointer.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agohw/xwin: Fix numerous 64-bit format/type cast issues with debug printing of pointers
Jon TURNEY [Mon, 8 Apr 2013 00:28:36 +0000 (01:28 +0100)]
hw/xwin: Fix numerous 64-bit format/type cast issues with debug printing of pointers

Numerous pieces of debug output cast a pointer to an int and then use a "%08x"
printf format.

Use "%p" format for 64-bit portability.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Fix possible crash in winMultiWindowGetClassHint
Colin Harrison [Tue, 25 Jun 2013 20:34:43 +0000 (21:34 +0100)]
hw/xwin: Fix possible crash in winMultiWindowGetClassHint

Fix a possible crash in winMultiWindowGetClassHint() when an application doesn't
null terminate the WM_CLASS property class name (which is an ICCCM conformance
bug in the application)

(Reported for running the contiki cooja simulator in multiwindow mode, although
it seems that many Java clients may have this problem, see [1])

Based on a patch by Marc Haesen.

v2: Avoid using strnlen() which is missing on MinGW
v3: Align with Xming patch

[1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6961123

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
11 years agohw/xwin: Remove obsolete WIN_XEVENTS_SHUTDOWN
Jon TURNEY [Tue, 18 Jun 2013 18:21:02 +0000 (19:21 +0100)]
hw/xwin: Remove obsolete WIN_XEVENTS_SHUTDOWN

Remove obsolete WIN_XEVENTS_SHUTDOWN.  This event is never generated.

(I think the idea was to listen for WM_DELETE_WINDOW, but that's not a very
useful thing to do for a hidden window.)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agoconfigure.ac: Check for python at configure time when building XWin with AIGLX
Jon TURNEY [Tue, 18 Jun 2013 17:03:05 +0000 (18:03 +0100)]
configure.ac: Check for python at configure time when building XWin with AIGLX

Check for python at configure time when building XWin with AIGLX, it's used to
generate the wrapper code for native GL functions.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Avoid a null dereference if CreateDIBSection() fails in NetWMToWinIconAlpha()
Jon TURNEY [Sat, 15 Jun 2013 23:07:57 +0000 (00:07 +0100)]
hw/xwin: Avoid a null dereference if CreateDIBSection() fails in NetWMToWinIconAlpha()

Avoid a null dereference of DIB_pixels if CreateDIBSection() fails in
NetWMToWinIconAlpha()

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Handle WM_MOUSEHWHEEL
Jon TURNEY [Thu, 21 Feb 2013 17:12:17 +0000 (17:12 +0000)]
hw/xwin: Handle WM_MOUSEHWHEEL

Handle WM_MOUSEHWHEEL tilt wheel messages, similarly to WM_MOUSEWHEEL scroll
wheel messages, to generate X button 6 and 7 presses and releases.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Map extra mouse buttons 1 and 2 to X buttons 8 and 9
Jon TURNEY [Thu, 21 Feb 2013 17:10:45 +0000 (17:10 +0000)]
hw/xwin: Map extra mouse buttons 1 and 2 to X buttons 8 and 9

Map extra mouse buttons 1 and 2 to X buttons 8 and 9, as conventional, leaving X
buttons 6 and 7 for tilt wheel.

Also add button labels for buttons 6, 7, 8 and 9 and change btn_labels in from a
dynamic allocation to a fixed one of the required size for all the labels we
use.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Remove unneeded WM_XBUTTON message defines
Jon TURNEY [Tue, 19 Feb 2013 14:38:40 +0000 (14:38 +0000)]
hw/xwin: Remove unneeded WM_XBUTTON message defines

Remove unneeded WM_XBUTTON message defines, they have been provided by w32api
for a long time now.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Change winTranslateKey() to return it's result as it's return value
Jon TURNEY [Mon, 17 Dec 2012 22:38:00 +0000 (22:38 +0000)]
hw/xwin: Change winTranslateKey() to return it's result as it's return value

Change winTranslateKey() to return it's result as it's return value, and change
it's uses as well.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Consider left and right modifier keys independently on gaining focus
Oliver Schmidt [Mon, 5 Nov 2012 15:05:32 +0000 (15:05 +0000)]
hw/xwin: Consider left and right modifier keys independently on gaining focus

Handle left and right ctrl and shift keys independently

Assume that all modifiers are cleared when all keys are released on focus lost,
as internalKeyState doesn't record which modifier key was pressed.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Remove an extra '\n' from some log messages
Jon TURNEY [Mon, 5 Apr 2010 13:22:39 +0000 (14:22 +0100)]
hw/xwin: Remove an extra '\n' from some log messages

Remove an extra '\n' from internal client IOError log messages

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: _NET_WM_STATE is ATOM[] not ATOM
Jon TURNEY [Sat, 4 Feb 2012 17:04:11 +0000 (17:04 +0000)]
hw/xwin: _NET_WM_STATE is ATOM[] not ATOM

_NET_WM_STATE is ATOM[] not ATOM, a list of window state hints, so check all of
the atoms, not just the first one

See EWMH specifcation, section "Application Window Properties"

v2: Actually use [] on the returned atom data

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread
Jon TURNEY [Wed, 31 Aug 2011 20:35:14 +0000 (21:35 +0100)]
hw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread

Currently, WM_ENDSESSION just calls GiveUp() to set the DE_TERMINATE flag. But
for the X server to exit cleanly, we also need the X server dispatch loop to be
unblocked so it can notice that DE_TERMINATE has been set and exit, removing
it's lock file and any unix domain socket.

It appears that the system will terminate the process when the last UI thread in
that process returns from processing WM_ENDSESSION for the last top-level
window.

Since WM_ENDSESSION appears to sent by the system via SendMessage()
(synchronously) and the wndproc is called to process it in the message thread
for that window (the X server thread), we can't easily terminate the X server
dispatch loop from inside the WM_ENDSESSION message processing.

So, create a messaging window, a hidden, top-level window, with a separate
thread to catch this message, and process it by calling GiveUp() and then
blocking on a mutex until the X server dispatch loop exits.

Also, notice when this is a shutdown cancel WM_ENDSESSION message and take no
action.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agoAllow DDX to provide a main()
Jon TURNEY [Mon, 3 Sep 2012 14:19:43 +0000 (15:19 +0100)]
Allow DDX to provide a main()

XQuartz already conditionally renames main() as dix_main() so it can provide
it's own main().  This isn't the ideal way of doing this, as it prevents libdix
built this way from being useful with any other DDX.

So instead, always name that function dix_main(), and also provide a stub main()
which just calls dix_main(), which can be overriden in the DDX.

Add a main() to XWin (XQuartz already has one, of course).

It's no longer neccessary to link XWin and XQuartz with libmain.

v2: Remove unneeded stub main hw/xwin/InitOutput.c

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agoMerge remote-tracking branch 'alanc/master'
Keith Packard [Tue, 23 Jul 2013 03:34:41 +0000 (20:34 -0700)]
Merge remote-tracking branch 'alanc/master'

11 years agodix: scale y back instead of x up when pre-scaling coordinates
Peter Hutterer [Thu, 18 Jul 2013 22:56:38 +0000 (08:56 +1000)]
dix: scale y back instead of x up when pre-scaling coordinates

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>
11 years agoFix typo in header guard.
Thomas Klausner [Fri, 12 Jul 2013 06:21:19 +0000 (08:21 +0200)]
Fix typo in header guard.

Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
11 years agoXephyr: Use _XEatDataWords (from Xlib 1.6) instead of _XEatData
Alan Coopersmith [Sat, 6 Jul 2013 05:43:17 +0000 (22:43 -0700)]
Xephyr: Use _XEatDataWords (from Xlib 1.6) instead of _XEatData

Simplifies code and reduces risk of overflow from converting length
field in X replies from words to bytes.

One call to _XEatData is left in ephyrHostGLXGetStringFromServer where
it's already been checked for overflow, and other values have been
subtracted from it to reduce the size of data remaining to be eaten.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
11 years agoglxproxy: Use _XEatDataWords (from Xlib 1.6) instead of _XEatData
Alan Coopersmith [Sat, 6 Jul 2013 05:35:32 +0000 (22:35 -0700)]
glxproxy: Use _XEatDataWords (from Xlib 1.6) instead of _XEatData

Reduces risk of overflow from converting length field in X replies
from words to bytes.   (Also seems to be what several calls were
already incorrectly passing to _XEatData.)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
11 years agoglxproxy: Use _XReadPad instead of _XEatData to clean up the slop
Alan Coopersmith [Sat, 6 Jul 2013 05:32:10 +0000 (22:32 -0700)]
glxproxy: Use _XReadPad instead of _XEatData to clean up the slop

Xlib already provides a function to eat padding bytes after the
data read, so use it instead of calculating it ourselves.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
11 years agoXephyr: integer overflow in XF86DRIGetClientDriverName()
Alan Coopersmith [Mon, 15 Apr 2013 15:41:14 +0000 (08:41 -0700)]
Xephyr: integer overflow in XF86DRIGetClientDriverName()

clientDriverNameLength is a CARD32 and needs to be bounds checked before
adding one to it to come up with the total size to allocate, to avoid
integer overflow leading to underallocation and writing data from the
network past the end of the allocated buffer.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoXephyr: integer overflow in XF86DRIOpenConnection()
Alan Coopersmith [Mon, 15 Apr 2013 15:39:03 +0000 (08:39 -0700)]
Xephyr: integer overflow in XF86DRIOpenConnection()

busIdStringLength is a CARD32 and needs to be bounds checked before adding
one to it to come up with the total size to allocate, to avoid integer
overflow leading to underallocation and writing data from the network past
the end of the allocated buffer.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
11 years agoXephyr: integer overflow in ephyrHostGLXGetStringFromServer()
Alan Coopersmith [Sun, 14 Apr 2013 17:50:50 +0000 (10:50 -0700)]
Xephyr: integer overflow in ephyrHostGLXGetStringFromServer()

reply.length & reply.size are CARD32s and need to be bounds checked before
multiplying or adding to come up with the total size to allocate, to avoid
integer overflow leading to underallocation and writing data from the
network past the end of the allocated buffer.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
11 years agoXdmx: integer overflow in GetGLXFBConfigs()
Alan Coopersmith [Sun, 14 Apr 2013 16:45:26 +0000 (09:45 -0700)]
Xdmx: integer overflow in GetGLXFBConfigs()

numFBConfigs & numAttribs are CARD32s and need to be bounds checked before
multiplying by structure sizes to come up with the total size to allocate,
to avoid integer overflow leading to underallocation and writing data from
the network past the end of the allocated buffer.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
11 years agoXdmx: integer overflow in GetGLXVisualConfigs()
Alan Coopersmith [Sun, 14 Apr 2013 16:33:57 +0000 (09:33 -0700)]
Xdmx: integer overflow in GetGLXVisualConfigs()

numVisuals & numProps are both CARD32 and need to be bounds checked before
multiplying by structure sizes to come up with the total size to allocate,
to avoid integer overflow leading to underallocation and writing data from
the network past the end of the allocated buffer.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
11 years agodix: allow a ConstantDeceleration between 0 and 1 (#66134)
Peter Hutterer [Mon, 15 Jul 2013 03:06:28 +0000 (13:06 +1000)]
dix: allow a ConstantDeceleration between 0 and 1 (#66134)

A constant deceleration of x simply means (delta * 1/x). We limited that to
values >= 1.0f for obvious reasons, but can also allow values from 0-1.
That means that ConstantDeceleration is actually a ConstantAcceleration, but
hey, if someone needs it...

X.Org Bug 66134 <http://bugs.freedesktop.org/show_bug.cgi?id=66134>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agodix: UpdateTouchesForGrab must only free the listener grab if it is non-NULL
Peter Hutterer [Fri, 12 Jul 2013 04:10:10 +0000 (14:10 +1000)]
dix: UpdateTouchesForGrab must only free the listener grab if it is non-NULL

If a client calls XIGrabDevice in response to a ButtonPress event (regular
event selection), the device will have a grab, but listener->grab is NULL.

Check for that, to avoid logspam.

[ 26293.863] (EE) BUG: triggered 'if (!pGrab)'
[ 26293.863] (EE) BUG: grabs.c:256 in FreeGrab()
[ 26293.863] (EE)
[ 26293.863] (EE) Backtrace:
[ 26293.864] (EE) 0: /usr/bin/Xorg (FreeGrab+0x54) [0x45d3fc]
[ 26293.864] (EE) 1: /usr/bin/Xorg (UpdateTouchesForGrab+0x135) [0x447d4e]
[ 26293.864] (EE) 2: /usr/bin/Xorg (ActivatePointerGrab+0x1ba) [0x447f3d]
[ 26293.864] (EE) 3: /usr/bin/Xorg (GrabDevice+0x3e6) [0x4503bc]
[ 26293.864] (EE) 4: /usr/bin/Xorg (ProcXIGrabDevice+0x1f9) [0x5981b1]
[ 26293.865] (EE) 5: /usr/bin/Xorg (ProcIDispatch+0x78) [0x58aa17]
[ 26293.865] (EE) 6: /usr/bin/Xorg (Dispatch+0x30d) [0x43347e]
[ 26293.865] (EE) 7: /usr/bin/Xorg (main+0x61d) [0x498175]
[ 26293.865] (EE) 8: /lib64/libc.so.6 (__libc_start_main+0xf5) [0x3df5621b75]
[ 26293.865] (EE) 9: /usr/bin/Xorg (_start+0x29) [0x423a19]
[ 26293.866] (EE) 10: ? (?+0x29) [0x29]
[ 26293.866] (EE)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
11 years agoconfig: provide example configuration for multi-seat setups
Peter Hutterer [Fri, 12 Jul 2013 02:17:47 +0000 (12:17 +1000)]
config: provide example configuration for multi-seat setups

Seats other than seat0 need custom configuration. Provide that with a
default configuration file so we can share it across distros.

This file intentionally does not end in .conf so it won't get picked up by
the server after a normal installation. gdm, or whatever starts up the
servers will have to explicitly specifiy this config file.

This file replaces the one currently written by systemd's multi-seat-x
binary:
http://cgit.freedesktop.org/systemd/systemd/tree/src/login/multi-seat-x.c

CC: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
11 years agoFix mouse header include on DragonFly and FreeBSD
François Tigeot [Mon, 15 Jul 2013 19:54:26 +0000 (21:54 +0200)]
Fix mouse header include on DragonFly and FreeBSD

*  __FreeBSD_kernel_version doesn't exist anymore

* The removed check was for FreeBSD versions from before September 2000
  which are no longer supported anyway

* Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66045

Signed-off-by: François Tigeot <ftigeot@wolfpond.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoos: Remove any old logfile before trying to write to it
Jon TURNEY [Thu, 8 Nov 2012 13:41:13 +0000 (13:41 +0000)]
os: Remove any old logfile before trying to write to it

If we are not backing up logfiles, remove the old logfile before trying to write
a new logfile, as otherwise the operation may fail if the previous logfile was
created by a different user.

This change is useful when:
- The DDX doesn't use the logfile backup mechanism (i.e. not Xorg)
- The DDX is run by a non-root user, and then by a different non-root user
- The logfile directory doesn't have the restricted-deletion flag set

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Acked-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodix: when ungrabbing an active grab, accept pointer grabs (#66720)
Peter Hutterer [Tue, 9 Jul 2013 03:27:19 +0000 (13:27 +1000)]
dix: when ungrabbing an active grab, accept pointer grabs (#66720)

Ungrabbing a device during an active touch grab rejects the grab. Ungrabbing
a device during an active pointer grab accepts the grab.

Rejection is not really an option for a pointer-emulated grab, if a client
has a button mask on the window it would get a ButtonPress emulated after
UngrabDevice. That is against the core grab behaviour.

X.Org Bug 66720 <http://bugs.freedesktop.org/show_bug.cgi?id=66720>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
11 years agoxkb: don't call atoi(NULL) when parsing argv
Julien Cristau [Mon, 1 Jul 2013 17:39:30 +0000 (19:39 +0200)]
xkb: don't call atoi(NULL) when parsing argv

If the -ardelay or -arinterval options have no argument, there's no
point trying to read it.

See
http://www.forallsecure.com/bug-reports/feb3db57fc206d8df22ca53a6907f74973876272/

Reported-by: Alexandre Rebert <alexandre@cmu.edu>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoRevert "DRI2: re-allocate DRI2 drawable if pixmap serial changes"
Eric Anholt [Mon, 17 Jun 2013 22:51:19 +0000 (15:51 -0700)]
Revert "DRI2: re-allocate DRI2 drawable if pixmap serial changes"

This reverts commit 3209b094a3b1466b579e8020e12a4f3fa78a5f3f.  After a
long debug session by Paul Berry, it appears that this was the commit
that has been producing sporadic failures in piglit front buffer
rendering tests for the last several years.

GetBuffers may return fresh buffers with invalid contents at a couple
reasonable times:

- When first asked for a non-fake-front buffer.
- When the drawable size is changed, an Invalidate has been sent, and
  obviously the app needs to redraw the whole buffer.
- After a glXSwapBuffers(), GL allows the backbuffer to be undefined,
  and an Invalidate was sent to tell the GL that it should grab these
  appropriate new buffers to avoid stalling.

But with the patch being reverted, GetBuffers would also return fresh
invalid buffers when the drawable serial number changed, which is
approximately "whenever, for any reason".  The app is not expecting
invalid buffer contents "whenever", nor is it valid.  Because the GL
usually only GetBuffers after an Invalidate is sent, and the new
buffer allocation only happened during a GetBuffers, most apps saw no
problems.  But apps that do (fake-)frontbuffer rendering do frequently
ask the server for the front buffer (since we drop the fake front
allocation when we're not doing front buffer rendering), and if the
drawable serial got bumped midway through a draw, the server would
pointlessly ditch the front *and* backbuffer full of important
drawing, resulting in bad rendering.

The patch was originally to fix bugzilla:
https://bugs.freedesktop.org/show_bug.cgi?id=28365
Specifically:

    To reproduce, start with a large-ish display (i.e. 1680x1050 on my
    laptop), use the patched glxgears from bug 28252 to add the
    -override option.  Then run glxgears -override -geometry 640x480
    to create a 640x480 window in the top left corner, which will work
    fine.  Next, run xrandr -s 640x480 and watch the fireworks.

I've tested with an override-redirect glxgears, both with vblank sync
enabled and disabled, both with gnome-shell and no window manager at
all, before and after this patch.  The only problem observed was that
before and after the revert, sometimes when alt-tabbing to kill my
gears after completing the test gnome-shell would get confused about
override-redirectness of the glxgears window (according to a log
message) and apparently not bother doing any further compositing.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
11 years agoMerge remote-tracking branch 'jturney/master'
Keith Packard [Tue, 18 Jun 2013 17:53:08 +0000 (10:53 -0700)]
Merge remote-tracking branch 'jturney/master'

11 years agohw/xwin: Update manifest to target all architectures, not just x86
Jon TURNEY [Sat, 30 Mar 2013 19:44:14 +0000 (19:44 +0000)]
hw/xwin: Update manifest to target all architectures, not just x86

Update manifest to target all architectures, not just x86

Also: Write explicit dependencies for Xwin.rc.  XWin.exe.manifest and X.ico are
included the resource compiler output, so add a dependency on them to cause it
to be recompiled if they change.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Win32 Windows properties are of pointer type HANDLE, not an integer type
Jon TURNEY [Sun, 31 Mar 2013 17:36:37 +0000 (18:36 +0100)]
hw/xwin: Win32 Windows properties are of pointer type HANDLE, not an integer type

Win32 Windows properties are of pointer type HANDLE, not an integer type, but we
use the Windows property WINDOW_WID_PROP to store the X window XID.

Add appropriate casts to show it doesn't matter that an XID is smaller than a
pointer on 64-bit build.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: winMultiWindowGetTransientFor() returns an XID not a WindowPtr
Jon TURNEY [Sun, 31 Mar 2013 17:35:35 +0000 (18:35 +0100)]
hw/xwin: winMultiWindowGetTransientFor() returns an XID not a WindowPtr

winMultiWindowGetTransientFor() accesses the WM_TRANSIENT_FOR property, which is
an X window XID (which we compare with WINDOW_WID_PROP) and not a WindowPtr.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Change winIconIsOverride() to take a HICON parameter
Jon TURNEY [Sat, 30 Mar 2013 19:47:16 +0000 (19:47 +0000)]
hw/xwin: Change winIconIsOverride() to take a HICON parameter

Change winIconIsOverride() to take a HICON parameter, so some unneccessary
casts, which weren't portable to 64-bit Cygwin, can be removed.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Fix uses of CreateDialogParam() for 64-bit builds
Jon TURNEY [Sat, 30 Mar 2013 19:41:06 +0000 (19:41 +0000)]
hw/xwin: Fix uses of CreateDialogParam() for 64-bit builds

Fix uses of CreateDialogParam() to be more strictly correct, for 64-bit builds

dwInitParam parameter is LPARAM, not int
Return type of DLGPROC is INT_PTR, not WINBOOL

Also: Reporting the value of g_hDlgDepthChange is completely uninteresting, we
are just interested in GetLastError() if it is NULL

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: deprecated interface cygwin_conv_to_win32_path() doesn't exist in 64-bit...
Jon TURNEY [Sat, 30 Mar 2013 19:40:31 +0000 (19:40 +0000)]
hw/xwin: deprecated interface cygwin_conv_to_win32_path() doesn't exist in 64-bit cygwin

The deprecated interface cygwin_conv_to_win32_path() doesn't exist in 64-bit
cygwin, but both the ID_ABOUT_CHANGELOG control and the referenced file who's
path we are converting haven't existed for a while, so just remove this unused,
cygwin-specific code.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agohw/xwin: Fix a 64-bit portability issue with casting HINSTANCE result of ShellExecute...
Jon TURNEY [Mon, 8 Apr 2013 00:27:26 +0000 (01:27 +0100)]
hw/xwin: Fix a 64-bit portability issue with casting HINSTANCE result of ShellExecute() to an integer

Fix a 64-bit portability issue with casting HINSTANCE result of ShellExecute()
to an integer: Since HINSTANCE is a pointer type, use INT_PTR rather than int.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
11 years agoconfig: add a quirks file for devices needing special configuration
Peter Hutterer [Tue, 4 Jun 2013 04:39:33 +0000 (14:39 +1000)]
config: add a quirks file for devices needing special configuration

This is the fedora quirks file configuring the special handling some devices
need. Rather than keeping this distro-specific add it to the tree so we can
share these quirks.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
11 years agodix: add missing dixFreeRegistry define
Maarten Lankhorst [Thu, 30 May 2013 09:23:07 +0000 (11:23 +0200)]
dix: add missing dixFreeRegistry define

Fixes a build failure on debian's udeb builds.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>