meego-w40:xserver-xorg.git
6 years agoconfigure.ac: 1.11.3.901 (1.11.4 RC1) xorg-server-1.11.3.901
Jeremy Huddleston [Sat, 7 Jan 2012 06:01:03 +0000 (22:01 -0800)]
configure.ac: 1.11.3.901 (1.11.4 RC1)

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
6 years agoXi: Fix mishandled git merge
Jeremy Huddleston [Sat, 7 Jan 2012 06:12:14 +0000 (22:12 -0800)]
Xi: Fix mishandled git merge

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
6 years agoMerge remote-tracking branch 'whot/server-1.11-branch' into server-1.11-branch
Jeremy Huddleston [Tue, 3 Jan 2012 01:58:22 +0000 (20:58 -0500)]
Merge remote-tracking branch 'whot/server-1.11-branch' into server-1.11-branch

6 years agoXi: assign correct grab_mode/other_device_mode in XI2 passive grabs
Carlos Garnacho [Tue, 13 Dec 2011 14:41:23 +0000 (15:41 +0100)]
Xi: assign correct grab_mode/other_device_mode in XI2 passive grabs

CreateGrab() expects the keyboard mode to be stored in grab_mode, and the
pointer mode in other_device_mode, so respect this in passive XI2 grabs,
and switch modes if needed.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
(cherry picked from commit 5b169cb695bd450d7f64e3800f00c9237ee67f96)

6 years agoChange disable_clientpointer return type to void
Alan Coopersmith [Fri, 9 Dec 2011 05:52:07 +0000 (21:52 -0800)]
Change disable_clientpointer return type to void

It doesn't return anything, nor does it's caller expect it to.

Fixes Solaris Studio compiler error:
"xichangehierarchy.c", line 214: Function has no return statement : disable_clientpointer

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>
(cherry picked from commit 372a6f10dc2d74d2d179e8b92449e9b8636a99ef)

6 years agoxfixes: don't dereference a NULL cursor
Peter Hutterer [Tue, 29 Nov 2011 23:06:06 +0000 (09:06 +1000)]
xfixes: don't dereference a NULL cursor

If the new cursor is the NULL cursor, don't dereference it and use zeros
instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 1ab50be938524dcd4a9e56d27e3b96a27c2db2c0)

6 years agoXi: when removing a device, reset ClientPointers where needed
Peter Hutterer [Tue, 29 Nov 2011 06:15:37 +0000 (16:15 +1000)]
Xi: when removing a device, reset ClientPointers where needed

if a client had the to-be-removed device as ClientPointer, reset to NULL.

Fixes #43165

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit d2ebbcdaf6b13d70eee704b1764ff349e1be22a0)

6 years agoXext: don't swap CARD8 in SProcSELinuxQueryVersion
Peter Hutterer [Wed, 9 Nov 2011 05:31:10 +0000 (15:31 +1000)]
Xext: don't swap CARD8 in SProcSELinuxQueryVersion

xselinux_ext.c: In function 'SELinuxSendItemsToClient':
xselinux_ext.c:340:16: warning: unused variable 'n' [-Wunused-variable]
xselinux_ext.c: In function 'SProcSELinuxQueryVersion':
xselinux_ext.c:532:62: error: call to 'wrong_size' declared with attribute
error: wrong sized variable passed to swap
xselinux_ext.c:533:62: error: call to 'wrong_size' declared with attribute
error: wrong sized variable passed to swap

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit bb4aa1f263ad38c175bfda3b7e6c325260ce3f28)

Conflicts:

Xext/xselinux_ext.c

6 years agodix: button state must show the logical buttons, not physical buttons
Peter Hutterer [Fri, 16 Dec 2011 02:41:08 +0000 (12:41 +1000)]
dix: button state must show the logical buttons, not physical buttons

If the device is mapped 3 2 1, a click on physical button 1 sends a button 3
press, but the state was set for button 1. Fix this, the state must be set
for that button's logical mapping.

https://bugzilla.gnome.org/show_bug.cgi?id=655928

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9567d21e85b99febe805263a4d93b15fd1f7ab42)

Conflicts:

dix/inpututils.c

6 years agoXi: when removing a device, reset ClientPointers where needed
Peter Hutterer [Tue, 29 Nov 2011 06:15:37 +0000 (16:15 +1000)]
Xi: when removing a device, reset ClientPointers where needed

if a client had the to-be-removed device as ClientPointer, reset to NULL.

Fixes #43165

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit d2ebbcdaf6b13d70eee704b1764ff349e1be22a0)

6 years agoxfixes: don't dereference a NULL cursor
Peter Hutterer [Tue, 29 Nov 2011 23:06:06 +0000 (09:06 +1000)]
xfixes: don't dereference a NULL cursor

If the new cursor is the NULL cursor, don't dereference it and use zeros
instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 1ab50be938524dcd4a9e56d27e3b96a27c2db2c0)

6 years agodmx: force -fno-strict-aliasing for xinput example
Peter Hutterer [Fri, 16 Dec 2011 14:15:25 +0000 (09:15 -0500)]
dmx: force -fno-strict-aliasing for xinput example

Compiler warning:
xinput.c:272: warning: dereferencing pointer 'e' does break strict-aliasing
rules

The code itself is the usual XInput client-side code:
        XEvent event;
        XDeviceMotionEvent *e = (XDeviceMotionEvent *)&event;
        XNextEvent(display, &event);
        printf("%d\n", e->type);

Since XDeviceMotionEvent is not guaranteed the same size as XEvent, clients
must use pointer aliasing as above when using the XNextEvent API. Disable
strict aliasing for this example.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 3aca8199405cff5097ee5813605ec78b5ae44a43)

6 years agoSave major/minor opcodes in ClientRec for RecordAReply
Keith Packard [Tue, 8 Nov 2011 18:13:15 +0000 (10:13 -0800)]
Save major/minor opcodes in ClientRec for RecordAReply

The record extension needs the major and minor opcodes in the reply
hook, but the request buffer may have been freed by the time the hook
is invoked. Saving the request major and minor codes as the request is
executed avoids fetching from the defunct request buffer.

This patch also eliminates the public MinorOpcodeOfRequest function,
inlining it into Dispatch. Usages of that function have been replaced
with direct access to the new ClientRec field.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit fb22a408c69a84f81905147de9e82cf66ffb6eb2)

Conflicts:

include/extension.h

6 years agoFix ShmPutImage for XYBitmap
Julien Cristau [Sat, 5 Nov 2011 12:00:07 +0000 (13:00 +0100)]
Fix ShmPutImage for XYBitmap

We can't call CopyArea in that case because the image has depth 1, which
might not match the target drawable, so we might overrun the shm
segment.  Commit 11817a881cb93a89788105d1e575a468f2a8d27c apparently
fixed a similar bug for XYPixmap, but missed the bitmap case.

Fixes: http://bugs.debian.org/629611

Thanks to Alan Curry for diagnosing this and providing a test case.

Reported-and-tested-by: Alan Curry <pacman@kosh.dhis.org>
Reviewed-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit 08ec4da6a7617637914bee1636858474213cf39d)

6 years agokdrive/linux: Fix compilation with -Werror=int-to-pointer-cast -Werror=pointer-to...
Jeremy Huddleston [Sat, 17 Dec 2011 20:56:59 +0000 (12:56 -0800)]
kdrive/linux: Fix compilation with -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast

Reported-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit 1deede3c48d5ac91f50774c79f02afc6e036614e)

6 years agoconfigure.ac: Make Xephyr dependency error message more informative
Jeremy Huddleston [Sat, 17 Dec 2011 20:25:26 +0000 (12:25 -0800)]
configure.ac: Make Xephyr dependency error message more informative

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit d0170d54c71fc761b8f1ae7a0e555dc2ca23cf9c)

6 years agoconfigure.ac: 1.11.3 xorg-server-1.11.3
Jeremy Huddleston [Sat, 17 Dec 2011 01:47:46 +0000 (17:47 -0800)]
configure.ac: 1.11.3

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
6 years agodmx: fix distcheck failure, missing compsize.h in Makefile.am
Gaetan Nadon [Fri, 9 Dec 2011 12:45:02 +0000 (07:45 -0500)]
dmx: fix distcheck failure, missing compsize.h in Makefile.am

which was added in commit:
dmx: Build fix for -Werror=implicit-function-declaration

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>
(cherry picked from commit 2c1d0a539c0fb1860ac89a00d1fb609f1959e1b6)

6 years agoconfigure.ac: 1.11.2.902 (1.11.3 RC2) xorg-server-1.11.2.902
Jeremy Huddleston [Fri, 9 Dec 2011 20:58:30 +0000 (12:58 -0800)]
configure.ac: 1.11.2.902 (1.11.3 RC2)

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
6 years agokdrive: drop screen crossing code.
Dave Airlie [Mon, 28 Nov 2011 16:37:59 +0000 (16:37 +0000)]
kdrive: drop screen crossing code.

The only kdrive server we probably care about anymore is Xephyr,
and this screen enable/disable code totally breaks it in multi-screen mode.

When you are in one screen the other stops updating.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=757457

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 98c4a888a4428789386c7c47cecc81933b5999ba)

6 years agohal: free tmp_val in one missing case
Dave Airlie [Thu, 20 Oct 2011 09:48:26 +0000 (10:48 +0100)]
hal: free tmp_val in one missing case

Pointed out by coverity scan.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 8d3731a811e33e263920dd7c8ec63d02968cb56e)

6 years agoxv: test correct number of requests. (v2)
Dave Airlie [Thu, 20 Oct 2011 10:00:43 +0000 (11:00 +0100)]
xv: test correct number of requests. (v2)

Pointed out by coverity.

v2: fix swapped as well, as pointed out by Alan

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit 41229392b790f30a0f0ef1f4ed95647c5bca4001)

6 years agoxaa: avoid possible freed pointer reuse in epilogue
Dave Airlie [Wed, 19 Oct 2011 15:57:13 +0000 (16:57 +0100)]
xaa: avoid possible freed pointer reuse in epilogue

If the pGCPriv->flags == 2, then we try to assign the freed pGCPriv->XAAOps
avoid this by clearing the flags in to be destroyed pGCPriv.

Reported by coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 1049139499d9132a20cd6d4d156fe9da9cddb6c2)

6 years agoXi: avoid overrun of callback array.
Dave Airlie [Wed, 19 Oct 2011 15:22:31 +0000 (16:22 +0100)]
Xi: avoid overrun of callback array.

This code had an off-by-one and would allow writing one past the end of
the callbacks array.

Pointed out by coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 682c09a2cedd234b005334cc01247d859dd7f26a)

6 years agoxext: don't free uninitialised pointer when malloc fails. (v2)
Dave Airlie [Wed, 19 Oct 2011 15:21:26 +0000 (16:21 +0100)]
xext: don't free uninitialised pointer when malloc fails. (v2)

Initialise the pAttr->values to values so if the values allocation
fails it just ends up as free(NULL).

Pointed out by coverity.

v2: use Alan's suggestion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit b62dc4fcbcffd10de16650bee284702c8608bb60)

6 years agofbdevhw: iterate over all modes that match a mode. (v3)
Adam Jackson [Thu, 28 Apr 2011 03:34:28 +0000 (13:34 +1000)]
fbdevhw: iterate over all modes that match a mode. (v3)

So on RHEL5 anaconda sets an xorg.conf with a fixed 800x600 mode in it,
we run radeonfb and fbdev since ati won't work in userspace due to domain
issues in the older codebase.

On certain pseries blades the built-in KVM can't accept an 800x600-43 mode,
it requires the 800x600-60 mode, so we have to have the kernel radeonfb
driver reject the 800x600-43 mode when it sees it. However then fbdev
doesn't try any of the other 800x600 modes in the modelist, and we end up
getting a default 640x480 mode we don't want.

This patch changes the mode validation loop to continue on with the other modes
that match to find one that works.

v2: move code around to avoid extra loop, after comment from Jamey.
v3: move loop setup back into loop as per Jeremy's review.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 22605effd188436629a0dbc688666549473741e4)

6 years agoLoaderOpen returns either a valid pointer or NULL, so don't check for < 0
Alan Coopersmith [Fri, 2 Dec 2011 07:45:42 +0000 (23:45 -0800)]
LoaderOpen returns either a valid pointer or NULL, so don't check for < 0

Fixes Sun cc warning that was recently elevated to error by the
stricter default CFLAGS changes to xorg-macros:

"loadmod.c", line 914: improper pointer/integer combination: op "<"

Should have been changed when commit ab7f057ce9df4e905b12 changed the
LoaderOpen return type from int to void *.

Changes log message when file is found but dlopen() fails from:
 (EE) LoadModule: Module dbe does not have a dbeModuleData data object.
 (EE) Failed to load module "dbe" (invalid module, 0)
to:
 (EE) Failed to load module "dbe" (loader failed, 7)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit e4dcf580f007d6adcf5b0c639865d7aaab1a319d)

6 years agoLimit the number of screens Xvfb will attempt to allocate memory for
Alan Coopersmith [Wed, 23 Nov 2011 08:30:02 +0000 (00:30 -0800)]
Limit the number of screens Xvfb will attempt to allocate memory for

Commit f9e3a2955d2ca7 removing the MAXSCREEN limit left the screen
number too unlimited, and allowed any positive int for a screen number:

Xvfb :1 -screen 2147483647 1024x1024x8

Fatal server error:
Not enough memory for screen 2147483647

Found by Parfait 0.3.7:
Error: Integer overflow (CWE 190)
   Integer parameter of memory allocation function realloc() may overflow due to multiplication with constant value 1112
        at line 293 of hw/vfb/InitOutput.c in function 'ddxProcessArgument'.

Since the X11 connection setup only has a CARD8 for number of SCREENS,
limit to 255 screens, which is also low enough to avoid overflow on the
sizeof(*vfbScreens) * (screenNum + 1) calculation for realloc.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit feebf6746374aa04b12e9e3e51313a3a82c03530)

6 years agorandr: Make the RRConstrainCursorHarder logic the same as miPointerSetPosition
Rui Matos [Tue, 1 Nov 2011 21:32:36 +0000 (21:32 +0000)]
randr: Make the RRConstrainCursorHarder logic the same as miPointerSetPosition

The constraining logic in RRConstrainCursorHarder allows the cursor to reach
crtc positions of x = width and y = height while the constraining code in
miPointerSetPosition only allows it to reach x = width - 1 and y = height - 1
for the analogous screen case.

This patch makes the former's logic equivalent to the latter's which allows
applications to benefit from Fitts's law. E.g. a maximized application
adjacent to a crtc border wouldn't get pointer events if the user moved the
pointer all the way until it's contained.

Signed-off-by: Rui Matos <tiagomatos@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 9cc44b955b27de33348d6a20bebc9704930ee18e)

6 years agoconfigure.ac: 1.11.2.901 (1.11.3 RC1) xorg-server-1.11.2.901
Jeremy Huddleston [Mon, 28 Nov 2011 08:07:29 +0000 (00:07 -0800)]
configure.ac: 1.11.2.901 (1.11.3 RC1)

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
6 years agoFix vesa's VBE PanelID interpretation
Derek Buitenhuis [Sun, 6 Nov 2011 17:20:51 +0000 (12:20 -0500)]
Fix vesa's VBE PanelID interpretation

xserver's VESA driver's VBE (Vesa BIOS Extensions) code
includes a PanelID probe, which can get a monitor's native
resolution. From this, using CVT formulas, it derives
horizontal sync rate and a vertical refresh rate ranges.

It however, only derives the upper bounds of the ranges, and
the lower bounds cannot de derived. By default, they are set
to hardcoded constants which represent the lowest supported
resolution: 640x480. The constants in vbe.c however, were
not actually derived from forulas, but carried over from
other code from the bad old days, and are not relevant
to flat panel displays. This caused, for example, EEEPC701's
panel, with a native resolution of 800x480, to end up with
a upper bound of the horizontal sync rate that was lower
than the hardcoded lower bound, which of course broke things.

These numbers have been rederived using both my own CVT tool
based on xf86CVTMode(), and using the provided 'cvt' tool
that comes with xserver.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit f0d50cc6651dce3a8a3cd3fb84210aa92b139763)

6 years agodmx: Build fix for -Werror=implicit-function-declaration
Jeremy Huddleston [Mon, 7 Nov 2011 22:14:30 +0000 (22:14 +0000)]
dmx: Build fix for -Werror=implicit-function-declaration

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit f405dfffe7d5db81d398615a80acbeba7e014ada)

6 years agorootless: Fix a server crash when choosing a color with the gimp color wheel
dtakahashi42 [Fri, 18 Nov 2011 19:30:22 +0000 (11:30 -0800)]
rootless: Fix a server crash when choosing a color with the gimp color wheel

https://trac.macports.org/ticket/30927

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 328074890eeb111950e984c6f618311983600b20)

6 years agoedid: Add quirk for Acer Aspire One 110
Ross Burton [Wed, 28 Sep 2011 10:46:02 +0000 (11:46 +0100)]
edid: Add quirk for Acer Aspire One 110

At least one revision of the AAO reports a 190x110mm maximum size but a
451x113mm mode.

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

Signed-off-by: Ross Burton <ross@linux.intel.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 58864146fbdf1820d04825838691e84784ef91bc)

6 years agodri2: Register the DRI2DrawableType after server regeneration
Chris Wilson [Thu, 25 Aug 2011 15:04:04 +0000 (16:04 +0100)]
dri2: Register the DRI2DrawableType after server regeneration

The Resource database is reset upon regeneration and so the dri2 module
needs to re-register its RESTYPE for the drawable or else it will
clobber the next unsuspecting user of the database. Fortunately, DRI2 is
loaded late in the initialisation sequence and was last up until
xf86-video-intel started using the Resource database to track
outstanding swaps...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
(cherry picked from commit 34b0e4eee911f8b09a3682a7f1b4c8598ef48b8d)

6 years agoDRI2: Avoid a NULL pointer dereference
Chris Wilson [Mon, 24 Jan 2011 11:17:03 +0000 (11:17 +0000)]
DRI2: Avoid a NULL pointer dereference

Bugzilla:  https://bugs.freedesktop.org/show_bug.cgi?id=41211

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit bfa1a0dd190ed88020d60eba3bb04681c8e83a68)

6 years agoVidMode: prevent crash with no modes
Chris Wilson [Mon, 24 Jan 2011 11:17:03 +0000 (11:17 +0000)]
VidMode: prevent crash with no modes

Bugzilla:  https://bugs.freedesktop.org/show_bug.cgi?id=17431

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit eeb21a133b982f71de739baf62e53c8a68f5d495)

6 years agorecord: Prevent out of bounds access when recording a reply.
Rami Ylimäki [Tue, 4 Oct 2011 09:25:26 +0000 (12:25 +0300)]
record: Prevent out of bounds access when recording a reply.

Any pad bytes in replies are written to the client from a zeroed
array. However, record extension tries to incorrectly access the pad
bytes from the end of reply data.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi>
(cherry picked from commit c1bb8f43b9290c2b18a9f0ac59773ff8f1eb974f)

6 years agoxfree86: Fix powerpc build with -Werror=int-to-pointer-cast -Werror=pointer-to-int...
Jeremy Huddleston [Tue, 1 Nov 2011 21:59:15 +0000 (14:59 -0700)]
xfree86: Fix powerpc build with -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast

memType is a uint64_t on powerpc. Using memType only really makes
sense for *physical* addresses, which can be 64-bit for 32-bit
systems running on 64-bit hardware.

However, unmapVidMem() only deals with *virtual* addresses, which
are guaranteed to fit into an uintptr_t.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
(cherry picked from commit eb3377ffb8a7baa26c9831e56ed782d48b28fa71)

6 years agoinclude: export GetProximityEvents and QueueProximityEvents
Peter Hutterer [Fri, 15 Apr 2011 03:32:10 +0000 (13:32 +1000)]
include: export GetProximityEvents and QueueProximityEvents

This is mainly needed for consistency with GetPointerEvents and friend.
No-one seems to actually need this function from outside the usual DDXs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit fc16917ad6f0d2722bfb5c5eeca955dd3bc4125a)

6 years agodix: Don't let a driver without a ProximityClassRec post events
Peter Hutterer [Wed, 2 Nov 2011 22:58:58 +0000 (08:58 +1000)]
dix: Don't let a driver without a ProximityClassRec post events

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 11840595a1be9f2df7390bcc708cc176e60d3ef2)

6 years agoXi: allow passive keygrabs on the XIAll(Master)Devices fake devices
Peter Hutterer [Thu, 27 Oct 2011 01:03:39 +0000 (11:03 +1000)]
Xi: allow passive keygrabs on the XIAll(Master)Devices fake devices

They don't have a KeyClassRec, but we must still allow passive grabs on
them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Bastien Nocera <hadess@hadess.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 22715e465b415b3351b83b8279a4f44157f63199)

6 years agodix: block signals when closing all devices
Peter Hutterer [Mon, 24 Oct 2011 02:00:32 +0000 (12:00 +1000)]
dix: block signals when closing all devices

When closing down all devices, we manually unset master for all attached
devices, but the device's sprite info still points to the master's sprite
info. This leaves us a window where the master is freed already but the
device isn't yet. A signal during that window causes dereference of the
already freed spriteInfo in mieqEnqueue's EnqueueScreen macro.

Simply block signals when removing all devices. It's not like we're really
worrying about high-responsive input at this stage.

https://bugzilla.redhat.com/show_bug.cgi?id=737031

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit d7c44a7c9760449bef263413ad3b20f19b1dc95a)

6 years agoBug 38420: Xvfb crashes in miInitVisuals() when started with depth=2
Christopher Yeleighton [Tue, 25 Oct 2011 01:47:06 +0000 (18:47 -0700)]
Bug 38420: Xvfb crashes in miInitVisuals() when started with depth=2

https://bugs.freedesktop.org/show_bug.cgi?id=38420

Exit with fatal error message, not segfault.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 7d50211ab57a35910d79fc3f67ae89aff91fa995)

6 years agoxf86Crtc: handle no outputs with no modes harder.
Dave Airlie [Thu, 20 Oct 2011 13:43:01 +0000 (14:43 +0100)]
xf86Crtc: handle no outputs with no modes harder.

If you started an X server with no connected outputs, we pick a default
1024x768 mode, however if you then ran an xvidmode using app against that
server it would segfault the server due to not finding any valid modes.

This was due to the no output mode set code, only adding the modes to the
scrn->modes once, when something called randr 1.2 xf86SetScrnInfoModes would
get called and remove all the modes and we'd end up with 0.

This change fixes xf86SetScrnInfoModes to always report a scrn mode of at
least 1024x768, and pushes the initial configuration to just call it instead
of setting up the mode itself.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=746926

I've seen other bugs like this on other distros so it might also actually fix them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 17416e88dcfcc584fe5f87580d5d2b719b3521c3)

6 years agoconfigure.ac: Bump to 1.11.2 xorg-server-1.11.2
Jeremy Huddleston [Fri, 4 Nov 2011 17:24:08 +0000 (10:24 -0700)]
configure.ac: Bump to 1.11.2

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
6 years agoRevert "dix: don't XWarpPointer through the last slave anymore (#38313)"
Jeremy Huddleston [Thu, 3 Nov 2011 22:01:35 +0000 (15:01 -0700)]
Revert "dix: don't XWarpPointer through the last slave anymore (#38313)"

This reverts commit bbe6a69da398dba93679c23c3c50f9916cb562ca.

This commit caused a regression.

See: http://xquartz.macosforge.org/trac/ticket/517#comment:10

6 years agoconfigure.ac: Bump to 1.11.1.902 (1.11.2 RC2) xorg-server-1.11.1.902
Jeremy Huddleston [Sat, 29 Oct 2011 01:32:28 +0000 (18:32 -0700)]
configure.ac: Bump to 1.11.1.902 (1.11.2 RC2)

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
6 years agoXWin: windowswm: Correct byte swapping in event notifications
Jeremy Huddleston [Wed, 26 Oct 2011 06:53:43 +0000 (23:53 -0700)]
XWin: windowswm: Correct byte swapping in event notifications

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
(cherry picked from commit 286fa9bf9b4ffb0f9dbd3f1cae46ddcb27ee9318)

6 years agoXQuartz: appledri: Correct byte swapping in event notifications
Jeremy Huddleston [Wed, 26 Oct 2011 06:49:33 +0000 (23:49 -0700)]
XQuartz: appledri: Correct byte swapping in event notifications

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit dc054fefc586c5b404fe0f949dbd456e5267c647)

6 years agoXQuartz: applewm: Correct byte swapping in event notifications
Jeremy Huddleston [Wed, 26 Oct 2011 06:48:16 +0000 (23:48 -0700)]
XQuartz: applewm: Correct byte swapping in event notifications

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit d5fee2b638fabeb8bec31a24e57d5c2a232d0893)

6 years agoXQuartz: appledri: Allow byte swapped requests
Jeremy Huddleston [Fri, 21 Oct 2011 17:27:16 +0000 (10:27 -0700)]
XQuartz: appledri: Allow byte swapped requests

Even though it's only valid when local, it is possible for a local
client and the server to not match endianness, such as when running
a ppc application under Rosetta.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 1c8bda798b4480bab0f0da6f531e4770c7a1f771)

6 years agoXQuartz: appledri: Fix byte swapping in replies
Jeremy Huddleston [Fri, 21 Oct 2011 05:34:44 +0000 (22:34 -0700)]
XQuartz: appledri: Fix byte swapping in replies

Even though it's only valid when local, it is possible for a local
client and the server to not match endianness, such as when running
a ppc application under Rosetta.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit 14205ade0c750191bf43fba8bd55c65dba912cf4)

Conflicts:

hw/xquartz/xpr/appledri.c

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
6 years agoXQuartz: appledri: Set the correct reply length for XAppleDRICreatePixmap
Jeremy Huddleston [Fri, 21 Oct 2011 05:23:07 +0000 (22:23 -0700)]
XQuartz: appledri: Set the correct reply length for XAppleDRICreatePixmap

http://xquartz.macosforge.org/trac/ticket/508

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit 2ba0ac202ad64eb4a555715980ba538de19c9fd7)

6 years agoXnest: Match the host's keymap
Jeremy Huddleston [Sun, 16 Oct 2011 09:12:38 +0000 (02:12 -0700)]
Xnest: Match the host's keymap

This was a regression.

Introduced by: 08363c5830bdea34012dcd954b45ccfdc79a3a7e and
               32db27a7f867b503c2840ca7b815e96d10be9210
Masked by: 1e69fd4a60147287b31e53bfc61543fb17bb82c8

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
(cherry picked from commit 83fef4235db86343477b4ec9858c6ba35e1aa7d9)

6 years agoFix drain_console unregistration
Tomáš Trnka [Tue, 11 Oct 2011 07:11:18 +0000 (09:11 +0200)]
Fix drain_console unregistration

Bug introduced by 9dca441670d261a9a9fb6108960ed48f3d58fb7f
xfree86: add a hook to replace the new console handler.

console_handler was not being set, making the server eat up CPU spinning
in WaitForSomething selecting consoleFd over and over again, every time
trying to unregister drain_console without success due to
console_handler being NULL.

Let's just fix the unregistration in xf86SetConsoleHandler() and use that.

But wait, there could be a catch: If some driver replaced the handler using
xf86SetConsoleHandler(), the unregistration in xf86CloseConsole will unregister
that one. I don't understand Xorg well enough to know whether this poses a
problem (could mess up driver deinit somehow or something like that). As it is,
xf86SetConsoleHandler() doesn't offer any way to prevent this (i.e. check which
handler is currently registered).

I had been using it for two days on my machine that previously hit 100% CPU
several times a day. That has now gone away without any new problems appearing.

Signed-off-by: Tomas Trnka <tomastrnka@gmx.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 323869f3298cbbfe864af9404a8aed1bf7995d79)

6 years agocrtc: match full preferred modes if possible when choosing an initial config
Jesse Barnes [Thu, 13 Oct 2011 19:01:10 +0000 (12:01 -0700)]
crtc: match full preferred modes if possible when choosing an initial config

It's fairly common to have multiple, identical monitors plugged in.  In
that case, it's preferable to run the monitor's preferred mode on each
output, rather than just matching the width & height and end up with
different timings or refresh rates.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 3e145d3d67b472cb5d74cb8078b614160c4722b7)

6 years agocomposite: Update borderClip in compAllocPixmap()
Ville Syrjala [Sat, 8 Oct 2011 22:11:04 +0000 (01:11 +0300)]
composite: Update borderClip in compAllocPixmap()

Previously the parent constrained borderClip was copied over
when compRedirectWindow() is called. That is insufficient eg. in
case the window was already redirected, but not yet realized. So
copy the borderClip over in compAllocPixmap() instead.

Example:
Window 1 is below an automatically redirect window 2. Window 2 is
unmapped and moved outside the extents of window 1. Window 2 is
then mapped again, and MarkOverlappedWindows() uses the up to
date borderSize of window 2 to mark windows, which leaves
window 1 unmarked. Then exposures are calculated using the stale
borderClip of window 2, which causes the window below window 2,
to be exposed through an apparent hole in window 1.

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

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit a5266dcb3a60587e1877f90c18552baf60b597a0)

6 years agoFix CVE-2011-4029: File permission change vulnerability.
Matthieu Herrb [Mon, 17 Oct 2011 20:27:35 +0000 (22:27 +0200)]
Fix CVE-2011-4029: File permission change vulnerability.

Use fchmod() to change permissions of the lock file instead
of chmod(), thus avoid the race that can be exploited to set
a symbolic link to any file or directory in the system.

Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit b67581cf825940fdf52bf2e0af4330e695d724a4)

6 years agoFix CVE-2011-4028: File disclosure vulnerability.
Matthieu Herrb [Mon, 17 Oct 2011 20:26:12 +0000 (22:26 +0200)]
Fix CVE-2011-4028: File disclosure vulnerability.

use O_NOFOLLOW to open the existing lock file, so symbolic links
aren't followed, thus avoid revealing if it point to an existing
file.

Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit 6ba44b91e37622ef8c146d8f2ac92d708a18ed34)

6 years agoconfigure.ac: Bump to 1.11.1.901 (1.11.2 RC1) xorg-server-1.11.1.901
Jeremy Huddleston [Fri, 14 Oct 2011 23:29:54 +0000 (16:29 -0700)]
configure.ac: Bump to 1.11.1.901 (1.11.2 RC1)

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
6 years agodix: don't XWarpPointer through the last slave anymore (#38313)
Peter Hutterer [Fri, 29 Jul 2011 06:33:54 +0000 (16:33 +1000)]
dix: don't XWarpPointer through the last slave anymore (#38313)

This line was introduced pre-1.6 to fix Bug 19297. The effect of warping
through the VCP then was that if a device had custom valuator ranges, the
warp position would be wrong. The better device for this effect is the the
XTest device.

This fixes a server crash where the lastSlave is a pointer device without
valuators (Bug 38313#0).

And while we're at it, make sure the Xinerama code-path does the same.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 2bfb802839688ecf328119c4c6979390fc60348d)

6 years agoDisable check of double-aligned in test/input.c on Renesas SH
Nobuhiro Iwamatsu [Tue, 9 Aug 2011 02:00:34 +0000 (11:00 +0900)]
Disable check of double-aligned in test/input.c on Renesas SH

Renesas SH is not aligned at size of double.
When structure has double value, It is aligned in 4byte (long).

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit b29ce0726d55ec41cfbce0814e21b0217ef64efe)

6 years agodix: don't use the pointer as modifier device in UngrabKey.
Peter Hutterer [Mon, 1 Aug 2011 04:12:41 +0000 (14:12 +1000)]
dix: don't use the pointer as modifier device in UngrabKey.

Modifier device is always the keyboard.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 8c5a4d6fbecf79f2dc4f2d836d741203b2d5e856)

6 years agodix: ignore devices when adding passive core grabs to list (#39545)
Peter Hutterer [Thu, 28 Jul 2011 05:56:08 +0000 (15:56 +1000)]
dix: ignore devices when adding passive core grabs to list (#39545)

Passive core grabs are mostly device-independent. In an MPX scenario, they
may change to reflect whichever master pair activated the grab last. For
adding new grabs to the list, ignore the device for core grabs to return
failures when trying to set the same grab combo twice on a window.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 09496996accfdaf7bc01097a25db400912004d97)

6 years agodix: avoid using the VCP as modifier device
Peter Hutterer [Thu, 28 Jul 2011 05:43:10 +0000 (15:43 +1000)]
dix: avoid using the VCP as modifier device

Core grabs may change device when they're activated to reflect the master
they apply to. If the device is a keyboard, modifierDevice is erroneously
set to the Virtual Core Pointer.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 80c37048539daa1d257d127d66502bde45c97c85)

6 years agoconfig: fix a log message
Peter Hutterer [Wed, 20 Jul 2011 06:21:28 +0000 (16:21 +1000)]
config: fix a log message

PRODUCT was taken from the parent, hence ppath.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit e684e816acb617b4dc66a68e2b0ba8f80399170a)

6 years agoxkb: add missing swaps for xkbGetDeviceInfoReply
Peter Harris [Fri, 2 Sep 2011 22:45:16 +0000 (18:45 -0400)]
xkb: add missing swaps for xkbGetDeviceInfoReply

Caught during review of e095369bf.

Signed-off-by: Peter Harris <pharris@opentext.com>
Reviewed-by-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit c90903b4f7a826ae6826a8dd0a901c8362500e46)

Conflicts:

xkb/xkb.c

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoXQuartz: pbproxy: Add missing AM_OBJCFLAGS
Jeremy Huddleston [Wed, 5 Oct 2011 04:40:03 +0000 (21:40 -0700)]
XQuartz: pbproxy: Add missing AM_OBJCFLAGS

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit fae7ed62ad476114bd37b566202cf6b6546c0a1f)

6 years agoFix a rare memory leak
vdb@picaros.org [Sat, 17 Sep 2011 16:55:47 +0000 (18:55 +0200)]
Fix a rare memory leak

Signed-off-by: Servaas Vandenberghe <vdb@picaros.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit e4cddf509e1729e8ff40354275b65455111ad2bd)

6 years agoFix server crash due to invalid images
Kirill Elagin [Tue, 4 Oct 2011 19:02:20 +0000 (23:02 +0400)]
Fix server crash due to invalid images

See https://bugs.freedesktop.org/show_bug.cgi?id=39383

Signed-off-by: Kirill Elagin <kirelagin@gmail.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 53611213396479abfdce0f7752681572e0d26d78)

6 years agodixfonts: Don't overwrite local c variable until new_closure is safely initialized.
Alan Hourihane [Wed, 5 Oct 2011 02:42:46 +0000 (19:42 -0700)]
dixfonts: Don't overwrite local c variable until new_closure is safely initialized.

Signed-off-by: Alan Hourihane <alanh@vmware.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 7a33c5b934382b5554f41ab1502514e91c9bc52e)

6 years agoRemove the SendEvent bit (0x80) before doing range checks on event type.
Sam Spilsbury [Wed, 14 Sep 2011 01:58:34 +0000 (09:58 +0800)]
Remove the SendEvent bit (0x80) before doing range checks on event type.

Some extension libraries may set this bit before converting the event to
wire protocol and as such range checking the event will cause an invalid
BadValue error to result. As the documentation suggests the the bit
should be "forced on", remove it before doing range checks and continue
to force it on in the server.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 2d2dce558d24eeea0eb011ec9ebaa6c5c2273c39)

6 years agoXi: Fix passive XI2 ungrabs on XIAll[Master]Devices
Carlos Garnacho [Tue, 30 Aug 2011 22:46:52 +0000 (00:46 +0200)]
Xi: Fix passive XI2 ungrabs on XIAll[Master]Devices

The corresponding DeviceIntPtr wasn't being gotten properly,
resulting in BadDevice from dixLookupDevice().

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit f52d5cd374563544dafe29587411f345e31bbdf8)

6 years agoXQuartz: Use set_front_process rather than X11ApplicationSetFrontProcess since we...
Jeremy Huddleston [Wed, 21 Sep 2011 03:39:06 +0000 (20:39 -0700)]
XQuartz: Use set_front_process rather than X11ApplicationSetFrontProcess since we're already in the AppKit thread

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 38e9e28ba2fbffee52ad9889ef6d4e94c7af3e10)

6 years agoFix pixmap double-frees on error paths.
Jamey Sharp [Wed, 15 Sep 2010 01:35:21 +0000 (18:35 -0700)]
Fix pixmap double-frees on error paths.

If AddResource fails, it will automatically free the object that was
passed to it by calling the appropriate deleteFunc; and of course
FreeResource also calls the deleteFunc. In both cases it's wrong to call
the destroy hook manually.

Commit by Jamey Sharp and Josh Triplett.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
(cherry picked from commit 0f380a5005f800572773cd4667ce43c7459cc467)

6 years agoconfigure.ac: Version bumped to 1.11.1 xorg-server-1.11.1
Jeremy Huddleston [Sat, 24 Sep 2011 07:06:32 +0000 (00:06 -0700)]
configure.ac: Version bumped to 1.11.1

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
6 years agofb: Rename wfbTriangles and wfbTrapezoids
Aaron Plattner [Wed, 14 Sep 2011 22:25:06 +0000 (15:25 -0700)]
fb: Rename wfbTriangles and wfbTrapezoids

These symbols were not renamed when they were added to libfb:

 # nm -D libwfb.so | grep ' fb'
 0000000000028d00 T fbTrapezoids
 0000000000028d60 T fbTriangles

This causes corruption and/or crashes on wfb-ful drivers like nvidia:

 Program received signal SIGABRT, Aborted.
 0x00007fd67f3a0405 in *__GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
 64      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
     in ../nptl/sysdeps/unix/sysv/linux/raise.c
 (gdb) bt
 #0  0x00007fd67f3a0405 in *__GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
 #1  0x00007fd67f3a3680 in *__GI_abort () at abort.c:92
 #2  0x00007fd67f3995b1 in *__GI___assert_fail (assertion=0x7fd679ecb804 "key->initialized", file=<optimized out>, line=116, function=0x7fd679ecbbc0 "dixGetPrivateAddr")
     at assert.c:81
 #3  0x00007fd679ec55b6 in ?? () from /usr/lib/xorg/modules/libfb.so
 #4  0x00007fd679eca9ef in ?? () from /usr/lib/xorg/modules/libfb.so
 #5  0x00007fd679ecae20 in fbTriangles () from /usr/lib/xorg/modules/libfb.so
 #6  0x00007fd67a58fc55 in ?? () from /usr/lib/xorg/modules/drivers/nvidia_drv.so
 #7  0x00000000004f38d1 in ?? ()
 #8  0x0000000000437ae9 in ?? ()
 #9  0x0000000000426eaa in ?? ()
 #10 0x00007fd67f38cead in __libc_start_main (main=<optimized out>, argc=<optimized out>, ubp_av=<optimized out>, init=<optimized out>, fini=<optimized out>,
     rtld_fini=<optimized out>, stack_end=0x7fff99860d78) at libc-start.c:228
 #11 0x000000000042719d in _start ()

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 03d032991da21bf866ca30dcbb6b7f9f99df441a)

6 years agoxfree86: Bump extension ABI version to 6.0
Aaron Plattner [Tue, 30 Aug 2011 03:44:18 +0000 (20:44 -0700)]
xfree86: Bump extension ABI version to 6.0

The video driver ABI was bumped to 11.0 in commit
0de7cec90738a7a5020150309866bb0e23b6f479 because of a change to the
size of ATOM in commit 51f353d0a0d116af16d7d9590cadef6c56328746.  This
also affects extension modules, so the extension ABI version should
have been bumped too.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
6 years agoVersion bumped to 1.11 xorg-server-1.11.0
Keith Packard [Fri, 26 Aug 2011 23:46:13 +0000 (16:46 -0700)]
Version bumped to 1.11

Signed-off-by: Keith Packard <keithp@keithp.com>
7 years agofb: Fix memcpy abuse
Adam Jackson [Thu, 21 Apr 2011 20:37:11 +0000 (16:37 -0400)]
fb: Fix memcpy abuse

The memcpy fast path implicitly assumes that the copy walks
left-to-right.  That's not something memcpy guarantees, and newer glibc
on some processors will indeed break that assumption.  Since we walk a
line at a time, check the source and destination against the width of
the blit to determine whether we can be sloppy enough to allow memcpy.
(Having done this, we can remove the check for !reverse as well.)

On an Intel Core i7-2630QM with an NVIDIA GeForce GTX 460M running in
NoAccel, the broken code and various fixes for -copywinwin{10,100,500}
gives (edited to fit in 80 columns):

1: Disable the fastpath entirely
2: Replace memcpy with memmove
3: This fix
4: The code before this fix

  1            2                 3                 4           Operation
------   ---------------   ---------------   ---------------   ------------
258000   269000 (  1.04)   544000 (  2.11)   552000 (  2.14)   Copy 10x10
 21300    23000 (  1.08)    43700 (  2.05)    47100 (  2.21)   Copy 100x100
   960      962 (  1.00)     1990 (  2.09)     1990 (  2.07)   Copy 500x500

So it's a modest performance hit, but correctness demands it, and it's
probably worth keeping the 2x speedup from having the fast path in the
first place.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
7 years agoXQuartz: Initialize darwin pointer valuators
Pelle Johansson [Mon, 15 Aug 2011 00:44:40 +0000 (17:44 -0700)]
XQuartz: Initialize darwin pointer valuators

This fixes a regression introduced by: 633b81e8ba09cc6a1ea8b43f323874fda2cf0bde

http://xquartz.macosforge.org/trac/ticket/498

Signed-off-by: Pelle Johansson <pelle@morth.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
7 years agoEXA/mixed: Update sys_pitch in MPH even when there's no system memory copy.
Michel Dänzer [Wed, 10 Aug 2011 09:36:16 +0000 (11:36 +0200)]
EXA/mixed: Update sys_pitch in MPH even when there's no system memory copy.

Otherwise sys_pitch will be stale when a system memory copy is allocated.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38322 and a crash when
unlocking the screen with xscreensaver, reported by Janne Huttunen.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Janne Huttunen <jahuttun@gmail.com>
Tested-by: Jan Kriho <Erbureth@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
7 years agoXephyr/dri: register screen and window privates on init
Julien Cristau [Thu, 7 Jul 2011 17:18:03 +0000 (19:18 +0200)]
Xephyr/dri: register screen and window privates on init

Fixes assertion failure when calling dixSetPrivate
Debian bug#632549 <http://bugs.debian.org/632549>

Reported-and-tested-by: Mohammed Sameer <msameer@foolab.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
7 years agoVersion bumped to 1.10.99.902 (1.11 RC2) xorg-server-1.10.99.902
Keith Packard [Thu, 4 Aug 2011 03:57:03 +0000 (20:57 -0700)]
Version bumped to 1.10.99.902 (1.11 RC2)

At the close of the 1.11 non-critical fixes window.

Signed-off-by: Keith Packard <keithp@keithp.com>
7 years agocomposite: Inhibit window background paint with manual subwindow redirection
Ville Syrjälä [Fri, 6 May 2011 15:19:34 +0000 (18:19 +0300)]
composite: Inhibit window background paint with manual subwindow redirection

The composite extension spec says that window background painting
should be inhibited when the subwindow redirection mode is set to
manual.

This eliminates the ugly flashing effect when compiz unredirects a
fullscreen window.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Reviewed-by: Owen Taylor <otaylor@fishsoup.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
7 years agoRevert "composite: Don't backfill non-MapWindow allocations"
Pierre-Loup A. Griffais [Thu, 28 Jul 2011 22:17:59 +0000 (15:17 -0700)]
Revert "composite: Don't backfill non-MapWindow allocations"

This reverts commit db8840600e8e21356241eb87395031388d9b54d2.

It was an optimization for the resize case, but 193ecc8b453b22 made
it so that no backfilling takes place on resize if left in.

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Conflicts:

composite/compalloc.c
Signed-off-by: Keith Packard <keithp@keithp.com>
7 years agoXquartz: include new localization files in the tarball
Julien Cristau [Sun, 31 Jul 2011 19:14:59 +0000 (21:14 +0200)]
Xquartz: include new localization files in the tarball

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
7 years agoXQuartz: xpr: Don't FatalError if xp_unlock_window fails
Jeremy Huddleston [Thu, 21 Jul 2011 17:33:58 +0000 (10:33 -0700)]
XQuartz: xpr: Don't FatalError if xp_unlock_window fails

We added the FatalError in 5d1d9d9ae39fab2ee2ac085f9776f82768828dc8 but
it caused a regression http://xquartz.macosforge.org/trac/ticket/482

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
7 years agoXQuartz: Use CFSTR to avoid implicit cast warning of NSString * to CFStringRef
Jeremy Huddleston [Wed, 20 Jul 2011 07:16:42 +0000 (00:16 -0700)]
XQuartz: Use CFSTR to avoid implicit cast warning of NSString * to CFStringRef

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
7 years agorandr: Compare all the bytes in RRPostPendingProperties
Aaron Plattner [Fri, 29 Jul 2011 23:12:06 +0000 (16:12 -0700)]
randr: Compare all the bytes in RRPostPendingProperties

RRPostPendingProperties tries to compare the pending and current
property values to decide whether they're actually changing.  However,
it does this using a memcmp that passes in pending_value->size as the
number of bytes.  This is actually the number of elements, where each
element is (pending_value->format / 8) bytes long.  This causes the
pending value to not be propagated if the first pending_value->size
bytes are the same and only the end of it is changing.

Fix this by computing the total number of bytes to compare in the
memcmp.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
7 years agoMerge remote-tracking branch 'whot/for-keith'
Keith Packard [Fri, 29 Jul 2011 21:58:58 +0000 (14:58 -0700)]
Merge remote-tracking branch 'whot/for-keith'

7 years agoTerminate the log with one last message.
Peter Hutterer [Wed, 20 Jul 2011 03:09:05 +0000 (13:09 +1000)]
Terminate the log with one last message.

Instead of just closing the log when everything is done, put one more
message in stating that we're actually terminating. Users or scripts that
look at the Xorg.log will then know that a) the server has terminated
properly and b) why the server terminated (to some degree, given that most
real-world errors will be caused by AbortServer()).

Acked-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoconfigure: set default xkb rules to evdev on Linux
Julien Cristau [Tue, 26 Jul 2011 18:40:38 +0000 (20:40 +0200)]
configure: set default xkb rules to evdev on Linux

If config/udev was enabled, this would default to base, which means that
after regen the devices would get the wrong rules, and hilarity would
ensue.

It's probably safe to default to evdev unconditionally on Linux by now.

Reported-by: Bastian Blank <waldi@debian.org>
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>
7 years agoInitialize the fd to -1 for xorg.conf input devices.
Peter Hutterer [Tue, 19 Jul 2011 23:00:18 +0000 (09:00 +1000)]
Initialize the fd to -1 for xorg.conf input devices.

For hotplugged devices, xf86AllocateInput does that for us but the xorg.conf
path is different. Since not all drivers reset the fd during PreInit but may
still call close(pInfo->fd) in all cases, this can terminate the logging
early.

Reproducible: add a wacom driver InputDevice section with no Option Device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
7 years agoxfree86: NULL option values are technically valid, don't strdup them
Peter Hutterer [Mon, 4 Jul 2011 02:34:32 +0000 (12:34 +1000)]
xfree86: NULL option values are technically valid, don't strdup them

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
7 years agoxfree86: duplicate xorg.conf device information before xf86NewInputDevice
Peter Hutterer [Mon, 4 Jul 2011 04:14:39 +0000 (14:14 +1000)]
xfree86: duplicate xorg.conf device information before xf86NewInputDevice

xf86ConfigLayout.inputs contains the information from the xorg.conf
file. Passing this into xf86NewInputDevice means the device will get
cleaned up on exit and the pointers in xf86ConfigLayout.inputs are left
dangling. In the second server generation, this results in a server
crash.

Also, rename pDev to pInfo. pDev is pretty much reserved for DeviceIntPtr
types.

Reproducible: AutoAddDevices off and xorg.conf input sections, trigger
server regeneration.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
7 years agoxfree86: Remove devices that failed to enable on startup
Peter Hutterer [Mon, 27 Jun 2011 06:30:28 +0000 (16:30 +1000)]
xfree86: Remove devices that failed to enable on startup

Devices that succeeded during PreInit and DEVICE_INIT but failed in
DEVICE_ON would be deleted through xf86DeleteInput but not removed from the
list of input devices (and not turned off). The result was a double free on
server shutdown.

Fix this by calling RemoveDevice if EnableDevice fails.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
7 years agoconfig: don't fail if a device vanished by the time we managed to look at it
Lennart Poettering [Mon, 18 Jul 2011 19:18:27 +0000 (21:18 +0200)]
config: don't fail if a device vanished by the time we managed to look at it

The nature of hotplug is that a device we enumerated might already be
gone by the time we look at it, so don't assume otherwise.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoconfig: limit the kernel subsystems we look for devices in
Lennart Poettering [Mon, 18 Jul 2011 19:17:49 +0000 (21:17 +0200)]
config: limit the kernel subsystems we look for devices in

Don't enumerate/monitor all devices of the system (since that can be
quite a few), but limit our search to devices from the "input"
subsystem, as well as the "tty" subsystem (to cover Wacom tablets).

This should make X start up a bit faster and reduce the number of
unnecessary wake-ups of the X server.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>