meego-w40:xserver-xorg.git
6 years agoChangelog: 2:1.9.5-meego2121 master master-next meego/2_1.9.5-meego2121
Rami Ylimäki [Tue, 20 Mar 2012 12:39:28 +0000 (14:39 +0200)]
Changelog: 2:1.9.5-meego2121

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
6 years agoRevert "DEBUG: Save various event histories to find causes of rare crashes."
Erkki Seppälä [Tue, 20 Mar 2012 11:51:52 +0000 (13:51 +0200)]
Revert "DEBUG: Save various event histories to find causes of rare crashes."

Bug 299710 - Removal of X tracing and watchdog

This reverts commit 7f9f2f772d24ba897c5703c67a9c0a5e2f8bccb1.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
6 years agoRevert "dix/trace: An extensible variation of the tracing mechanism"
Erkki Seppälä [Tue, 20 Mar 2012 11:51:26 +0000 (13:51 +0200)]
Revert "dix/trace: An extensible variation of the tracing mechanism"

Bug 299710 - Removal of X tracing and watchdog

This reverts commit 3f6026be7278dc31e7598b55c85544f4f162fce5.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
6 years agoRevert "dix/trace: Remove graphics event definitions as they come from driver."
Erkki Seppälä [Tue, 20 Mar 2012 11:51:15 +0000 (13:51 +0200)]
Revert "dix/trace: Remove graphics event definitions as they come from driver."

Bug 299710 - Removal of X tracing and watchdog

This reverts commit 50fdda42bda3d1fc21371ab39f061fd92e30ae67.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
6 years agoRevert "dix/trace: Remove trace log printing as GDB scripts can do that now."
Erkki Seppälä [Tue, 20 Mar 2012 11:51:02 +0000 (13:51 +0200)]
Revert "dix/trace: Remove trace log printing as GDB scripts can do that now."

Bug 299710 - Removal of X tracing and watchdog

This reverts commit b2594e99818b0cd1777fb24e47e52d7efb1bf70b.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
6 years agoRevert "os/utils: added callback SigAlrmCallback for SIGALRM"
Erkki Seppälä [Tue, 20 Mar 2012 11:50:27 +0000 (13:50 +0200)]
Revert "os/utils: added callback SigAlrmCallback for SIGALRM"

Bug 299710 - Removal of X tracing and watchdog

This reverts commit e34e150dbd8e64014118da53fed6ba6aeb1cdcce.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
6 years agoRevert "os/trace: enhanced trace entry time precision"
Erkki Seppälä [Tue, 20 Mar 2012 11:48:30 +0000 (13:48 +0200)]
Revert "os/trace: enhanced trace entry time precision"

Bug 299710 - Removal of X tracing and watchdog

This reverts commit 6e2450e803827b3c5a87bdd643e8679f19073a70.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
6 years agoRevert "debian: Enable double buffer extension."
Rami Ylimäki [Tue, 20 Mar 2012 12:30:37 +0000 (14:30 +0200)]
Revert "debian: Enable double buffer extension."

This reverts commit 128f6427721b175f49adfd80385dba786959a060.

6 years agodebian: Enable double buffer extension.
Rami Ylimäki [Fri, 17 Feb 2012 13:35:05 +0000 (15:35 +0200)]
debian: Enable double buffer extension.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
6 years agoChangelog: 2:1.9.5-meego2071 meego/2_1.9.5-meego2071
Rami Ylimäki [Fri, 17 Feb 2012 13:29:33 +0000 (15:29 +0200)]
Changelog: 2:1.9.5-meego2071

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
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>
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>
6 years agoos/trace: enhanced trace entry time precision
Erkki Seppälä [Tue, 7 Feb 2012 13:46:58 +0000 (15:46 +0200)]
os/trace: enhanced trace entry time precision

Note that this change is not backwards-compatible so xf86-video-fbdev
needs to be recompiled and a matching version of x11-tools needs to be
used to process the resulting traces.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
6 years agoChangelog: 2:1.9.5-meego2041 meego/2_1.9.5-meego2041
Erkki Seppälä [Tue, 24 Jan 2012 15:25:37 +0000 (17:25 +0200)]
Changelog: 2:1.9.5-meego2041

Fixes: NB#297199 - X server tracing improvements
Fixes: NB#297203 - The X-server doesn't have a watchdog to guard against GPU hangs

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
6 years agoos/utils: added callback SigAlrmCallback for SIGALRM
Erkki Seppälä [Tue, 17 Jan 2012 09:04:48 +0000 (11:04 +0200)]
os/utils: added callback SigAlrmCallback for SIGALRM

This allows external functions to be hooked into the SIGALRM
handler. This can be useful for example for driver watchdogs.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
6 years agodix/trace: Remove trace log printing as GDB scripts can do that now.
Rami Ylimäki [Mon, 16 Jan 2012 12:08:35 +0000 (14:08 +0200)]
dix/trace: Remove trace log printing as GDB scripts can do that now.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
6 years agodix/trace: Remove graphics event definitions as they come from driver.
Rami Ylimäki [Tue, 10 Jan 2012 10:28:36 +0000 (12:28 +0200)]
dix/trace: Remove graphics event definitions as they come from driver.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
6 years agodix/trace: An extensible variation of the tracing mechanism
Erkki Seppälä [Thu, 29 Dec 2011 16:00:30 +0000 (18:00 +0200)]
dix/trace: An extensible variation of the tracing mechanism

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
6 years agoChangelog: 2:1.9.5-meego1471
Avinash [Mon, 21 Nov 2011 14:07:24 +0000 (16:07 +0200)]
Changelog: 2:1.9.5-meego1471
Signed-off-by: Avinash <avinash.alok@symbio.com>
6 years agoos/connection: Prevent WaitForSomething from busylooping
Erkki Seppälä [Tue, 4 Oct 2011 13:11:52 +0000 (16:11 +0300)]
os/connection: Prevent WaitForSomething from busylooping

CheckConnections didn't check for write blocked clients. If an
ignored client is write-blocked but then closed, the Select in
WaitForSomething will return EBADF. CheckConnections is supposed to
weed these connections out but it doesn't, because it checks only for
AllClients, and ignored clients (which can still be written to) aren't
in that set.

This patch makes CheckConnections check also the set
ClientsWriteBlocked in addition to AllClients.

Test case: run cnee, put it in suspend with ^Z and generate a lot of
events, so that its connection becomes write blocked. Now kill -9 the
process and witness X entering a neverending loop. Cnee's connection
issues RecordEnableContext, which makes the connection ignored.

Reported-by: Rami Ylimaki <rami.ylimaki@vincit.fi>
Tested-by: Remes Lars <lars.remes@symbio.com>
Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
6 years agoChangelog: 2:1.9.5-meego1411 meego/2_1.9.5-meego1411
aalok [Tue, 18 Oct 2011 17:00:08 +0000 (20:00 +0300)]
Changelog: 2:1.9.5-meego1411

Signed-off-by: Avinash <avinash.alok@symbio.com>
6 years agoDEBUG: Save various event histories to find causes of rare crashes.
Rami Ylimäki [Thu, 30 Jun 2011 11:50:25 +0000 (14:50 +0300)]
DEBUG: Save various event histories to find causes of rare crashes.

Fixes: NB#275947 - X server doesn't preserve enough context
for crash reports

Reported-by: Ylimaki Rami <rami.ylimaki@vincit.fi>
Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Tested-by: Malik Attiq <ext-attiq.1.malik@nokia.com>
Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
6 years agoChangelog: 2:1.9.5-meego1353 meego/2_1.9.5-meego1353
aalok [Thu, 13 Oct 2011 16:12:37 +0000 (19:12 +0300)]
Changelog: 2:1.9.5-meego1353
Fixes bug - immutable XRandR properties can be deleted.

Fixes: NB#276479

Reported-by: Verhaegen Luc <libv@skynet.be>
Reviewed-by: Ylimaki Rami <rami.ylimaki@vincit.fi>
Tested-by: Remes Lars <lars.remes@symbio.com>
Signed-off-by: Avinash <avinash.alok@symbio.com>
6 years agodebian/changelog: Disallow reconfiguring immutable output properties.
aalok [Thu, 13 Oct 2011 16:08:07 +0000 (19:08 +0300)]
debian/changelog: Disallow reconfiguring immutable output properties.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
6 years agorandr: stop clients from deleting immutable output properties
Luc Verhaegen [Tue, 23 Aug 2011 22:19:59 +0000 (00:19 +0200)]
randr: stop clients from deleting immutable output properties

Immutable in randr means that clients are not able to alter the
property itself, they are only allowed to alter the property value.
This logically means that the property then should not be deleted
by the client either.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
6 years agoChangelog: 2:1.9.5-meego1352 meego/2_1.9.5-meego1352
aalok [Mon, 10 Oct 2011 09:51:56 +0000 (12:51 +0300)]
Changelog: 2:1.9.5-meego1352
Fixes: NB#283097 - Don't reduce X server core dumps

debian/changelog: X server core dumps are reduced currently.

Signed-off-by: Avinash <ext-avinash.alok@nokia.com>
Reported-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
6 years agodebian: Disable reduction of X server core dumps.
Rami Ylimäki [Mon, 19 Sep 2011 14:04:57 +0000 (17:04 +0300)]
debian: Disable reduction of X server core dumps.

The presence of /etc/rich-core/disable-reducer/Xorg prevents
rich-core-dumper from reducing the X server core dumps.

Fixes: NB#283097 - X server core dumps are reduced

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi>
7 years agoChangelog: 2:1.9.5-meego1351 meego/2_1.9.5-meego1351
Rami Ylimäki [Fri, 2 Sep 2011 10:53:41 +0000 (13:53 +0300)]
Changelog: 2:1.9.5-meego1351
Fixes: NB#279439 - Xorg server crashes when running spandex

debian/changelog: DRI2Drawable stale pointer fix

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Reported-by: Remes Lars <lars.remes@symbio.com>
Tested-by: Malik Attiq <ext-attiq.1.malik@nokia.com>
Reviewed-by: Remes Lars <lars.remes@symbio.com>
7 years agodri2: Clear references to destroyed X drawables in DRI2 drawables.
Rami Ylimäki [Wed, 31 Aug 2011 11:49:17 +0000 (14:49 +0300)]
dri2: Clear references to destroyed X drawables in DRI2 drawables.

When the first DRI2 drawable associated with a window is created, it's
added to the resource tables with two resource IDs. The first ID is
unique and is given to the client that creates the DRI2 drawable. The
second ID is equivalent to the window ID.

When DRI2 drawables associated with a window are destroyed, or vice
versa, the association between these two resources must be broken
reliably. These two cases are described below in more detail.

Case 1. When the window gets destroyed, all resources with the window
ID are released. So the DRI2 drawable resource with the window ID is
also released, but only its drawable member (pointer to the window) is
cleared to indicate that the associated window doesn't exist
anymore. The DRI2 drawable resource remains still in resource tables
as long as the unique resource IDs exist. Furthermore, the DRI2
drawable is not released from memory until it's not referenced anymore
within the X server or graphics driver. This case works currently fine
and doesn't need to be fixed.

Case 2. If all of the DRI2 drawables with unique IDs are destroyed
during the lifetime of the window, the DRI2 drawable with the window
ID is also automatically released as there is no more need to care
about destruction of windows that don't have DRI2 drawables associated
with them. However, there still might be references to the destroyed
DRI2 drawable resources lying around when they are removed from the
resource tables. For example, these DRI2 drawables might be living for
a short time in the swap request queue of the graphics driver. If the
associated window is destroyed before the swap request queue has been
flushed, the DRI2 drawables of the queue will point to a destroyed
window for a short while.

This patch fixes the case 2 described above. Whenever a window is
destroyed, we make sure that the associated DRI2 drawables, that are
still alive, will get their drawable member cleared. Otherwise
DRI2DrawableGone will access this stale pointer when the DRI2 drawable
is finally removed from the swap request queue.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Reviewed-by: Lars Remes <lars.remes@symbio.com>
7 years agodri2: Initialize needInvalidate member for DRI2Drawables.
Rami Ylimäki [Wed, 31 Aug 2011 14:17:52 +0000 (17:17 +0300)]
dri2: Initialize needInvalidate member for DRI2Drawables.

If the client is not behaving correctly and swaps buffers before
getting them, Valgrind will complain about unitialized memory being
used in DRI2InvalidateDrawable.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agoNOKIA: Crash behaviour fixes. meego/2_1.9.5-meego1211
Rami Ylimäki [Fri, 27 May 2011 08:06:39 +0000 (11:06 +0300)]
NOKIA: Crash behaviour fixes.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agoNOKIA: Abort immediately if fatal signal occurs.
Rami Ylimäki [Tue, 24 May 2011 09:50:01 +0000 (12:50 +0300)]
NOKIA: Abort immediately if fatal signal occurs.

Try to preserve as much program state as possible if X server
crashes. By default X server cleans up before aborting, which may
destroy important program state information from coredumps. Therefore
X server is aborted immediately and no cleanup is done.

Kernel truncates coredumps if it's interrupted by a signal while core
is being dumped to a pipe. At least SIGALRM and SIGIO have been
noticed to occur during dumping and causing the coredump to be
truncated. X server must therefore trap the fatal signals so that it
can block signals before aborting.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agodebian/changelog: DRI2 invalidation fixes. meego/2_1.9.5-meego1191
Rami Ylimäki [Mon, 9 May 2011 13:28:35 +0000 (16:28 +0300)]
debian/changelog: DRI2 invalidation fixes.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agodri2: Don't send so many needless invalidate events
Ville Syrjälä [Fri, 6 May 2011 12:46:47 +0000 (15:46 +0300)]
dri2: Don't send so many needless invalidate events

Only send invalidate events for drawables if some client has requested
some buffers.

Fixes: NB#253501 - Don't send needless DRI2 invalida events

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
7 years agodebian/changelog: DRI2 invalidation fixes. meego/2_1.9.5-meego1181
Rami Ylimäki [Tue, 3 May 2011 09:14:37 +0000 (12:14 +0300)]
debian/changelog: DRI2 invalidation fixes.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agodri2: Invalidate window pixmaps
Ville Syrjälä [Tue, 26 Apr 2011 19:54:42 +0000 (22:54 +0300)]
dri2: Invalidate window pixmaps

While a redirected window is flipped, its pixmap may still be used as
and EGL image and should also get invalidated. When sending invalidate
events for a window, also send the events for its pixmap.

Fixes: NB#251344 - Send invalidate events for all affected drawables

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
7 years agodri2: Invalidate DRI2 buffers for all windows with the same pixmap on swap
Keith Packard [Mon, 7 Feb 2011 18:52:57 +0000 (20:52 +0200)]
dri2: Invalidate DRI2 buffers for all windows with the same pixmap on swap

Without this, when a compositing manager unredirects a fullscreen window which
uses DRI2 and page flipping, the DRI2 buffer information for the compositing
manager's output window (typically the Composite Overlay Window or root window)
may become stale, resulting in all kinds of hilarity.

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

[Original patch by Michel Dänzer <michel@daenzer.net>]
[Tree walk optimized version by Keith Packard <keithp@keithp.com>]

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
7 years agodri2: Make DRI2InvalidateDrawable() accept NULL drawable
Ville Syrjälä [Tue, 26 Apr 2011 19:53:40 +0000 (22:53 +0300)]
dri2: Make DRI2InvalidateDrawable() accept NULL drawable

Makes following patches simpler.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
7 years agodebian/changelog: Composite fixes. meego/2_1.9.5-meego1161
Rami Ylimäki [Wed, 20 Apr 2011 07:10:31 +0000 (10:10 +0300)]
debian/changelog: Composite fixes.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agocomposite: Recompute clipping when changing between manual and automatic redirection
Ville Syrjälä [Wed, 13 Apr 2011 18:46:20 +0000 (21:46 +0300)]
composite: Recompute clipping when changing between manual and automatic redirection

Call compMarkWindows() when changing between manual and automatic
redirection modes. Otherwise the window clipping won't be recomputed
correctly.

Fixes: NB#246208 - Recompute clipping when changing between manual and automatic redirection

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
7 years agocomposite: Fix pWin->redirectDraw when changing between manual and automatic redirection
Ville Syrjälä [Wed, 13 Apr 2011 18:45:43 +0000 (21:45 +0300)]
composite: Fix pWin->redirectDraw when changing between manual and automatic redirection

compAllowPixmap() is not called when changing between manual and
automatic redirection modes. That means pWin->redirectDraw is left
with an incorrect value, and miComputeClips() gets confused whether
the window is supposed to be treated as transparent or not. Fix
the issue by updating pWin->redirectDraw in compCheckRedirect()
even when not calling compAllocPixmap().

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
7 years agocomposite: Remove useles pWin->mapped tests
Ville Syrjälä [Thu, 14 Apr 2011 17:44:07 +0000 (20:44 +0300)]
composite: Remove useles pWin->mapped tests

compMarkWindows() already checks pWin->viewable, so checking
pWin->mapped beforehand is superfluous. Also avoid doing
compMarkWindows() twice in compRedirectWindow() by checking
if windows were already marked.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
7 years agocomposite: Remove stale comment
Ville Syrjälä [Thu, 14 Apr 2011 17:38:50 +0000 (20:38 +0300)]
composite: Remove stale comment

Remove a comment which became outdated when the unmap+map cycle
was eliminated from window redirection changes.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
7 years agodebian/changelog: Damage optimizations and DRI2 stability fixes. meego/2_1.9.5-meego1142
Rami Ylimäki [Wed, 13 Apr 2011 11:57:30 +0000 (14:57 +0300)]
debian/changelog: Damage optimizations and DRI2 stability fixes.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agodri2: Pass out_count by value to update_dri2_drawable_buffers()
Ville Syrjälä [Tue, 12 Apr 2011 14:57:00 +0000 (17:57 +0300)]
dri2: Pass out_count by value to update_dri2_drawable_buffers()

update_dri2_drawable_buffers() doesn't modify out_count, so pass it
by value.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
7 years agodri2: Handle calloc() failure
Ville Syrjälä [Tue, 12 Apr 2011 14:56:59 +0000 (17:56 +0300)]
dri2: Handle calloc() failure

Don't access invalid memory if calloc() fails to allocate the buffers
array.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
7 years agoReplace malloc with calloc to initialize the buffers[] as NULL in do_get_buffers...
Justin Dou [Tue, 12 Apr 2011 14:56:58 +0000 (17:56 +0300)]
Replace malloc with calloc to initialize the buffers[] as NULL in do_get_buffers function

The calling for allocate_or_reuse_buffer may fail due to some reason, e.g. out of memory.
If the buffers[] were not initialized to be NULL, the following err_out may try to access an illegal memory, which will cause X crash afterward.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Justin Dou <Justin.Dou@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
7 years agodamage: use DamageReportDamage for the initial borderClip damage report
Erkki Seppälä [Thu, 24 Mar 2011 11:34:17 +0000 (13:34 +0200)]
damage: use DamageReportDamage for the initial borderClip damage report

Instead of using DamageDamageRegion for reporting the first (virtual)
damage in ProcDamageCreate that covers the borderClip of the drawable
window, use a function DamageReportDamage directly (previously called
damageReportDamage). This avoids sending all other damage listeners a
full window update when a new damage object is created.

As this patch makes DamageReportDamage a public interface, the
function has been moved into the part of the file that contains all
the other public functions. The function has not been otherwise
modified.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Reviewed-by: Keith Packard <keithp@keithp.com>
7 years agodebian/changelog: Upstream sync + stability fixes & optimizations. meego/2_1.9.5-meego1141
Rami Ylimäki [Fri, 8 Apr 2011 09:10:53 +0000 (12:10 +0300)]
debian/changelog: Upstream sync + stability fixes & optimizations.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agoxfree86: loader: use one exit code only for readability
Tiago Vignatti [Thu, 31 Mar 2011 14:46:42 +0000 (17:46 +0300)]
xfree86: loader: use one exit code only for readability

No functional changes. Spaghetti code for the win! \o/

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
7 years agoxfree86: xv: fix double free in xf86XVFreeAdaptor
Tiago Vignatti [Thu, 31 Mar 2011 20:44:03 +0000 (23:44 +0300)]
xfree86: xv: fix double free in xf86XVFreeAdaptor

When xf86XVFreeAdaptor is called more than once in xf86XVInitAdaptors (it may,
but not often), the conditional being changed in this patch will always take
true path and will keep freeing pAdaptor->pAttributes, thus letting the system
error-prone.

This patch fix such problem checking for a pointer instead the number of
attributes. Such pointer will be deallocated when xf86XVFreeAdaptor is called
first and will not let the code re-run in the following calls. This is a bit
similar how the surroundings code is already doing.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
7 years agoxfree86: xv: set pointers to NULL in xf86XVFreeAdaptor
Tiago Vignatti [Mon, 4 Apr 2011 17:25:32 +0000 (20:25 +0300)]
xfree86: xv: set pointers to NULL in xf86XVFreeAdaptor

As a good practice and for eventual double frees.

The reason of this patch is due the resilience of xf86XVInitAdaptors, where
for any adaptor failure it's able to keep trying registering the following
ones.

I discussed briefly with Pauli and Ville about a bigger refactoring of such
function, doing it in a way to return instantly when a failure happens; after
all that's how mostly of the other driver functions work. Instead, we just
thought that xf86XVInitAdaptors is wise and cool, and eventually other driver
functions should be even following the main idea of resilience.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
7 years agoos: fix use after free in EstablishNewConnections
Tiago Vignatti [Mon, 4 Apr 2011 18:40:06 +0000 (21:40 +0300)]
os: fix use after free in EstablishNewConnections

In the case of failure on AllocNewConnection, new_trans_conn cannot be
dereferenced because it's already freed. Swapping the order of this logic fix
the changes introduced in 04956b80431169e0ae713a3e6ba4cdc157ce3a66.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
CC: Jeremy Huddleston <jeremyhu@freedesktop.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
7 years agodix: don't free stranger pointers inside AllocARGBCursor
Tiago Vignatti [Mon, 4 Apr 2011 19:31:42 +0000 (22:31 +0300)]
dix: don't free stranger pointers inside AllocARGBCursor

This seems a good convention to follow: if pointers are allocate outside a
given function, then free there as well when a failure occurs.

AllocARGBCursor and its callers were mixing up the freeing of resources and
causing a particular double free inside TileScreenSaver (srcbits and mskbits).

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
7 years agoMerge commit 'fdo/server-1.9-branch' into sa
Rami Ylimäki [Fri, 8 Apr 2011 08:13:08 +0000 (11:13 +0300)]
Merge commit 'fdo/server-1.9-branch' into sa

7 years agoNOKIA: debian: Remove obsolete matching rule for touchpads.
Rami Ylimäki [Thu, 17 Mar 2011 10:27:18 +0000 (12:27 +0200)]
NOKIA: debian: Remove obsolete matching rule for touchpads.

A two touchpoint touch screen was only used in early prototypes.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agoNOKIA: debian: Optimize startup time by skipping xkbcomp invocations.
Rami Ylimäki [Thu, 17 Mar 2011 10:25:07 +0000 (12:25 +0200)]
NOKIA: debian: Optimize startup time by skipping xkbcomp invocations.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agoxkb: Prevent leaking of XKB geometry information on copy.
Rami Ylimäki [Wed, 30 Mar 2011 09:59:40 +0000 (12:59 +0300)]
xkb: Prevent leaking of XKB geometry information on copy.

Currently shapes, sections and doodads may leak on copy.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agoxkb: Introduce helper function to handle similar reallocations.
Rami Ylimäki [Wed, 30 Mar 2011 13:25:45 +0000 (16:25 +0300)]
xkb: Introduce helper function to handle similar reallocations.

This is preparation for a memory leak fix and doesn't contain any
functional changes.

Note that two variables are generally used for reallocation and
clearing of arrays: geom->sz_elems (reallocation) and geom->num_elems
(clearing). The interface of XkbGeomRealloc is deliberately kept
simple and it only accepts geom->sz_elems as argument, because that is
needed to determine whether the array needs to be resized. When the
array is cleared, we just assume that either geom->sz_elems and
geom->num_elems are synchronized to be equal or that unused elements
are cleared whenever geom->num_elems is set to be less than
geom->sz_elems without reallocation.

Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agoRevert "xkb: Introduce helper function to handle similar reallocations."
Rami Ylimäki [Thu, 31 Mar 2011 09:59:28 +0000 (12:59 +0300)]
Revert "xkb: Introduce helper function to handle similar reallocations."

This reverts commit 3aa09d9f258e338101b1a3053c9259ac4b7358d5.

7 years agoRevert "xkb: Prevent leaking of XKB geometry information on copy."
Rami Ylimäki [Thu, 31 Mar 2011 09:59:00 +0000 (12:59 +0300)]
Revert "xkb: Prevent leaking of XKB geometry information on copy."

This reverts commit ccdeec739db9094cfb4d11ac2b0755f5d3c23ce3.

7 years agoxfree86: loader: fix memory leaks in LoaderListDirs
Tiago Vignatti [Mon, 28 Mar 2011 17:24:52 +0000 (20:24 +0300)]
xfree86: loader: fix memory leaks in LoaderListDirs

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
7 years agoos: use DebugF for debugging
Tiago Vignatti [Mon, 4 Apr 2011 14:21:01 +0000 (17:21 +0300)]
os: use DebugF for debugging

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
7 years agoxfree86: fix bad free configInputDevices
Tiago Vignatti [Mon, 4 Apr 2011 14:14:42 +0000 (17:14 +0300)]
xfree86: fix bad free configInputDevices

introduced in 93ca526892c0d22afa05cce6496198c652043a19.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agorender: fix memory leaks in ProcRenderCompositeGlyphs
Tiago Vignatti [Tue, 29 Mar 2011 15:22:50 +0000 (18:22 +0300)]
render: fix memory leaks in ProcRenderCompositeGlyphs

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Soren Sandmann <ssp@redhat.com>
7 years agoxkb: fix fd leak in XkbDDXListComponent
Tiago Vignatti [Tue, 29 Mar 2011 14:17:40 +0000 (17:17 +0300)]
xkb: fix fd leak in XkbDDXListComponent

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
7 years agodix: fix memory leak in ProcListExtensions
Tiago Vignatti [Tue, 29 Mar 2011 13:54:14 +0000 (16:54 +0300)]
dix: fix memory leak in ProcListExtensions

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
7 years agomi: fix memory leak in miZeroLine
Tiago Vignatti [Tue, 29 Mar 2011 13:48:21 +0000 (16:48 +0300)]
mi: fix memory leak in miZeroLine

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
7 years agoxi: fix memory leak in AddExtensionClient
Tiago Vignatti [Mon, 28 Mar 2011 17:13:11 +0000 (20:13 +0300)]
xi: fix memory leak in AddExtensionClient

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
7 years agodix: fix memory leak in AllocShared
Tiago Vignatti [Mon, 28 Mar 2011 17:09:04 +0000 (20:09 +0300)]
dix: fix memory leak in AllocShared

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
7 years agodix: fix memory leak in AllocPseudo
Tiago Vignatti [Mon, 28 Mar 2011 17:07:06 +0000 (20:07 +0300)]
dix: fix memory leak in AllocPseudo

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
7 years agoos: fix memory and fd leaks in Popen
Tiago Vignatti [Mon, 28 Mar 2011 16:21:28 +0000 (19:21 +0300)]
os: fix memory and fd leaks in Popen

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
7 years agoxfree86: fix memory leak in xf86LoadModules
Tiago Vignatti [Tue, 29 Mar 2011 17:04:24 +0000 (20:04 +0300)]
xfree86: fix memory leak in xf86LoadModules

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoxfree86: fix memory leaks in configLayout
Tiago Vignatti [Tue, 29 Mar 2011 16:49:32 +0000 (19:49 +0300)]
xfree86: fix memory leaks in configLayout

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoxfree86: fix memory leak in xf86ConfigFbEntity
Tiago Vignatti [Fri, 25 Mar 2011 20:21:21 +0000 (22:21 +0200)]
xfree86: fix memory leak in xf86ConfigFbEntity

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agofb: fix memory leak in fbOverlayFinishScreenInit
Tiago Vignatti [Fri, 25 Mar 2011 20:10:55 +0000 (22:10 +0200)]
fb: fix memory leak in fbOverlayFinishScreenInit

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoXi: fix memory leak in ProcXGetSelectedExtensionEvents
Tiago Vignatti [Fri, 25 Mar 2011 20:07:44 +0000 (22:07 +0200)]
Xi: fix memory leak in ProcXGetSelectedExtensionEvents

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodix: fix memory leak in SetDefaultFontPath
Tiago Vignatti [Fri, 25 Mar 2011 20:07:31 +0000 (22:07 +0200)]
dix: fix memory leak in SetDefaultFontPath

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agomi: fix memory leak in miFillUniqueSpanGroup
Tiago Vignatti [Fri, 25 Mar 2011 19:33:15 +0000 (21:33 +0200)]
mi: fix memory leak in miFillUniqueSpanGroup

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoxi: fix memory leak in ProcXIQueryDevice
Tiago Vignatti [Fri, 25 Mar 2011 17:27:17 +0000 (19:27 +0200)]
xi: fix memory leak in ProcXIQueryDevice

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agomi: fix memory leak in miInitVisuals
Tiago Vignatti [Fri, 25 Mar 2011 17:21:03 +0000 (19:21 +0200)]
mi: fix memory leak in miInitVisuals

Free the pointers inside miInitVisuals, so the callers of this function
(fboverlay.c and fbscreen.c) don't need to worry with deallocation in the case
of failure.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoxfree86: dri2: fix memory leak and free resources properly
Tiago Vignatti [Fri, 25 Mar 2011 16:56:02 +0000 (18:56 +0200)]
xfree86: dri2: fix memory leak and free resources properly

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoxorg: remove unused pointer values all over the server
Tiago Vignatti [Fri, 25 Mar 2011 16:24:34 +0000 (18:24 +0200)]
xorg: remove unused pointer values all over the server

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodix: remove unused macro
Tiago Vignatti [Wed, 23 Mar 2011 16:08:29 +0000 (18:08 +0200)]
dix: remove unused macro

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodix: remove unused debug code
Tiago Vignatti [Wed, 23 Mar 2011 16:06:51 +0000 (18:06 +0200)]
dix: remove unused debug code

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoMerge commit 'tiago/for-jeremy-1.9' into master-next
Rami Ylimäki [Mon, 4 Apr 2011 12:29:58 +0000 (15:29 +0300)]
Merge commit 'tiago/for-jeremy-1.9' into master-next

7 years agoos/client: Prevent rare fd leak in DetermineClientPid
Erkki Seppälä [Thu, 24 Mar 2011 13:41:16 +0000 (15:41 +0200)]
os/client: Prevent rare fd leak in DetermineClientPid

DetermineClientPid didn't close file descriptor if read on
/proc/pid/cmdline failed. Adjusted the code to disregard the close
return value and perform the return after that, if the read failed or
returned EOF.

Signed-off-by: Mark Kettenis <mark.kettenis@xs4all.nl>
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agoconfig: handle device change event properly
Erkki Seppälä [Fri, 18 Mar 2011 14:27:50 +0000 (16:27 +0200)]
config: handle device change event properly

wakeup_handler in udev.c wasn't dealing with udev change events.
There are situations when a device can gain its input capabilities
after it has been added to the system and therefore the change events
must be handled as well.

The change is handled as a consecutive device removal and addition.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Stefan Kost <Stefan.Kost@nokia.com>
7 years agodebian/changelog: Expose currently served client to driver. meego/2_1.9.5-meego1122
Rami Ylimäki [Thu, 24 Mar 2011 12:44:36 +0000 (14:44 +0200)]
debian/changelog: Expose currently served client to driver.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agoNOKIA: dix: Expose client pointer for currently in processing client
Pauli Nieminen [Mon, 7 Mar 2011 18:40:33 +0000 (20:40 +0200)]
NOKIA: dix: Expose client pointer for currently in processing client

A hack to allow xv driver code to ignore a client.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
7 years agodebian/changelog: Initialization of replies + upstream sync. meego/2_1.9.5-meego1121
Rami Ylimäki [Wed, 23 Mar 2011 10:39:08 +0000 (12:39 +0200)]
debian/changelog: Initialization of replies + upstream sync.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agoMerge commit 'fdo/server-1.9-branch' into master-next
Rami Ylimäki [Wed, 23 Mar 2011 10:23:35 +0000 (12:23 +0200)]
Merge commit 'fdo/server-1.9-branch' into master-next

7 years agorandr: avoid uninitialized memory in rrGetScreenResources()
Oliver McFadden [Wed, 23 Mar 2011 10:18:01 +0000 (12:18 +0200)]
randr: avoid uninitialized memory in rrGetScreenResources()

Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
7 years agoX.Org: initialize all of the Reply structures on the stack.
Oliver McFadden [Mon, 21 Mar 2011 17:47:15 +0000 (19:47 +0200)]
X.Org: initialize all of the Reply structures on the stack.

The following sed expression was used to perform the initialization.

sed -i 's/^\([[:space:]]*\)\(x[[:alnum:]]\+Reply\)\([[:space:]]*\)\([[:alnum:]_]\+\)\([[:space:]]*\);/\1\2\3\4 = {0}\5;/' `find . -type f -name '*.c'`

Note that some of the memset() calls on Reply structures will now be
redundant and could be removed. I have left this for a future patch.

Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agoconfigure.ac: Bump version to 1.9.5 xorg-server-1.9.5
Jeremy Huddleston [Thu, 17 Mar 2011 20:54:05 +0000 (13:54 -0700)]
configure.ac: Bump version to 1.9.5

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
7 years agodebian/changelog: Fixes to coreweb reported crashes. meego/2_1.9.4.901-meego1115
Rami Ylimäki [Wed, 16 Mar 2011 10:41:01 +0000 (12:41 +0200)]
debian/changelog: Fixes to coreweb reported crashes.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agodri2: Don't crash if CreateBuffer fails
Ville Syrjälä [Fri, 11 Mar 2011 19:05:59 +0000 (21:05 +0200)]
dri2: Don't crash if CreateBuffer fails

Check whether CreateBuffer() returned NULL before trying to up
the refcnt on the buffer.

Fixes: NB#236045 - Don't crash if DRI2 CreateBuffer fails

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
7 years agodebian/changelog: Fixes for memory leaks on layout changes.
Rami Ylimäki [Wed, 16 Mar 2011 10:33:24 +0000 (12:33 +0200)]
debian/changelog: Fixes for memory leaks on layout changes.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agoxkb: Prevent leaking of XKB geometry information on copy.
Rami Ylimäki [Tue, 15 Mar 2011 13:12:15 +0000 (15:12 +0200)]
xkb: Prevent leaking of XKB geometry information on copy.

Currently shapes, sections and doodads may leak on copy.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
7 years agoxkb: Introduce helper function to handle similar reallocations.
Rami Ylimäki [Tue, 15 Mar 2011 14:53:38 +0000 (16:53 +0200)]
xkb: Introduce helper function to handle similar reallocations.

This is preparation for a memory leak fix and doesn't contain any
functional changes.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>