xserver-multidpi/mi/midispcur.c

928 lines
25 KiB
C
Raw Normal View History

2003-11-14 16:54:54 +01:00
/*
* midispcur.c
*
* machine independent cursor display routines
*/
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
# include <X11/X.h>
2003-11-14 16:54:54 +01:00
# include "misc.h"
# include "input.h"
# include "cursorstr.h"
# include "windowstr.h"
# include "regionstr.h"
# include "dixstruct.h"
# include "scrnintstr.h"
# include "servermd.h"
# include "mipointer.h"
# include "misprite.h"
# include "gcstruct.h"
2003-11-14 17:49:22 +01:00
#ifdef ARGB_CURSOR
# include "picturestr.h"
#endif
2003-11-14 16:54:54 +01:00
# include "inputstr.h"
2003-11-14 16:54:54 +01:00
/* per-screen private data */
static int miDCScreenKeyIndex;
static DevPrivateKey miDCScreenKey = &miDCScreenKeyIndex;
2003-11-14 16:54:54 +01:00
2003-11-14 17:49:22 +01:00
static Bool miDCCloseScreen(int index, ScreenPtr pScreen);
2003-11-14 16:54:54 +01:00
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
/* per device private data */
static int miDCSpriteKeyIndex;
static DevPrivateKey miDCSpriteKey = &miDCSpriteKeyIndex;
2003-11-14 16:54:54 +01:00
typedef struct {
GCPtr pSourceGC, pMaskGC;
GCPtr pSaveGC, pRestoreGC;
GCPtr pMoveGC;
GCPtr pPixSourceGC, pPixMaskGC;
PixmapPtr pSave, pTemp;
2003-11-14 17:49:22 +01:00
#ifdef ARGB_CURSOR
PicturePtr pRootPicture;
PicturePtr pTempPicture;
#endif
} miDCBufferRec, *miDCBufferPtr;
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
#define MIDCBUFFER(dev) \
((DevHasCursor(dev)) ? \
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
(miDCBufferPtr)dixLookupPrivate(&dev->devPrivates, miDCSpriteKey) : \
(miDCBufferPtr)dixLookupPrivate(&dev->u.master->devPrivates, miDCSpriteKey))
/*
* The core pointer buffer will point to the index of the virtual core pointer
* in the pCursorBuffers array.
*/
typedef struct {
CloseScreenProcPtr CloseScreen;
2003-11-14 16:54:54 +01:00
} miDCScreenRec, *miDCScreenPtr;
/* per-cursor per-screen private data */
typedef struct {
PixmapPtr sourceBits; /* source bits */
PixmapPtr maskBits; /* mask bits */
2003-11-14 17:49:22 +01:00
#ifdef ARGB_CURSOR
PicturePtr pPicture;
#endif
2003-11-14 16:54:54 +01:00
} miDCCursorRec, *miDCCursorPtr;
/*
* sprite/cursor method table
*/
2003-11-14 17:49:22 +01:00
static Bool miDCRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
static Bool miDCUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
static Bool miDCPutUpCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
CursorPtr pCursor, int x, int y,
unsigned long source, unsigned long mask);
static Bool miDCSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y,
2003-11-14 17:49:22 +01:00
int w, int h);
static Bool miDCRestoreUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y,
2003-11-14 17:49:22 +01:00
int w, int h);
static Bool miDCMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
CursorPtr pCursor, int x, int y,
int w, int h, int dx, int dy,
2003-11-14 17:49:22 +01:00
unsigned long source, unsigned long mask);
static Bool miDCChangeSave(DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y, int w, int h,
int dx, int dy);
2003-11-14 16:54:54 +01:00
static Bool miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen);
static void miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);
2003-11-14 16:54:54 +01:00
static miSpriteCursorFuncRec miDCFuncs = {
miDCRealizeCursor,
miDCUnrealizeCursor,
miDCPutUpCursor,
miDCSaveUnderCursor,
miDCRestoreUnderCursor,
miDCMoveCursor,
miDCChangeSave,
miDCDeviceInitialize,
miDCDeviceCleanup
2003-11-14 16:54:54 +01:00
};
Bool
2008-05-28 04:57:07 +02:00
miDCInitialize (ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
2003-11-14 16:54:54 +01:00
{
miDCScreenPtr pScreenPriv;
pScreenPriv = xalloc (sizeof (miDCScreenRec));
2003-11-14 16:54:54 +01:00
if (!pScreenPriv)
return FALSE;
pScreenPriv->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = miDCCloseScreen;
dixSetPrivate(&pScreen->devPrivates, miDCScreenKey, pScreenPriv);
2003-11-14 16:54:54 +01:00
if (!miSpriteInitialize (pScreen, &miDCFuncs, screenFuncs))
{
xfree ((pointer) pScreenPriv);
return FALSE;
}
return TRUE;
}
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
#define tossGC(gc) (gc ? FreeGC (gc, (GContext) 0) : 0)
#define tossPix(pix) (pix ? (*pScreen->DestroyPixmap) (pix) : TRUE)
#define tossPict(pict) (pict ? FreePicture (pict, 0) : 0)
2003-11-14 16:54:54 +01:00
static Bool
2008-05-28 04:57:07 +02:00
miDCCloseScreen (int index, ScreenPtr pScreen)
2003-11-14 16:54:54 +01:00
{
miDCScreenPtr pScreenPriv;
pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
miDCScreenKey);
2003-11-14 16:54:54 +01:00
pScreen->CloseScreen = pScreenPriv->CloseScreen;
xfree ((pointer) pScreenPriv);
return (*pScreen->CloseScreen) (index, pScreen);
}
static Bool
2008-05-28 04:57:07 +02:00
miDCRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
2003-11-14 16:54:54 +01:00
{
if (pCursor->bits->refcnt <= 1)
dixSetPrivate(&pCursor->bits->devPrivates, CursorScreenKey(pScreen), NULL);
2003-11-14 16:54:54 +01:00
return TRUE;
}
2003-11-14 17:49:22 +01:00
#ifdef ARGB_CURSOR
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
#define EnsurePicture(picture,draw,win) (picture || miDCMakePicture(&picture,draw,win))
2003-11-14 17:49:22 +01:00
static VisualPtr
miDCGetWindowVisual (WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
VisualID vid = wVisual (pWin);
int i;
for (i = 0; i < pScreen->numVisuals; i++)
if (pScreen->visuals[i].vid == vid)
return &pScreen->visuals[i];
return 0;
}
static PicturePtr
miDCMakePicture (PicturePtr *ppPicture, DrawablePtr pDraw, WindowPtr pWin)
{
ScreenPtr pScreen = pDraw->pScreen;
VisualPtr pVisual;
PictFormatPtr pFormat;
XID subwindow_mode = IncludeInferiors;
PicturePtr pPicture;
int error;
pVisual = miDCGetWindowVisual (pWin);
if (!pVisual)
return 0;
pFormat = PictureMatchVisual (pScreen, pDraw->depth, pVisual);
if (!pFormat)
return 0;
pPicture = CreatePicture (0, pDraw, pFormat,
CPSubwindowMode, &subwindow_mode,
serverClient, &error);
*ppPicture = pPicture;
return pPicture;
}
#endif
2003-11-14 16:54:54 +01:00
static miDCCursorPtr
2008-05-28 04:57:07 +02:00
miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
2003-11-14 16:54:54 +01:00
{
miDCCursorPtr pPriv;
GCPtr pGC;
XID gcvals[3];
pPriv = xalloc (sizeof (miDCCursorRec));
2003-11-14 16:54:54 +01:00
if (!pPriv)
return NULL;
2003-11-14 17:49:22 +01:00
#ifdef ARGB_CURSOR
if (pCursor->bits->argb)
{
PixmapPtr pPixmap;
PictFormatPtr pFormat;
int error;
pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8);
if (!pFormat)
{
xfree ((pointer) pPriv);
return NULL;
2003-11-14 17:49:22 +01:00
}
pPriv->sourceBits = 0;
pPriv->maskBits = 0;
pPixmap = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width,
pCursor->bits->height, 32,
CREATE_PIXMAP_USAGE_SCRATCH);
2003-11-14 17:49:22 +01:00
if (!pPixmap)
{
xfree ((pointer) pPriv);
return NULL;
2003-11-14 17:49:22 +01:00
}
pGC = GetScratchGC (32, pScreen);
if (!pGC)
{
(*pScreen->DestroyPixmap) (pPixmap);
xfree ((pointer) pPriv);
return NULL;
2003-11-14 17:49:22 +01:00
}
ValidateGC (&pPixmap->drawable, pGC);
(*pGC->ops->PutImage) (&pPixmap->drawable, pGC, 32,
0, 0, pCursor->bits->width,
pCursor->bits->height,
0, ZPixmap, (char *) pCursor->bits->argb);
FreeScratchGC (pGC);
pPriv->pPicture = CreatePicture (0, &pPixmap->drawable,
pFormat, 0, 0, serverClient, &error);
(*pScreen->DestroyPixmap) (pPixmap);
if (!pPriv->pPicture)
{
xfree ((pointer) pPriv);
return NULL;
2003-11-14 17:49:22 +01:00
}
dixSetPrivate(&pCursor->bits->devPrivates, CursorScreenKey(pScreen), pPriv);
2003-11-14 17:49:22 +01:00
return pPriv;
}
pPriv->pPicture = 0;
#endif
pPriv->sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1, 0);
2003-11-14 16:54:54 +01:00
if (!pPriv->sourceBits)
{
xfree ((pointer) pPriv);
return NULL;
2003-11-14 16:54:54 +01:00
}
pPriv->maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1, 0);
2003-11-14 16:54:54 +01:00
if (!pPriv->maskBits)
{
(*pScreen->DestroyPixmap) (pPriv->sourceBits);
xfree ((pointer) pPriv);
return NULL;
2003-11-14 16:54:54 +01:00
}
dixSetPrivate(&pCursor->bits->devPrivates, CursorScreenKey(pScreen), pPriv);
2003-11-14 16:54:54 +01:00
/* create the two sets of bits, clipping as appropriate */
pGC = GetScratchGC (1, pScreen);
if (!pGC)
{
(void) miDCUnrealizeCursor (pScreen, pCursor);
return NULL;
2003-11-14 16:54:54 +01:00
}
ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC);
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
0, 0, pCursor->bits->width, pCursor->bits->height,
0, XYPixmap, (char *)pCursor->bits->source);
gcvals[0] = GXand;
ChangeGC (pGC, GCFunction, gcvals);
ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC);
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
0, 0, pCursor->bits->width, pCursor->bits->height,
0, XYPixmap, (char *)pCursor->bits->mask);
/* mask bits -- pCursor->mask & ~pCursor->source */
gcvals[0] = GXcopy;
ChangeGC (pGC, GCFunction, gcvals);
ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
0, 0, pCursor->bits->width, pCursor->bits->height,
0, XYPixmap, (char *)pCursor->bits->mask);
gcvals[0] = GXandInverted;
ChangeGC (pGC, GCFunction, gcvals);
ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
0, 0, pCursor->bits->width, pCursor->bits->height,
0, XYPixmap, (char *)pCursor->bits->source);
FreeScratchGC (pGC);
return pPriv;
}
static Bool
2008-05-28 04:57:07 +02:00
miDCUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
2003-11-14 16:54:54 +01:00
{
miDCCursorPtr pPriv;
pPriv = (miDCCursorPtr)dixLookupPrivate(&pCursor->bits->devPrivates,
CursorScreenKey(pScreen));
2003-11-14 16:54:54 +01:00
if (pPriv && (pCursor->bits->refcnt <= 1))
{
2003-11-14 17:49:22 +01:00
if (pPriv->sourceBits)
(*pScreen->DestroyPixmap) (pPriv->sourceBits);
if (pPriv->maskBits)
(*pScreen->DestroyPixmap) (pPriv->maskBits);
#ifdef ARGB_CURSOR
if (pPriv->pPicture)
FreePicture (pPriv->pPicture, 0);
#endif
2003-11-14 16:54:54 +01:00
xfree ((pointer) pPriv);
dixSetPrivate(&pCursor->bits->devPrivates, CursorScreenKey(pScreen), NULL);
2003-11-14 16:54:54 +01:00
}
return TRUE;
}
static void
2003-11-14 17:49:22 +01:00
miDCPutBits (
DrawablePtr pDrawable,
miDCCursorPtr pPriv,
GCPtr sourceGC,
GCPtr maskGC,
int x_org,
int y_org,
2003-11-14 17:49:22 +01:00
unsigned w,
unsigned h,
unsigned long source,
unsigned long mask)
2003-11-14 16:54:54 +01:00
{
XID gcvals[1];
int x, y;
2003-11-14 16:54:54 +01:00
if (sourceGC->fgPixel != source)
{
gcvals[0] = source;
DoChangeGC (sourceGC, GCForeground, gcvals, 0);
}
if (sourceGC->serialNumber != pDrawable->serialNumber)
ValidateGC (pDrawable, sourceGC);
if(sourceGC->miTranslate)
{
x = pDrawable->x + x_org;
y = pDrawable->y + y_org;
}
else
{
x = x_org;
y = y_org;
}
2003-11-14 16:54:54 +01:00
(*sourceGC->ops->PushPixels) (sourceGC, pPriv->sourceBits, pDrawable, w, h, x, y);
if (maskGC->fgPixel != mask)
{
gcvals[0] = mask;
DoChangeGC (maskGC, GCForeground, gcvals, 0);
}
if (maskGC->serialNumber != pDrawable->serialNumber)
ValidateGC (pDrawable, maskGC);
if(maskGC->miTranslate)
{
x = pDrawable->x + x_org;
y = pDrawable->y + y_org;
}
else
{
x = x_org;
y = y_org;
}
2003-11-14 16:54:54 +01:00
(*maskGC->ops->PushPixels) (maskGC, pPriv->maskBits, pDrawable, w, h, x, y);
}
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
#define EnsureGC(gc,win) (gc || miDCMakeGC(&gc, win))
2003-11-14 16:54:54 +01:00
static GCPtr
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
miDCMakeGC(
GCPtr *ppGC,
WindowPtr pWin)
2003-11-14 16:54:54 +01:00
{
GCPtr pGC;
int status;
XID gcvals[2];
gcvals[0] = IncludeInferiors;
gcvals[1] = FALSE;
pGC = CreateGC((DrawablePtr)pWin,
GCSubwindowMode|GCGraphicsExposures, gcvals, &status,
(XID)0, serverClient);
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
*ppGC = pGC;
2003-11-14 16:54:54 +01:00
return pGC;
}
2003-11-14 17:49:22 +01:00
2003-11-14 16:54:54 +01:00
static Bool
2008-05-28 04:57:07 +02:00
miDCPutUpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
int x, int y, unsigned long source, unsigned long mask)
2003-11-14 16:54:54 +01:00
{
miDCScreenPtr pScreenPriv;
miDCCursorPtr pPriv;
miDCBufferPtr pBuffer;
2003-11-14 16:54:54 +01:00
WindowPtr pWin;
pPriv = (miDCCursorPtr)dixLookupPrivate(&pCursor->bits->devPrivates,
CursorScreenKey(pScreen));
2003-11-14 16:54:54 +01:00
if (!pPriv)
{
pPriv = miDCRealize(pScreen, pCursor);
if (!pPriv)
return FALSE;
}
pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
miDCScreenKey);
2003-11-14 16:54:54 +01:00
pWin = WindowTable[pScreen->myNum];
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
pBuffer = MIDCBUFFER(pDev);
2003-11-14 17:49:22 +01:00
#ifdef ARGB_CURSOR
if (pPriv->pPicture)
2003-11-14 16:54:54 +01:00
{
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
/* see comment in miDCPutUpCursor */
if (pBuffer->pRootPicture &&
pBuffer->pRootPicture->pDrawable &&
pBuffer->pRootPicture->pDrawable->pScreen != pScreen)
{
tossPict(pBuffer->pRootPicture);
pBuffer->pRootPicture = NULL;
}
if (!EnsurePicture(pBuffer->pRootPicture, &pWin->drawable, pWin))
return FALSE;
2003-11-14 17:49:22 +01:00
CompositePicture (PictOpOver,
pPriv->pPicture,
NULL,
pBuffer->pRootPicture,
2003-11-14 17:49:22 +01:00
0, 0, 0, 0,
x, y,
pCursor->bits->width,
pCursor->bits->height);
}
else
#endif
{
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
/**
* XXX: Before MPX, the sourceGC and maskGC were attached to the
* screen, and would switch as the screen switches. With mpx we have
* the GC's attached to the device now, so each time we switch screen
* we need to make sure the GC's are allocated on the new screen.
* This is ... not optimal. (whot)
*/
if (pBuffer->pSourceGC && pScreen != pBuffer->pSourceGC->pScreen)
{
tossGC(pBuffer->pSourceGC);
pBuffer->pSourceGC = NULL;
}
if (pBuffer->pMaskGC && pScreen != pBuffer->pMaskGC->pScreen)
{
tossGC(pBuffer->pMaskGC);
pBuffer->pMaskGC = NULL;
}
if (!EnsureGC(pBuffer->pSourceGC, pWin))
return FALSE;
if (!EnsureGC(pBuffer->pMaskGC, pWin))
{
FreeGC (pBuffer->pSourceGC, (GContext) 0);
pBuffer->pSourceGC = 0;
return FALSE;
}
2003-11-14 17:49:22 +01:00
miDCPutBits ((DrawablePtr)pWin, pPriv,
pBuffer->pSourceGC, pBuffer->pMaskGC,
2003-11-14 17:49:22 +01:00
x, y, pCursor->bits->width, pCursor->bits->height,
source, mask);
2003-11-14 16:54:54 +01:00
}
return TRUE;
}
static Bool
2008-05-28 04:57:07 +02:00
miDCSaveUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y, int w, int h)
2003-11-14 16:54:54 +01:00
{
miDCScreenPtr pScreenPriv;
miDCBufferPtr pBuffer;
2003-11-14 16:54:54 +01:00
PixmapPtr pSave;
WindowPtr pWin;
GCPtr pGC;
pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
miDCScreenKey);
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
pBuffer = MIDCBUFFER(pDev);
pSave = pBuffer->pSave;
2003-11-14 16:54:54 +01:00
pWin = WindowTable[pScreen->myNum];
if (!pSave || pSave->drawable.width < w || pSave->drawable.height < h)
{
if (pSave)
(*pScreen->DestroyPixmap) (pSave);
pBuffer->pSave = pSave =
(*pScreen->CreatePixmap) (pScreen, w, h, pScreen->rootDepth, 0);
2003-11-14 16:54:54 +01:00
if (!pSave)
return FALSE;
}
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
/* see comment in miDCPutUpCursor */
if (pBuffer->pSaveGC && pBuffer->pSaveGC->pScreen != pScreen)
{
tossGC(pBuffer->pSaveGC);
pBuffer->pSaveGC = NULL;
}
if (!EnsureGC(pBuffer->pSaveGC, pWin))
return FALSE;
pGC = pBuffer->pSaveGC;
2003-11-14 16:54:54 +01:00
if (pSave->drawable.serialNumber != pGC->serialNumber)
ValidateGC ((DrawablePtr) pSave, pGC);
(*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC,
x, y, w, h, 0, 0);
return TRUE;
}
static Bool
2008-05-28 04:57:07 +02:00
miDCRestoreUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y, int w, int h)
2003-11-14 16:54:54 +01:00
{
miDCScreenPtr pScreenPriv;
miDCBufferPtr pBuffer;
2003-11-14 16:54:54 +01:00
PixmapPtr pSave;
WindowPtr pWin;
GCPtr pGC;
pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
miDCScreenKey);
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
pBuffer = MIDCBUFFER(pDev);
pSave = pBuffer->pSave;
2003-11-14 16:54:54 +01:00
pWin = WindowTable[pScreen->myNum];
if (!pSave)
return FALSE;
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
/* see comment in miDCPutUpCursor */
if (pBuffer->pRestoreGC && pBuffer->pRestoreGC->pScreen != pScreen)
{
tossGC(pBuffer->pRestoreGC);
pBuffer->pRestoreGC = NULL;
}
if (!EnsureGC(pBuffer->pRestoreGC, pWin))
return FALSE;
pGC = pBuffer->pRestoreGC;
2003-11-14 16:54:54 +01:00
if (pWin->drawable.serialNumber != pGC->serialNumber)
ValidateGC ((DrawablePtr) pWin, pGC);
(*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC,
0, 0, w, h, x, y);
return TRUE;
}
static Bool
2008-05-28 04:57:07 +02:00
miDCChangeSave (DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y, int w, int h, int dx, int dy)
2003-11-14 16:54:54 +01:00
{
miDCScreenPtr pScreenPriv;
miDCBufferPtr pBuffer;
2003-11-14 16:54:54 +01:00
PixmapPtr pSave;
WindowPtr pWin;
GCPtr pGC;
int sourcex, sourcey, destx, desty, copyw, copyh;
pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
miDCScreenKey);
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
pBuffer = MIDCBUFFER(pDev);
pSave = pBuffer->pSave;
2003-11-14 16:54:54 +01:00
pWin = WindowTable[pScreen->myNum];
/*
* restore the bits which are about to get trashed
*/
if (!pSave)
return FALSE;
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
/* see comment in miDCPutUpCursor */
if (pBuffer->pRestoreGC && pBuffer->pRestoreGC->pScreen != pScreen)
{
tossGC(pBuffer->pRestoreGC);
pBuffer->pRestoreGC = NULL;
}
if (!EnsureGC(pBuffer->pRestoreGC, pWin))
return FALSE;
pGC = pBuffer->pRestoreGC;
2003-11-14 16:54:54 +01:00
if (pWin->drawable.serialNumber != pGC->serialNumber)
ValidateGC ((DrawablePtr) pWin, pGC);
/*
* copy the old bits to the screen.
*/
if (dy > 0)
{
(*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC,
0, h - dy, w, dy, x + dx, y + h);
}
else if (dy < 0)
{
(*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC,
0, 0, w, -dy, x + dx, y + dy);
}
if (dy >= 0)
{
desty = y + dy;
sourcey = 0;
copyh = h - dy;
}
else
{
desty = y;
sourcey = - dy;
copyh = h + dy;
}
if (dx > 0)
{
(*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC,
w - dx, sourcey, dx, copyh, x + w, desty);
}
else if (dx < 0)
{
(*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC,
0, sourcey, -dx, copyh, x + dx, desty);
}
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
/* see comment in miDCPutUpCursor */
if (pBuffer->pSaveGC && pBuffer->pSaveGC->pScreen != pScreen)
{
tossGC(pBuffer->pSaveGC);
pBuffer->pSaveGC = NULL;
}
if (!EnsureGC(pBuffer->pSaveGC, pWin))
return FALSE;
pGC = pBuffer->pSaveGC;
2003-11-14 16:54:54 +01:00
if (pSave->drawable.serialNumber != pGC->serialNumber)
ValidateGC ((DrawablePtr) pSave, pGC);
/*
* move the bits that are still valid within the pixmap
*/
if (dx >= 0)
{
sourcex = 0;
destx = dx;
copyw = w - dx;
}
else
{
destx = 0;
sourcex = - dx;
copyw = w + dx;
}
if (dy >= 0)
{
sourcey = 0;
desty = dy;
copyh = h - dy;
}
else
{
desty = 0;
sourcey = -dy;
copyh = h + dy;
}
(*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pSave, pGC,
sourcex, sourcey, copyw, copyh, destx, desty);
/*
* copy the new bits from the screen into the remaining areas of the
* pixmap
*/
if (dy > 0)
{
(*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC,
x, y, w, dy, 0, 0);
}
else if (dy < 0)
{
(*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC,
x, y + h + dy, w, -dy, 0, h + dy);
}
if (dy >= 0)
{
desty = dy;
sourcey = y + dy;
copyh = h - dy;
}
else
{
desty = 0;
sourcey = y;
copyh = h + dy;
}
if (dx > 0)
{
(*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC,
x, sourcey, dx, copyh, 0, desty);
}
else if (dx < 0)
{
(*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC,
x + w + dx, sourcey, -dx, copyh, w + dx, desty);
}
return TRUE;
}
static Bool
2008-05-28 04:57:07 +02:00
miDCMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
int x, int y, int w, int h, int dx, int dy,
unsigned long source, unsigned long mask)
2003-11-14 16:54:54 +01:00
{
miDCCursorPtr pPriv;
miDCScreenPtr pScreenPriv;
miDCBufferPtr pBuffer;
2003-11-14 16:54:54 +01:00
int status;
WindowPtr pWin;
GCPtr pGC;
XID gcval = FALSE;
PixmapPtr pTemp;
pPriv = (miDCCursorPtr)dixLookupPrivate(&pCursor->bits->devPrivates,
CursorScreenKey(pScreen));
2003-11-14 16:54:54 +01:00
if (!pPriv)
{
pPriv = miDCRealize(pScreen, pCursor);
if (!pPriv)
return FALSE;
}
pScreenPriv = (miDCScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
miDCScreenKey);
2003-11-14 16:54:54 +01:00
pWin = WindowTable[pScreen->myNum];
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
pBuffer = MIDCBUFFER(pDev);
pTemp = pBuffer->pTemp;
2003-11-14 16:54:54 +01:00
if (!pTemp ||
pTemp->drawable.width != pBuffer->pSave->drawable.width ||
pTemp->drawable.height != pBuffer->pSave->drawable.height)
2003-11-14 16:54:54 +01:00
{
if (pTemp)
(*pScreen->DestroyPixmap) (pTemp);
2003-11-14 17:49:22 +01:00
#ifdef ARGB_CURSOR
if (pBuffer->pTempPicture)
2003-11-14 17:49:22 +01:00
{
FreePicture (pBuffer->pTempPicture, 0);
pBuffer->pTempPicture = 0;
2003-11-14 17:49:22 +01:00
}
#endif
pBuffer->pTemp = pTemp = (*pScreen->CreatePixmap)
(pScreen, w, h, pBuffer->pSave->drawable.depth, 0);
2003-11-14 16:54:54 +01:00
if (!pTemp)
return FALSE;
}
if (!pBuffer->pMoveGC)
2003-11-14 16:54:54 +01:00
{
pBuffer->pMoveGC = CreateGC ((DrawablePtr)pTemp,
GCGraphicsExposures, &gcval, &status, (XID)0, serverClient);
if (!pBuffer->pMoveGC)
2003-11-14 16:54:54 +01:00
return FALSE;
}
/*
* copy the saved area to a temporary pixmap
*/
pGC = pBuffer->pMoveGC;
2003-11-14 16:54:54 +01:00
if (pGC->serialNumber != pTemp->drawable.serialNumber)
ValidateGC ((DrawablePtr) pTemp, pGC);
(*pGC->ops->CopyArea)((DrawablePtr)pBuffer->pSave,
2003-11-14 16:54:54 +01:00
(DrawablePtr)pTemp, pGC, 0, 0, w, h, 0, 0);
/*
* draw the cursor in the temporary pixmap
*/
2003-11-14 17:49:22 +01:00
#ifdef ARGB_CURSOR
if (pPriv->pPicture)
2003-11-14 16:54:54 +01:00
{
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
/* see comment in miDCPutUpCursor */
if (pBuffer->pTempPicture &&
pBuffer->pTempPicture->pDrawable &&
pBuffer->pTempPicture->pDrawable->pScreen != pScreen)
{
tossPict(pBuffer->pTempPicture);
pBuffer->pTempPicture = NULL;
}
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
if (!EnsurePicture(pBuffer->pTempPicture, &pTemp->drawable, pWin))
return FALSE;
2003-11-14 17:49:22 +01:00
CompositePicture (PictOpOver,
pPriv->pPicture,
NULL,
pBuffer->pTempPicture,
2003-11-14 17:49:22 +01:00
0, 0, 0, 0,
dx, dy,
pCursor->bits->width,
pCursor->bits->height);
2003-11-14 16:54:54 +01:00
}
2003-11-14 17:49:22 +01:00
else
#endif
2003-11-14 16:54:54 +01:00
{
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
if (!pBuffer->pPixSourceGC)
{
pBuffer->pPixSourceGC = CreateGC ((DrawablePtr)pTemp,
GCGraphicsExposures, &gcval, &status, (XID)0, serverClient);
if (!pBuffer->pPixSourceGC)
return FALSE;
}
if (!pBuffer->pPixMaskGC)
{
pBuffer->pPixMaskGC = CreateGC ((DrawablePtr)pTemp,
GCGraphicsExposures, &gcval, &status, (XID)0, serverClient);
if (!pBuffer->pPixMaskGC)
return FALSE;
}
2003-11-14 17:49:22 +01:00
miDCPutBits ((DrawablePtr)pTemp, pPriv,
pBuffer->pPixSourceGC, pBuffer->pPixMaskGC,
2003-11-14 17:49:22 +01:00
dx, dy, pCursor->bits->width, pCursor->bits->height,
source, mask);
2003-11-14 16:54:54 +01:00
}
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
/* see comment in miDCPutUpCursor */
if (pBuffer->pRestoreGC && pBuffer->pRestoreGC->pScreen != pScreen)
{
tossGC(pBuffer->pRestoreGC);
pBuffer->pRestoreGC = NULL;
}
/*
* copy the temporary pixmap onto the screen
*/
if (!EnsureGC(pBuffer->pRestoreGC, pWin))
return FALSE;
pGC = pBuffer->pRestoreGC;
2003-11-14 16:54:54 +01:00
if (pWin->drawable.serialNumber != pGC->serialNumber)
ValidateGC ((DrawablePtr) pWin, pGC);
(*pGC->ops->CopyArea) ((DrawablePtr) pTemp, (DrawablePtr) pWin,
pGC,
0, 0, w, h, x, y);
return TRUE;
}
static Bool
2008-05-28 04:57:07 +02:00
miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
{
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
miDCBufferPtr pBuffer;
pBuffer = xalloc(sizeof(miDCBufferRec));
dixSetPrivate(&pDev->devPrivates, miDCSpriteKey, pBuffer);
pBuffer->pSourceGC =
pBuffer->pMaskGC =
pBuffer->pSaveGC =
pBuffer->pRestoreGC =
pBuffer->pMoveGC =
pBuffer->pPixSourceGC =
pBuffer->pPixMaskGC = NULL;
#ifdef ARGB_CURSOR
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
pBuffer->pRootPicture = NULL;
pBuffer->pTempPicture = NULL;
#endif
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
pBuffer->pSave = pBuffer->pTemp = NULL;
return TRUE;
}
static void
2008-05-28 04:57:07 +02:00
miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
{
miDCBufferPtr pBuffer;
if (DevHasCursor(pDev))
{
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
pBuffer = MIDCBUFFER(pDev);
tossGC (pBuffer->pSourceGC);
tossGC (pBuffer->pMaskGC);
tossGC (pBuffer->pSaveGC);
tossGC (pBuffer->pRestoreGC);
tossGC (pBuffer->pMoveGC);
tossGC (pBuffer->pPixSourceGC);
tossGC (pBuffer->pPixMaskGC);
tossPix (pBuffer->pSave);
tossPix (pBuffer->pTemp);
#ifdef ARGB_CURSOR
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
#if 0 /* This has been free()d before */
tossPict (pScreenPriv->pRootPicture);
#endif
tossPict (pBuffer->pTempPicture);
#endif
Revert "mi: don't thrash resources when displaying the software cursor across screens" This commit leads to a segfault on the very first XTS test case. Backtrace: 0: /opt/xorg/bin/Xorg (xorg_backtrace+0x3b) [0x80a33db] 1: /opt/xorg/bin/Xorg (0x8048000+0x62a75) [0x80aaa75] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x5d140c] 3: /lib/libc.so.6 (0x9bb000+0x73579) [0xa2e579] 4: /lib/libc.so.6 (realloc+0xe0) [0xa2e830] 5: /opt/xorg/bin/Xorg (Xrealloc+0x33) [0x80a3f33] 6: /opt/xorg/bin/Xorg (0x8048000+0x1ab79) [0x8062b79] 7: /opt/xorg/bin/Xorg (0x8048000+0x1ac4e) [0x8062c4e] 8: /opt/xorg/bin/Xorg (RegisterExtensionNames+0x2ce) [0x8062fbe] 9: /opt/xorg/bin/Xorg (AddExtension+0x19a) [0x807bd7a] 10: /opt/xorg//lib/xorg/modules/extensions/libextmod.so (0x728000+0x1169a) [0x73969a] 11: /opt/xorg/bin/Xorg (InitExtensions+0x85) [0x80c0eb5] 12: /opt/xorg/bin/Xorg (0x8048000+0x1a51d) [0x806251d] 13: /lib/libc.so.6 (__libc_start_main+0xe6) [0x9d1bb6] 14: /opt/xorg/bin/Xorg (0x8048000+0x1a2a1) [0x80622a1] Segmentation fault at address 0x10b2d5f8 valgrind output: ==5069== Invalid read of size 4 ==5069== at 0x80F928D: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) ==5069== ==5069== Invalid write of size 4 ==5069== at 0x80F9295: FreePicture (picture.c:1531) ==5069== by 0x818DDEF: miDCDeviceCleanup (midispcur.c:867) ==5069== by 0x81B97F0: miSpriteDeviceCursorCleanup (misprite.c:968) ==5069== by 0x80995FA: miPointerDeviceCleanup (mipointer.c:292) ==5069== by 0x807973E: CloseDevice (devices.c:840) ==5069== by 0x80799B6: CloseDownDevices (devices.c:933) ==5069== by 0x8062705: main (main.c:309) ==5069== Address 0x4cce844 is 12 bytes inside a block of size 84 free'd ==5069== at 0x40057F6: free (vg_replace_malloc.c:325) ==5069== by 0x80A3DE0: Xfree (utils.c:1154) ==5069== by 0x80F9332: FreePicture (picture.c:1576) ==5069== by 0x80FBB4B: PictureDestroyWindow (picture.c:69) ==5069== by 0x810B1A3: damageDestroyWindow (damage.c:1840) ==5069== by 0x80864F1: FreeWindowResources (window.c:846) ==5069== by 0x8086812: DeleteWindow (window.c:925) ==5069== by 0x806B53E: FreeClientResources (resource.c:806) ==5069== by 0x806B60F: FreeAllResources (resource.c:823) ==5069== by 0x80626E4: main (main.c:299) XTS test case: Xproto pAllocColor This reverts commit 00b8b7ad61b6f818271fb4d1e383113170309d72. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-21 03:47:24 +02:00
xfree(pBuffer);
dixSetPrivate(&pDev->devPrivates, miDCSpriteKey, NULL);
}
}