[Xquartz-changes] xserver: Branch 'master' - 15 commits
Jeremy Huddleston
jeremyhu at freedesktop.org
Tue Dec 8 15:30:34 PST 2009
configure.ac | 14 ++++++++-----
dix/devices.c | 4 ++-
dix/events.c | 9 ++------
exa/exa.c | 33 ++++++++++++++++---------------
exa/exa_accel.c | 6 +----
exa/exa_migration_mixed.c | 33 ++++++++++++++++++++++++++-----
exa/exa_mixed.c | 43 ++++++++++++++++++++++++++++++++++++++---
exa/exa_priv.h | 1
exa/exa_unaccel.c | 4 ++-
hw/xfree86/common/xf86Config.c | 2 -
hw/xfree86/common/xf86xv.c | 4 +--
hw/xquartz/mach-startup/stub.c | 12 +++++++----
hw/xquartz/xpr/x-hook.c | 12 +++++++++--
hw/xquartz/xpr/xprCursor.c | 13 +++++++++---
xkb/xkbAccessX.c | 2 +
15 files changed, 139 insertions(+), 53 deletions(-)
New commits:
commit 955b9f23a34cc79a5cd9676b45b3df4ffcc7302b
Author: Michel Dänzer <daenzer at vmware.com>
Date: Tue Dec 8 20:25:02 2009 +0100
EXA: ModifyPixmapHeader_mixed fixes.
* Better detection of dimension changes.
* Make sure to re-create the system memory copy when the pixmap dimensions
change (e.g. the screen pixmap on screen resize).
* Clear the valid regions.
Signed-off-by: Michel Dänzer <daenzer at vmware.com>
Acked-by: Maarten Maathuis <madman2003 at gmail.com>
Signed-off-by: Keith Packard <keithp at keithp.com>
diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c
index 764c7dd..0fb644b 100644
--- a/exa/exa_mixed.c
+++ b/exa/exa_mixed.c
@@ -135,17 +135,54 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
}
- if (pExaPixmap->driverPriv) {
- if (width > 0 && height > 0 && bitsPerPixel > 0) {
+ has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
+
+ if (width <= 0)
+ width = pPixmap->drawable.width;
+
+ if (height <= 0)
+ height = pPixmap->drawable.height;
+
+ if (bitsPerPixel <= 0) {
+ if (depth <= 0)
+ bitsPerPixel = pPixmap->drawable.bitsPerPixel;
+ else
+ bitsPerPixel = BitsPerPixel(depth);
+ }
+
+ if (depth <= 0)
+ depth = pPixmap->drawable.depth;
+
+ if (width != pPixmap->drawable.width ||
+ height != pPixmap->drawable.height ||
+ devKind != pPixmap->devKind ||
+ depth != pPixmap->drawable.depth ||
+ bitsPerPixel != pPixmap->drawable.bitsPerPixel) {
+ if (pExaPixmap->driverPriv) {
exaSetFbPitch(pExaScr, pExaPixmap,
width, height, bitsPerPixel);
exaSetAccelBlock(pExaScr, pExaPixmap,
width, height, bitsPerPixel);
+ REGION_EMPTY(pScreen, &pExaPixmap->validFB);
}
+
+ /* Need to re-create system copy if there's also a GPU copy */
+ if (has_gpu_copy && pExaPixmap->sys_ptr) {
+ free(pExaPixmap->sys_ptr);
+ pExaPixmap->sys_ptr = NULL;
+ pExaPixmap->sys_pitch = devKind > 0 ? devKind :
+ PixmapBytePad(width, depth);
+ DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
+ DamageDestroy(pExaPixmap->pDamage);
+ pExaPixmap->pDamage = NULL;
+ REGION_EMPTY(pScreen, &pExaPixmap->validSys);
+
+ if (pExaScr->deferred_mixed_pixmap == pPixmap)
+ pExaScr->deferred_mixed_pixmap = NULL;
+ }
}
- has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
if (has_gpu_copy) {
pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr;
pPixmap->devKind = pExaPixmap->fb_pitch;
commit c1503861cf75654d4f7b22e6f7f6487c47a0a395
Author: Michel Dänzer <daenzer at vmware.com>
Date: Tue Dec 8 20:25:01 2009 +0100
EXA: ExaDoPrepareAccess return value fixes.
Only return TRUE if the GPU copy is being accessed, and preserve the return
value on repeated / nested calls for the same pixmap.
exaPrepareAccessReg_mixed could get inconsistent return values e.g. when the
same pixmap is both the destination and source of an operation, potentially
resulting in a crash.
Signed-off-by: Michel Dänzer <daenzer at vmware.com>
Acked-by: Maarten Maathuis <madman2003 at gmail.com>
Signed-off-by: Keith Packard <keithp at keithp.com>
diff --git a/exa/exa.c b/exa/exa.c
index 023288c..b3c5bff 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -283,7 +283,7 @@ exaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp)
}
/**
- * Returns TRUE if pixmap can be accessed offscreen.
+ * Returns TRUE if the pixmap GPU copy is being accessed.
*/
Bool
ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
@@ -291,7 +291,7 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPriv (pScreen);
ExaPixmapPriv(pPixmap);
- Bool has_gpu_copy;
+ Bool has_gpu_copy, ret;
int i;
if (!(pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS))
@@ -304,7 +304,7 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
for (i = 0; i < EXA_NUM_PREPARE_INDICES; i++) {
if (pExaScr->access[i].pixmap == pPixmap) {
pExaScr->access[i].count++;
- return TRUE;
+ return pExaScr->access[i].retval;
}
}
@@ -323,29 +323,33 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
- if (has_gpu_copy && pExaPixmap->fb_ptr)
+ if (has_gpu_copy && pExaPixmap->fb_ptr) {
pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr;
- else
+ ret = TRUE;
+ } else {
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
+ ret = FALSE;
+ }
/* Store so we can handle repeated / nested calls. */
pExaScr->access[index].pixmap = pPixmap;
pExaScr->access[index].count = 1;
if (!has_gpu_copy)
- return FALSE;
+ goto out;
exaWaitSync (pScreen);
if (pExaScr->info->PrepareAccess == NULL)
- return TRUE;
+ goto out;
if (index >= EXA_PREPARE_AUX_DEST &&
!(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) {
if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
FatalError("Unsupported AUX indices used on a pinned pixmap.\n");
exaMoveOutPixmap (pPixmap);
- return FALSE;
+ ret = FALSE;
+ goto out;
}
if (!(*pExaScr->info->PrepareAccess) (pPixmap, index)) {
@@ -353,11 +357,15 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
!(pExaScr->info->flags & EXA_MIXED_PIXMAPS))
FatalError("Driver failed PrepareAccess on a pinned pixmap.\n");
exaMoveOutPixmap (pPixmap);
-
- return FALSE;
+ ret = FALSE;
+ goto out;
}
- return TRUE;
+ ret = TRUE;
+
+out:
+ pExaScr->access[index].retval = ret;
+ return ret;
}
/**
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index 69c0d24..0852355 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -194,6 +194,7 @@ typedef struct {
struct {
PixmapPtr pixmap;
int count;
+ Bool retval;
} access[EXA_NUM_PREPARE_INDICES];
/* Holds information on fallbacks that cannot be relayed otherwise. */
commit fd867387335b6175d76bbe93118bbe5e1e45ce88
Author: Maarten Maathuis <madman2003 at gmail.com>
Date: Sat Dec 5 03:18:31 2009 +0100
exa/mixed: pixmaps that succeed prepare access have no need for a cpu copy
- When they have a gpu copy ofcource.
- Use the presence of a cpu copy as a hint to fall back instead of UTS'ing in
exaHWCopyNtoN.
Signed-off-by: Maarten Maathuis <madman2003 at gmail.com>
Acked-by: Michel Dänzer <michel at daenzer.net>
Signed-off-by: Keith Packard <keithp at keithp.com>
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 1d88acb..0f6e5f7 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -506,11 +506,9 @@ exaHWCopyNtoN (DrawablePtr pSrcDrawable,
exaMarkSync (pDstDrawable->pScreen);
/* UTS: mainly for SHM PutImage's secondary path.
*
- * Not taking this path for mixed pixmaps: It could only save one CPU
- * copy between cached memory and risks causing a more expensive
- * DownloadFromScreen later on.
+ * Only taking this path for directly accessible pixmaps.
*/
- } else if (!(pExaScr->info->flags & EXA_MIXED_PIXMAPS)) {
+ } else if (!pDstExaPixmap->pDamage) {
int bpp = pSrcDrawable->bitsPerPixel;
int src_stride = exaGetPixmapPitch(pSrcPixmap);
CARD8 *src = NULL;
diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index 9587ea2..b755b83 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -141,8 +141,9 @@ exaMoveInPixmap_mixed(PixmapPtr pPixmap)
void
exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
{
+ ExaPixmapPriv(pPixmap);
+
if (!ExaDoPrepareAccess(pPixmap, index)) {
- ExaPixmapPriv(pPixmap);
Bool has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
ExaMigrationRec pixmaps[1];
@@ -203,6 +204,22 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
pPixmap->devKind = pExaPixmap->sys_pitch;
pExaPixmap->use_gpu_copy = FALSE;
+ /* We have a gpu pixmap that can be accessed, we don't need the cpu copy
+ * anymore. Drivers that prefer DFS, should fail prepare access. */
+ } else if (pExaPixmap->pDamage && exaPixmapHasGpuCopy(pPixmap)) {
+ ExaScreenPriv(pPixmap->drawable.pScreen);
+
+ /* Copy back any deferred content if needed. */
+ if (pExaScr->deferred_mixed_pixmap &&
+ pExaScr->deferred_mixed_pixmap == pPixmap)
+ exaMoveInPixmap_mixed(pPixmap);
+
+ DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
+ DamageDestroy(pExaPixmap->pDamage);
+ pExaPixmap->pDamage = NULL;
+
+ free(pExaPixmap->sys_ptr);
+ pExaPixmap->sys_ptr = NULL;
}
}
commit bb7acfbcfbc37869c2215c26791c6175a5a6c526
Author: Michel Dänzer <daenzer at vmware.com>
Date: Fri Dec 4 08:37:14 2009 +0100
EXA: Use correct coordinate system for calculating Composite fallback region.
Fixes incorrectly skipped rendering of some Composite operations to windows.
Signed-off-by: Michel Dänzer <daenzer at vmware.com>
Reviewed-by: Keith Packard <keithp at keithp.com>
Signed-off-by: Keith Packard <keithp at keithp.com>
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index 9bc765a..eee14da 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -414,7 +414,9 @@ ExaCheckComposite (CARD8 op,
PixmapPtr pDstPix;
if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst,
- xSrc, ySrc, xMask, yMask, xDst, yDst,
+ xSrc, ySrc, xMask, yMask,
+ xDst + pDst->pDrawable->x,
+ yDst + pDst->pDrawable->y,
width, height))
goto skip;
commit 0f4ef7123d3e6e09e04dc55e8edb47aecf017648
Author: Maarten Maathuis <madman2003 at gmail.com>
Date: Thu Dec 3 19:28:13 2009 +0100
exa/mixed: setting devKind before exaCopyDirty* is not needed
Signed-off-by: Maarten Maathuis <madman2003 at gmail.com>
Acked-by: Michel Dänzer <michel at daenzer.net>
Signed-off-by: Keith Packard <keithp at keithp.com>
diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index a7fdf63..9587ea2 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -101,6 +101,14 @@ exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
if (pExaPixmap->pDamage && exaPixmapHasGpuCopy(pPixmap)) {
ExaScreenPriv(pPixmap->drawable.pScreen);
+ /* This pitch is needed for proper acceleration. For some reason
+ * there are pixmaps without pDamage and a bad fb_pitch value.
+ * So setting devKind when only exaPixmapHasGpuCopy() is true
+ * causes corruption. Pixmaps without pDamage are not migrated
+ * and should have a valid devKind at all times, so that's why this
+ * isn't causing problems. Pixmaps have their gpu pitch set the
+ * first time in the MPH call from exaCreateDriverPixmap_mixed().
+ */
pPixmap->devKind = pExaPixmap->fb_pitch;
exaCopyDirtyToFb(pixmaps + i);
@@ -183,17 +191,14 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
pixmaps[0].as_src = TRUE;
pixmaps[0].pReg = NULL;
}
- pPixmap->devKind = pExaPixmap->fb_pitch;
exaCopyDirtyToSys(pixmaps);
}
if (as_dst)
exaPixmapDirty(pPixmap, 0, 0, pPixmap->drawable.width,
pPixmap->drawable.height);
- } else if (has_gpu_copy) {
- pPixmap->devKind = pExaPixmap->fb_pitch;
+ } else if (has_gpu_copy)
exaCopyDirtyToSys(pixmaps);
- }
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
pPixmap->devKind = pExaPixmap->sys_pitch;
commit 8ea415d417b3ef6b8a288d10da76ff4bc334e08b
Author: Maarten Maathuis <madman2003 at gmail.com>
Date: Wed Dec 2 20:24:02 2009 +0100
Revert "exa: a few small pitch related changes"
This reverts commit 99d88ef69d5f7dbf99ca605eceb92f42230a89f4.
- Some pixmaps under classic have a sys_pitch which is 0, no idea why. This is
causing rendering corruption.
Signed-off-by: Maarten Maathuis <madman2003 at gmail.com>
Acked-by: Michel Dänzer <michel at daenzer.net>
Signed-off-by: Keith Packard <keithp at keithp.com>
diff --git a/exa/exa.c b/exa/exa.c
index 16f39f6..023288c 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -323,17 +323,10 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
- if (has_gpu_copy) {
- /* This can be NULL, but the driver prepareAccess call should
- * take care of that. */
+ if (has_gpu_copy && pExaPixmap->fb_ptr)
pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr;
- pPixmap->devKind = pExaPixmap->fb_pitch;
- } else {
- /* For mixed pixmaps this can be NULL, but that will be fixed
- * later in exaPrepareAccessReg_mixed(). */
+ else
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
- pPixmap->devKind = pExaPixmap->sys_pitch;
- }
/* Store so we can handle repeated / nested calls. */
pExaScr->access[index].pixmap = pPixmap;
diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index ee32b21..a7fdf63 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -101,6 +101,7 @@ exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
if (pExaPixmap->pDamage && exaPixmapHasGpuCopy(pPixmap)) {
ExaScreenPriv(pPixmap->drawable.pScreen);
+ pPixmap->devKind = pExaPixmap->fb_pitch;
exaCopyDirtyToFb(pixmaps + i);
if (pExaScr->deferred_mixed_pixmap == pPixmap)
@@ -108,10 +109,6 @@ exaDoMigration_mixed(ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
}
pExaPixmap->use_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
- if (pExaPixmap->use_gpu_copy)
- pPixmap->devKind = pExaPixmap->fb_pitch;
- else
- pPixmap->devKind = pExaPixmap->sys_pitch;
}
}
@@ -186,14 +183,17 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
pixmaps[0].as_src = TRUE;
pixmaps[0].pReg = NULL;
}
+ pPixmap->devKind = pExaPixmap->fb_pitch;
exaCopyDirtyToSys(pixmaps);
}
if (as_dst)
exaPixmapDirty(pPixmap, 0, 0, pPixmap->drawable.width,
pPixmap->drawable.height);
- } else if (has_gpu_copy)
+ } else if (has_gpu_copy) {
+ pPixmap->devKind = pExaPixmap->fb_pitch;
exaCopyDirtyToSys(pixmaps);
+ }
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
pPixmap->devKind = pExaPixmap->sys_pitch;
@@ -222,6 +222,7 @@ void exaFinishAccess_mixed(PixmapPtr pPixmap, int index)
pExaScr->deferred_mixed_pixmap != pPixmap)
exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap);
pExaScr->deferred_mixed_pixmap = pPixmap;
+ pPixmap->devKind = pExaPixmap->fb_pitch;
} else
exaMoveInPixmap_mixed(pPixmap);
}
commit 98c8b752254a27ab1aaf881b36bfda0f74929d0a
Merge: 0e084d8... 91c1bd7...
Author: Keith Packard <keithp at keithp.com>
Date: Wed Dec 2 15:28:07 2009 -0800
Merge remote branch 'whot/master'
commit 91c1bd78f7240c92702828f8e5a6b6ce944b9e36
Author: Gaetan Nadon <memsize at videotron.ca>
Date: Sat Nov 28 21:32:47 2009 -0500
configure.ac: error while checking for XDMXCONFIG_DEP
Introduced in commit 9998105a387e0294054502331a56e1e020cd93e4
The replacement third parameters to PKG_CHECK_MODULES([DMXMODULES]
was not quoted.
Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
Tested-by: Julien Cristau <jcristau at debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
diff --git a/configure.ac b/configure.ac
index fcd8875..6cdef15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1881,11 +1881,15 @@ AM_CONDITIONAL(XQUARTZ_SPARKLE, [test "x$XQUARTZ_SPARKLE" != "xno"])
AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes])
dnl DMX DDX
-PKG_CHECK_MODULES([DMXMODULES],
- [xmuu $LIBXEXT x11 xrender xfixes xfont $LIBXI $DMXPROTO xau $XDMCP_MODULES],
- PKG_CHECK_MODULES([XDMXCONFIG_DEP], [xaw7 xmu xt xpm x11], [have_dmx=yes],
- [have_dmx=no]),
- [have_dmx=no])
+PKG_CHECK_MODULES(
+ [DMXMODULES],
+ [xmuu $LIBXEXT x11 xrender xfixes xfont $LIBXI $DMXPROTO xau $XDMCP_MODULES],
+ [PKG_CHECK_MODULES(
+ [XDMXCONFIG_DEP],
+ [xaw7 xmu xt xpm x11],
+ [have_dmx=yes],
+ [have_dmx=no])],
+ [have_dmx=no])
AC_MSG_CHECKING([whether to build Xdmx DDX])
if test "x$DMX" = xauto; then
DMX="$have_dmx"
commit 761ae22f880bd79550ccf93d321b8a28b3755956
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date: Tue Dec 1 14:38:19 2009 +1000
xfree86: tell users to disable AutoAddDevices, not AllowEmptyInput.
Technically, disabling AEI is the right suggestion. AEI off forces the
server to init the built-in defaults for input devices (or pick the first
one from the config file). At the same time, hotplugging is still available
with AEI off.
Unfortunatly, in the vast majority of cases users want to simply disable
hotplugging or have a working server while the local HAL configuration is
broken or missing. Disabling AEI will lead to duplicate events, triple
keystrokes, etc. once the configuration works again.
It's not actually required to remove AEI once hotplugging works again,
though it will in many cases lead to a setup that appears broken.
Asking users to disable AutoAddDevices instead means those users disable
hotplugging, can then fix the HAL setup and they _must_ remove the config
line again to test if hotplugging works again. Which doesn't leave them with
a broken config once everything is working nice and dandy. Less bugreports,
everybody wins.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
Acked-by: Dan Nicholson <dbn.lists at gmail.com>
Acked-by: Daniel Stone <daniel at fooishbar.org>
Acked-by: Rémi Cardona <remi at gentoo.org>
Acked-by: James Cloos <cloos at jhcloos.com>
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 40f65bd..e1283f9 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1456,7 +1456,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
#ifdef CONFIG_HAL
xf86Msg(X_INFO, "The server relies on HAL to provide the list of "
"input devices.\n\tIf no devices become available, "
- "reconfigure HAL or disable AllowEmptyInput.\n");
+ "reconfigure HAL or disable AutoAddDevices.\n");
#else
xf86Msg(X_INFO, "HAL is disabled and no input devices were configured.\n"
"\tTry disabling AllowEmptyInput.\n");
commit b584c224a888c9e7f92d7e49021f74232a727c7f
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date: Fri Oct 30 12:11:41 2009 +1000
Set the source and deviceid for key repeat events (#24785)
X.Org Bug 24785 <http://bugs.freedesktop.org/show_bug.cgi?id=24785>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
Acked-by: Adam Jackson <ajax at redhat.com>
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index 2fc7642..0d8e4eb 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -131,6 +131,8 @@ AccessXKeyboardEvent(DeviceIntPtr keybd,
event.time = GetTimeInMillis();
event.length = sizeof(DeviceEvent);
event.key_repeat = isRepeat;
+ event.sourceid = keybd->id;
+ event.deviceid = keybd->id;
if (xkbDebugFlags&0x8) {
DebugF("[xkb] AXKE: Key %d %s\n", keyCode,
commit 66bb8c6fbdfc0fc0d971aac4ec6f949bb9288c1b
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date: Fri Nov 27 16:20:13 2009 +1000
dix: remove core devices when shutting down. (#25028)
NewInputDeviceRequest (and RemoveDevice) have checks in place to not allow
removal of the VCP/VCK. When shutting down, they need to be cleaned up
nonetheless to free the memory associated.
X.Org Bug 25028 <http://bugs.freedesktop.org/show_bug.cgi?id=25028>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
Reviewed-by: Keith Packard <keithp at keithp.com>
diff --git a/dix/devices.c b/dix/devices.c
index bb7b23b..6329d28 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -907,6 +907,9 @@ CloseDownDevices(void)
DeleteInputDeviceRequest(dev);
}
+ CloseDevice(inputInfo.pointer);
+ CloseDevice(inputInfo.keyboard);
+
inputInfo.devices = NULL;
inputInfo.off_devices = NULL;
inputInfo.keyboard = NULL;
commit 83d90b90bcb71c89750f92a177361e53dd261414
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date: Fri Nov 27 16:08:44 2009 +1000
dix: remove some obsolete comment.
The "counterpart to biggest hack" included checking for the motion history
function - which is unified in 1.7. Hence the check (which is already
removed) would evaluate to true anyway, and this comment isn't needed.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
Reviewed-by: Keith Packard <keithp at keithp.com>
diff --git a/dix/devices.c b/dix/devices.c
index 3634eec..bb7b23b 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -686,7 +686,6 @@ FreeDeviceClass(int type, pointer *class)
{
ValuatorClassPtr *v = (ValuatorClassPtr*)class;
- /* Counterpart to 'biggest hack ever' in init. */
if ((*v)->motion)
xfree((*v)->motion);
xfree((*v));
commit c20c8897272427cb3f755a3e28e80a9ad46f08a1
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date: Fri Nov 27 16:01:53 2009 +1000
dix: fix memory leak, free event list on shutdown. (#25028)
X.Org Bug 25028 <http://bugs.freedesktop.org/show_bug.cgi?id=25028>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
Reviewed-by: Keith Packard <keithp at keithp.com>
diff --git a/dix/events.c b/dix/events.c
index 015c2b1..7e0867c 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -5080,12 +5080,9 @@ InitEvents(void)
void
CloseDownEvents(void)
{
- int len;
- EventListPtr list;
-
- len = GetEventList(&list);
- while(len--)
- xfree(list[len].event);
+ FreeEventList(InputEventList, InputEventListLen);
+ InputEventListLen = 0;
+ InputEventList = NULL;
}
/**
commit 0e084d8c71e697a5cf5d5d7c749455ae14bd6eb7
Author: Luc Verhaegen <libv at skynet.be>
Date: Wed Nov 11 15:59:27 2009 +0100
Xv: Fix AdjustFrame when driver implements ReputImage.
Should probably also be applied to stabler xserver branches too.
Luc Verhaegen.
From a22bc20721bad506d8fa9772b1258568cbffe7d2 Mon Sep 17 00:00:00 2001
From: Luc Verhaegen <libv at skynet.be>
Date: Wed, 11 Nov 2009 15:52:39 +0100
Subject: [PATCH] Xv: Fix AdjustFrame when driver implements ReputImage.
Finally fixes fd.o #4653, filed more than 4 years ago.
Patch can be happily applied to all modular Xorg versions.
Signed-off-by: Luc Verhaegen <libv at skynet.be>
Reviewed-by: Keith Packard <keithp at keithp.com>
Signed-off-by: Keith Packard <keithp at keithp.com>
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index abbe033..8221659 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1297,7 +1297,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags)
for(i = pa->nPorts; i > 0; i--, pPort++) {
pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
- if(!pPriv->type && (pPriv->isOn == XV_ON)) { /* overlaid still/image */
+ if(!pPriv->type && (pPriv->isOn != XV_OFF)) { /* overlaid still/image */
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
REGION_DESTROY(pScreen, pPriv->pCompositeClip);
@@ -1311,7 +1311,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags)
(pWin->visibility == VisibilityPartiallyObscured)))
{
xf86XVReputImage(pPriv);
- } else {
+ } else if (pPriv->isOn == XV_ON) {
(*pPriv->AdaptorRec->StopVideo)(
pPriv->pScrn, pPriv->DevPriv.ptr, FALSE);
xf86XVRemovePortFromWindow(pWin, pPriv);
commit f4fc3406720410e37a2bce1b782cba0f0b734e42
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Mon Nov 30 11:03:59 2009 -0800
XQuartz: Drop calls to alloca
This makes us more consistent with the rest of the codebase, using xalloc/xfree
Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
Signed-off-by: Keith Packard <keithp at keithp.com>
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
index af1c59e..c8686e7 100644
--- a/hw/xquartz/mach-startup/stub.c
+++ b/hw/xquartz/mach-startup/stub.c
@@ -306,12 +306,12 @@ int main(int argc, char **argv, char **envp) {
/* We have fixed-size string lengths due to limitations in IPC,
* so we need to copy our argv and envp.
*/
- newargv = (string_array_t)alloca(argc * sizeof(string_t));
- newenvp = (string_array_t)alloca(envpc * sizeof(string_t));
-
+ newargv = (string_array_t)malloc(argc * sizeof(string_t));
+ newenvp = (string_array_t)malloc(envpc * sizeof(string_t));
+
if(!newargv || !newenvp) {
fprintf(stderr, "Xquartz: Memory allocation failure\n");
- exit(EXIT_FAILURE);
+ return EXIT_FAILURE;
}
for(i=0; i < argc; i++) {
@@ -322,6 +322,10 @@ int main(int argc, char **argv, char **envp) {
}
kr = start_x11_server(mp, newargv, argc, newenvp, envpc);
+
+ free(newargv);
+ free(newenvp);
+
if (kr != KERN_SUCCESS) {
fprintf(stderr, "Xquartz: start_x11_server: %s\n", mach_error_string(kr));
return EXIT_FAILURE;
diff --git a/hw/xquartz/xpr/x-hook.c b/hw/xquartz/xpr/x-hook.c
index bb873bb..03e7f85 100644
--- a/hw/xquartz/xpr/x-hook.c
+++ b/hw/xquartz/xpr/x-hook.c
@@ -34,6 +34,7 @@
#include "x-hook.h"
#include <stdlib.h>
#include <assert.h>
+#include "os.h"
#define CELL_NEW(f,d) X_PFX (list_prepend) ((x_list *) (f), (d))
#define CELL_FREE(c) X_PFX (list_free_1) (c)
@@ -79,9 +80,13 @@ X_PFX (hook_run) (x_list *lst, void *arg)
int length, i;
length = X_PFX (list_length) (lst);
- fun = alloca (sizeof (x_hook_function *) * length);
- data = alloca (sizeof (void *) * length);
+ fun = xalloc (sizeof (x_hook_function *) * length);
+ data = xalloc (sizeof (void *) * length);
+ if(!fun || !data) {
+ FatalError("Failed to allocate memory in %s\n", __func__);
+ }
+
for (i = 0, node = lst; node != NULL; node = node->next, i++)
{
cell = node->data;
@@ -93,6 +98,9 @@ X_PFX (hook_run) (x_list *lst, void *arg)
{
(*fun[i]) (arg, data[i]);
}
+
+ xfree(fun);
+ xfree(data);
}
X_EXTERN void
diff --git a/hw/xquartz/xpr/xprCursor.c b/hw/xquartz/xpr/xprCursor.c
index b577fc0..fbaf825 100644
--- a/hw/xquartz/xpr/xprCursor.c
+++ b/hw/xquartz/xpr/xprCursor.c
@@ -95,7 +95,10 @@ load_cursor(CursorPtr src, int screen)
const uint32_t *be_data=(uint32_t *) src->bits->argb;
unsigned i;
rowbytes = src->bits->width * sizeof (CARD32);
- data=alloca (rowbytes * src->bits->height);
+ data = xalloc(rowbytes * src->bits->height);
+ if(!data) {
+ FatalError("Failed to allocate memory in %s\n", __func__);
+ }
for(i=0;i<(src->bits->width*src->bits->height);i++)
data[i]=ntohl(be_data[i]);
#endif
@@ -118,8 +121,11 @@ load_cursor(CursorPtr src, int screen)
/* round up to 8 pixel boundary so we can convert whole bytes */
rowbytes = ((src->bits->width * 4) + 31) & ~31;
- data = alloca(rowbytes * src->bits->height);
-
+ data = xalloc(rowbytes * src->bits->height);
+ if(!data) {
+ FatalError("Failed to allocate memory in %s\n", __func__);
+ }
+
if (!src->bits->emptyMask)
{
ycount = src->bits->height;
@@ -168,6 +174,7 @@ load_cursor(CursorPtr src, int screen)
}
err = xp_set_cursor(width, height, hot_x, hot_y, data, rowbytes);
+ xfree(data);
return err == Success;
}
More information about the Xquartz-changes
mailing list