summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--composite/compwindow.c2
-rw-r--r--exa/exa_migration_mixed.c48
-rw-r--r--glx/glthread.c2
-rw-r--r--hw/dmx/examples/xinput.c2
-rw-r--r--hw/kdrive/src/kdrive.c2
-rw-r--r--hw/xfree86/common/xf86Init.c2
-rw-r--r--hw/xfree86/os-support/solaris/sun_bell.c5
-rw-r--r--hw/xfree86/parser/scan.c16
-rw-r--r--hw/xfree86/x86emu/validate.c2
-rw-r--r--hw/xfree86/x86emu/x86emu/prim_x86_gcc.h6
-rw-r--r--hw/xquartz/GL/capabilities.c2
-rw-r--r--include/os.h2
-rw-r--r--miext/damage/damage.c10
-rw-r--r--miext/rootless/rootlessWindow.c2
-rw-r--r--os/log.c4
-rw-r--r--os/utils.c12
16 files changed, 73 insertions, 46 deletions
diff --git a/composite/compwindow.c b/composite/compwindow.c
index c10cb9ee9..f2f6ea3cd 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -205,7 +205,7 @@ compPositionWindow (WindowPtr pWin, int x, int y)
#ifdef COMPOSITE_DEBUG
if ((pWin->redirectDraw != RedirectDrawNone) !=
(pWin->viewable && (GetCompWindow(pWin) != NULL)))
- abort ();
+ OsAbort ();
#endif
if (pWin->redirectDraw != RedirectDrawNone)
{
diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
index 6816e6c9b..fb4715135 100644
--- a/exa/exa_migration_mixed.c
+++ b/exa/exa_migration_mixed.c
@@ -165,9 +165,37 @@ void
exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
{
ExaPixmapPriv(pPixmap);
+ Bool has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
+ Bool success;
+
+ success = ExaDoPrepareAccess(pPixmap, index);
+
+ if (success && has_gpu_copy && pExaPixmap->pDamage) {
+ /* You cannot do accelerated operations while a buffer is mapped. */
+ exaFinishAccess(&pPixmap->drawable, index);
+ /* Update the gpu view of both deferred destination pixmaps and of
+ * source pixmaps that were migrated with a bounding region.
+ */
+ exaMoveInPixmap_mixed(pPixmap);
+ success = ExaDoPrepareAccess(pPixmap, index);
+
+ if (success) {
+ /* We have a gpu pixmap that can be accessed, we don't need the cpu
+ * copy anymore. Drivers that prefer DFS, should fail prepare
+ * access.
+ */
+ DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
+ DamageDestroy(pExaPixmap->pDamage);
+ pExaPixmap->pDamage = NULL;
+
+ free(pExaPixmap->sys_ptr);
+ pExaPixmap->sys_ptr = NULL;
+
+ return;
+ }
+ }
- if (!ExaDoPrepareAccess(pPixmap, index)) {
- Bool has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
+ if (!success) {
ExaMigrationRec pixmaps[1];
/* Do we need to allocate our system buffer? */
@@ -228,22 +256,6 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
pPixmap->devKind = pExaPixmap->sys_pitch;
pExaPixmap->use_gpu_copy = FALSE;
- /* We have a gpu pixmap that can be accessed, we don't need the cpu copy
- * anymore. Drivers that prefer DFS, should fail prepare access. */
- } else if (pExaPixmap->pDamage && exaPixmapHasGpuCopy(pPixmap)) {
- ExaScreenPriv(pPixmap->drawable.pScreen);
-
- /* Copy back any deferred content if needed. */
- if (pExaScr->deferred_mixed_pixmap &&
- pExaScr->deferred_mixed_pixmap == pPixmap)
- exaMoveInPixmap_mixed(pPixmap);
-
- DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
- DamageDestroy(pExaPixmap->pDamage);
- pExaPixmap->pDamage = NULL;
-
- free(pExaPixmap->sys_ptr);
- pExaPixmap->sys_ptr = NULL;
}
}
diff --git a/glx/glthread.c b/glx/glthread.c
index 4caaea110..8b9f61885 100644
--- a/glx/glthread.c
+++ b/glx/glthread.c
@@ -129,7 +129,7 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
_X_EXPORT unsigned long
_glthread_GetID(void)
{
- abort(); /* XXX not implemented yet */
+ OsAbort(); /* XXX not implemented yet */
return (unsigned long) 0;
}
diff --git a/hw/dmx/examples/xinput.c b/hw/dmx/examples/xinput.c
index 74353a93b..7421be337 100644
--- a/hw/dmx/examples/xinput.c
+++ b/hw/dmx/examples/xinput.c
@@ -233,7 +233,7 @@ int main(int argc, char **argv)
int total = 0;
#define ADD(type) \
- if (cnt >= MAX_EVENTS) abort(); \
+ if (cnt >= MAX_EVENTS) OsAbort(); \
names[cnt] = #type; \
type(dev, event_type[cnt], event_list[cnt]); \
if (event_type[cnt]) ++cnt
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 7675c1e86..1902ab885 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -335,7 +335,7 @@ AbortDDX(void)
}
if (kdCaughtSignal)
- abort();
+ OsAbort();
}
void
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 2c206ff47..72241a776 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1235,7 +1235,7 @@ ddxGiveUp(void)
/* If an unexpected signal was caught, dump a core for debugging */
if (xf86Info.caughtSignal)
- abort();
+ OsAbort();
}
diff --git a/hw/xfree86/os-support/solaris/sun_bell.c b/hw/xfree86/os-support/solaris/sun_bell.c
index 7f146eaaf..05d17492a 100644
--- a/hw/xfree86/os-support/solaris/sun_bell.c
+++ b/hw/xfree86/os-support/solaris/sun_bell.c
@@ -126,14 +126,15 @@ xf86OSRingBell(int loudness, int pitch, int duration)
iovcnt = 0;
for (cnt = 0; cnt <= repeats; cnt++) {
- iov[iovcnt].iov_base = (char *) samples;
- iov[iovcnt++].iov_len = sizeof(samples);
if (cnt == repeats) {
/* Insert a bit of silence so that multiple beeps are distinct and
* not compressed into a single tone.
*/
iov[iovcnt].iov_base = (char *) silence;
iov[iovcnt++].iov_len = sizeof(silence);
+ } else {
+ iov[iovcnt].iov_base = (char *) samples;
+ iov[iovcnt++].iov_len = sizeof(samples);
}
if ((iovcnt >= IOV_MAX) || (cnt == repeats)) {
written = writev(audioFD, iov, iovcnt);
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index 03cbc8a44..cdca9ca1c 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -1207,21 +1207,21 @@ xf86getBoolValue(Bool *val, const char *str)
if (*str == '\0') {
*val = TRUE;
} else {
- if (strcmp(str, "1") == 0)
+ if (xf86nameCompare(str, "1") == 0)
*val = TRUE;
- else if (strcmp(str, "on") == 0)
+ else if (xf86nameCompare(str, "on") == 0)
*val = TRUE;
- else if (strcmp(str, "true") == 0)
+ else if (xf86nameCompare(str, "true") == 0)
*val = TRUE;
- else if (strcmp(str, "yes") == 0)
+ else if (xf86nameCompare(str, "yes") == 0)
*val = TRUE;
- else if (strcmp(str, "0") == 0)
+ else if (xf86nameCompare(str, "0") == 0)
*val = FALSE;
- else if (strcmp(str, "off") == 0)
+ else if (xf86nameCompare(str, "off") == 0)
*val = FALSE;
- else if (strcmp(str, "false") == 0)
+ else if (xf86nameCompare(str, "false") == 0)
*val = FALSE;
- else if (strcmp(str, "no") == 0)
+ else if (xf86nameCompare(str, "no") == 0)
*val = FALSE;
else
return FALSE;
diff --git a/hw/xfree86/x86emu/validate.c b/hw/xfree86/x86emu/validate.c
index 239f6c1f3..b8c4d12d1 100644
--- a/hw/xfree86/x86emu/validate.c
+++ b/hw/xfree86/x86emu/validate.c
@@ -673,7 +673,7 @@ int main(int argc)
VAL_LONG_LONG_BINARY(cmp_long);
VAL_BYTE_UNARY(daa_byte);
- VAL_BYTE_UNARY(das_byte); // Fails for 0x9A (out of range anyway)
+ VAL_BYTE_UNARY(das_byte); /* Fails for 0x9A (out of range anyway) */
VAL_BYTE_UNARY(dec_byte);
VAL_WORD_UNARY(dec_word);
diff --git a/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h b/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h
index 5530a3ada..4c850a1bd 100644
--- a/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h
+++ b/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h
@@ -61,7 +61,7 @@ static inline void hw_cpuid (u32 *a, u32 *b, u32 *c, u32 *d)
: "cc");
}
-#else // ! (__PIC__ && __i386__)
+#else /* ! (__PIC__ && __i386__) */
#define x86EMU_HAS_HW_CPUID 1
static inline void hw_cpuid (u32 *a, u32 *b, u32 *c, u32 *d)
@@ -73,7 +73,7 @@ static inline void hw_cpuid (u32 *a, u32 *b, u32 *c, u32 *d)
: "cc");
}
-#endif // __PIC__ && __i386__
+#endif /* __PIC__ && __i386__ */
-#endif // __X86EMU_PRIM_X86_GCC_H
+#endif /* __X86EMU_PRIM_X86_GCC_H */
diff --git a/hw/xquartz/GL/capabilities.c b/hw/xquartz/GL/capabilities.c
index 43064044c..5f1f87013 100644
--- a/hw/xquartz/GL/capabilities.c
+++ b/hw/xquartz/GL/capabilities.c
@@ -522,7 +522,7 @@ bool getGlCapabilities(struct glCapabilities *cap) {
conf = malloc(sizeof(*conf));
if(NULL == conf) {
perror("malloc");
- abort();
+ OsAbort();
}
/* Copy the struct. */
diff --git a/include/os.h b/include/os.h
index dad1af787..453ab82c7 100644
--- a/include/os.h
+++ b/include/os.h
@@ -262,6 +262,8 @@ extern _X_EXPORT void OsBlockSignals (void);
extern _X_EXPORT void OsReleaseSignals (void);
+extern _X_EXPORT void OsAbort (void);
+
#if !defined(WIN32)
extern _X_EXPORT int System(char *);
extern _X_EXPORT pointer Popen(char *, char *);
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index b7ec92a5b..2851aed8d 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -1705,7 +1705,7 @@ damageRemoveDamage (DamagePtr *pPrev, DamagePtr pDamage)
}
#if DAMAGE_VALIDATE_ENABLE
ErrorF ("Damage not on list\n");
- abort ();
+ OsAbort ();
#endif
}
@@ -1718,7 +1718,7 @@ damageInsertDamage (DamagePtr *pPrev, DamagePtr pDamage)
for (pOld = *pPrev; pOld; pOld = pOld->pNext)
if (pOld == pDamage) {
ErrorF ("Damage already on list\n");
- abort ();
+ OsAbort ();
}
#endif
pDamage->pNext = *pPrev;
@@ -1971,7 +1971,7 @@ DamageRegister (DrawablePtr pDrawable,
if (pDrawable->pScreen != pDamage->pScreen)
{
ErrorF ("DamageRegister called with mismatched screens\n");
- abort ();
+ OsAbort ();
}
#endif
@@ -1986,7 +1986,7 @@ DamageRegister (DrawablePtr pDrawable,
for (pOld = *pPrev; pOld; pOld = pOld->pNextWin)
if (pOld == pDamage) {
ErrorF ("Damage already on window list\n");
- abort ();
+ OsAbort ();
}
#endif
pDamage->pNextWin = *pPrev;
@@ -2040,7 +2040,7 @@ DamageUnregister (DrawablePtr pDrawable,
#if DAMAGE_VALIDATE_ENABLE
if (!found) {
ErrorF ("Damage not on window list\n");
- abort ();
+ OsAbort ();
}
#endif
}
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 53209565d..e78e2c8f1 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -978,7 +978,7 @@ StartFrameResize(WindowPtr pWin, Bool gravity,
copy_rect.y2 = oldY2;
}
else
- abort();
+ OsAbort();
Bpp = winRec->win->drawable.bitsPerPixel / 8;
copy_rect_width = copy_rect.x2 - copy_rect.x1;
diff --git a/os/log.c b/os/log.c
index 03dc11ffe..0002e59f0 100644
--- a/os/log.c
+++ b/os/log.c
@@ -413,7 +413,7 @@ AbortServer(void)
AbortDDX();
fflush(stderr);
if (CoreDump)
- abort();
+ OsAbort();
exit (1);
}
@@ -537,7 +537,7 @@ FatalError(const char *f, ...)
beenhere = TRUE;
AbortServer();
} else
- abort();
+ OsAbort();
/*NOTREACHED*/
}
diff --git a/os/utils.c b/os/utils.c
index 79399fa53..21e25e066 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1310,6 +1310,18 @@ OsReleaseSignals (void)
#endif
}
+/*
+ * Pending signals may interfere with core dumping. Provide a
+ * mechanism to block signals when aborting.
+ */
+
+void
+OsAbort (void)
+{
+ OsBlockSignals();
+ abort();
+}
+
#if !defined(WIN32)
/*
* "safer" versions of system(3), popen(3) and pclose(3) which give up