aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-06-08 15:05:49 +0200
committermarha <marha@users.sourceforge.net>2014-06-08 15:05:49 +0200
commit71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec (patch)
treeea689cdd51f395980ddc37dc33781635976f3a16 /xorg-server
parentaec798fb4dc72d616732d0fa711faffaa8cd7590 (diff)
parent2acb86c9b086bdb9a3897db0b93820652e07cb59 (diff)
downloadvcxsrv-71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec.tar.gz
vcxsrv-71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec.tar.bz2
vcxsrv-71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec.zip
Merge remote-tracking branch 'origin/released'
Conflicts: apps/xwininfo/xwininfo.c xorg-server/hw/xwin/glx/indirect.c
Diffstat (limited to 'xorg-server')
-rw-r--r--xorg-server/Xi/exevents.c4
-rw-r--r--xorg-server/config/10-quirks.conf16
-rw-r--r--xorg-server/configure.ac8
-rw-r--r--xorg-server/dix/devices.c7
-rw-r--r--xorg-server/dix/events.c2
-rw-r--r--xorg-server/fb/fbscreen.c2
-rw-r--r--xorg-server/hw/xfree86/common/compiler.h5
-rw-r--r--xorg-server/hw/xfree86/common/xf86Config.c2
-rw-r--r--xorg-server/hw/xfree86/loader/loadmod.c6
-rw-r--r--xorg-server/hw/xfree86/os-support/linux/lnx_video.c3
-rw-r--r--xorg-server/hw/xfree86/xorgconf.cpp2
-rw-r--r--xorg-server/hw/xquartz/bundle/Info.plist.cpp4
-rw-r--r--xorg-server/hw/xquartz/darwin.c16
-rw-r--r--xorg-server/hw/xquartz/xpr/xprScreen.c16
-rwxr-xr-x[-rw-r--r--]xorg-server/hw/xwin/glx/indirect.c11
-rw-r--r--xorg-server/include/misc.h18
-rwxr-xr-xxorg-server/include/servermd.h14
-rw-r--r--xorg-server/include/xwin-config.h.in3
-rw-r--r--xorg-server/man/Xserver.man5
-rw-r--r--xorg-server/mi/mieq.c4
-rw-r--r--xorg-server/os/log.c65
-rw-r--r--xorg-server/present/present.c126
-rw-r--r--xorg-server/present/present_priv.h1
-rw-r--r--xorg-server/test/input.c14
-rw-r--r--xorg-server/xfixes/cursor.c2
25 files changed, 213 insertions, 143 deletions
diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c
index 5b50fd58e..551db92b4 100644
--- a/xorg-server/Xi/exevents.c
+++ b/xorg-server/Xi/exevents.c
@@ -663,6 +663,8 @@ void
DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to,
DeviceChangedEvent *dce)
{
+ OsBlockSIGIO();
+
/* generic feedback classes, not tied to pointer and/or keyboard */
DeepCopyFeedbackClasses(from, to);
@@ -670,6 +672,8 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to,
DeepCopyKeyboardClasses(from, to);
if ((dce->flags & DEVCHANGE_POINTER_EVENT))
DeepCopyPointerClasses(from, to);
+
+ OsReleaseSIGIO();
}
/**
diff --git a/xorg-server/config/10-quirks.conf b/xorg-server/config/10-quirks.conf
index c9b823ceb..47907d82d 100644
--- a/xorg-server/config/10-quirks.conf
+++ b/xorg-server/config/10-quirks.conf
@@ -19,22 +19,6 @@ Section "InputClass"
Option "IgnoreRelativeAxes" "off"
EndSection
-# https://bugzilla.redhat.com/show_bug.cgi?id=612140
-# please make Evoluent VerticalMouse 3 work out of the box
-# Button mapping on this mouse is quirky
-Section "InputClass"
- Identifier "Evoluent VerticalMouse 3"
- MatchProduct "Evoluent VerticalMouse 3"
- # Sets following configuration:
- # top button: left
- # middle button: middle
- # bottom button: right
- # wheel click: middle
- # thumb button: 8 (back)
- Option "ButtonMapping" "1 2 2 4 5 6 7 3 8"
-EndSection
-
-
# https://bugs.freedesktop.org/show_bug.cgi?id=55867
# Bug 55867 - Doesn't know how to tag XI_TRACKBALL
Section "InputClass"
diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac
index e5387bffd..0a6e77255 100644
--- a/xorg-server/configure.ac
+++ b/xorg-server/configure.ac
@@ -26,9 +26,9 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.15.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2014-04-08"
-RELEASE_NAME="Glacier Blue"
+AC_INIT([xorg-server], 1.15.99.903, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2014-06-04"
+RELEASE_NAME="Strawberry Shortcake"
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
@@ -2442,7 +2442,7 @@ AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes])
dnl Xwayland DDX
-PKG_CHECK_MODULES(XWAYLANDMODULES, [wayland-client libdrm epoxy], [have_xwayland=yes], [have_xwayland=no])
+PKG_CHECK_MODULES(XWAYLANDMODULES, [wayland-client >= 1.3.0 libdrm epoxy], [have_xwayland=yes], [have_xwayland=no])
AC_MSG_CHECKING([whether to build Xwayland DDX])
if test "x$XWAYLAND" = xauto; then
XWAYLAND="$have_xwayland"
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index 106d2dfc7..468b5a199 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -947,8 +947,9 @@ CloseDevice(DeviceIntPtr dev)
if (dev->inited)
(void) (*dev->deviceProc) (dev, DEVICE_CLOSE);
- /* free sprite memory */
- if (IsMaster(dev) && dev->spriteInfo->sprite)
+ FreeSprite(dev);
+
+ if (IsMaster(dev))
screen->DeviceCursorCleanup(dev, screen);
/* free acceleration info */
@@ -969,8 +970,6 @@ CloseDevice(DeviceIntPtr dev)
free(classes);
}
- FreeSprite(dev);
-
/* a client may have the device set as client pointer */
for (j = 0; j < currentMaxClients; j++) {
if (clients[j] && clients[j]->clientPtr == dev) {
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index d606e727c..e3f5e2372 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -3241,7 +3241,7 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin)
pCursor = RefCursor(pCursor);
if (pSprite->current)
FreeCursor(pSprite->current, None);
- pSprite->current = RefCursor(pCursor);
+ pSprite->current = pCursor;
if (pScreen) {
(*pScreen->RealizeCursor) (pDev, pScreen, pSprite->current);
diff --git a/xorg-server/fb/fbscreen.c b/xorg-server/fb/fbscreen.c
index b2b973974..1f9108945 100644
--- a/xorg-server/fb/fbscreen.c
+++ b/xorg-server/fb/fbscreen.c
@@ -37,7 +37,7 @@ fbCloseScreen(ScreenPtr pScreen)
free(depths[d].vids);
free(depths);
free(pScreen->visuals);
- free(pScreen->devPrivate);
+ FreePixmap((PixmapPtr)pScreen->devPrivate);
return TRUE;
}
diff --git a/xorg-server/hw/xfree86/common/compiler.h b/xorg-server/hw/xfree86/common/compiler.h
index 15e1ca234..a44afacde 100644
--- a/xorg-server/hw/xfree86/common/compiler.h
+++ b/xorg-server/hw/xfree86/common/compiler.h
@@ -1352,7 +1352,10 @@ stl_u(unsigned long val, unsigned int *p)
#else /* ix86 */
#if !defined(__SUNPRO_C)
-#if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__m32r__) && !defined(__aarch64__) && !defined(__arc__)
+#if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && \
+ !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && \
+ !defined(__m32r__) && !defined(__aarch64__) && !defined(__arc__) && \
+ !defined(__xtensa__)
#ifdef GCCUSESGAS
/*
diff --git a/xorg-server/hw/xfree86/common/xf86Config.c b/xorg-server/hw/xfree86/common/xf86Config.c
index 2adef44c3..481674de2 100644
--- a/xorg-server/hw/xfree86/common/xf86Config.c
+++ b/xorg-server/hw/xfree86/common/xf86Config.c
@@ -519,7 +519,7 @@ xf86InputDriverlistFromConfig(void)
static void
fixup_video_driver_list(const char **drivers)
{
- static const char *fallback[4] = { "fbdev", "vesa", "wsfb", NULL };
+ static const char *fallback[5] = { "modesetting", "fbdev", "vesa", "wsfb", NULL };
const char **end, **drv;
const char *x;
int i;
diff --git a/xorg-server/hw/xfree86/loader/loadmod.c b/xorg-server/hw/xfree86/loader/loadmod.c
index 092bf5735..e1f649a74 100644
--- a/xorg-server/hw/xfree86/loader/loadmod.c
+++ b/xorg-server/hw/xfree86/loader/loadmod.c
@@ -838,6 +838,12 @@ static const char *compiled_in_modules[] = {
"extmod",
"dri",
"dri2",
+#if DRI3
+ "dri3",
+#endif
+#if PRESENT
+ "present",
+#endif
NULL
};
diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_video.c b/xorg-server/hw/xfree86/os-support/linux/lnx_video.c
index 40765fccf..652f963a2 100644
--- a/xorg-server/hw/xfree86/os-support/linux/lnx_video.c
+++ b/xorg-server/hw/xfree86/os-support/linux/lnx_video.c
@@ -60,7 +60,8 @@ static Bool ExtendedEnabled = FALSE;
!defined(__nds32__) && \
!defined(__arm__) && \
!defined(__aarch64__) && \
- !defined(__arc__)
+ !defined(__arc__) && \
+ !defined(__xtensa__)
/*
* Due to conflicts with "compiler.h", don't rely on <sys/io.h> to declare
diff --git a/xorg-server/hw/xfree86/xorgconf.cpp b/xorg-server/hw/xfree86/xorgconf.cpp
index cd6d4a983..a903438b6 100644
--- a/xorg-server/hw/xfree86/xorgconf.cpp
+++ b/xorg-server/hw/xfree86/xorgconf.cpp
@@ -97,7 +97,7 @@ Section "ServerFlags"
# Uncomment this to disable the <Ctrl><Alt><BS> server abort sequence
# This allows clients to receive this key event.
-# Option "DontZap" "false"
+# Option "DontZap" "true"
# Uncomment this to disable the <Ctrl><Alt><KP_+>/<KP_-> mode switching
# sequences. This allows clients to receive these key events.
diff --git a/xorg-server/hw/xquartz/bundle/Info.plist.cpp b/xorg-server/hw/xquartz/bundle/Info.plist.cpp
index 5fbb0ad55..a0d9050ac 100644
--- a/xorg-server/hw/xquartz/bundle/Info.plist.cpp
+++ b/xorg-server/hw/xquartz/bundle/Info.plist.cpp
@@ -19,9 +19,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>2.7.6</string>
+ <string>2.7.7</string>
<key>CFBundleVersion</key>
- <string>2.7.6</string>
+ <string>2.7.7</string>
<key>CFBundleSignature</key>
<string>x11a</string>
<key>CSResourcesFileMapped</key>
diff --git a/xorg-server/hw/xquartz/darwin.c b/xorg-server/hw/xquartz/darwin.c
index e0983d6ef..29c6438a0 100644
--- a/xorg-server/hw/xquartz/darwin.c
+++ b/xorg-server/hw/xquartz/darwin.c
@@ -704,22 +704,6 @@ OsVendorInit(void)
free(lf);
DarwinPrintBanner();
-#ifdef ENABLE_DEBUG_LOG
- {
- char *home_dir = NULL, *log_file_path = NULL;
- home_dir = getenv("HOME");
- if (home_dir) asprintf(&log_file_path, "%s/%s", home_dir,
- DEBUG_LOG_NAME);
- if (log_file_path) {
- if (!access(log_file_path, F_OK)) {
- debug_log_fp = fopen(log_file_path, "a");
- if (debug_log_fp) ErrorF("Debug logging enabled to %s\n",
- log_file_path);
- }
- free(log_file_path);
- }
- }
-#endif
}
}
diff --git a/xorg-server/hw/xquartz/xpr/xprScreen.c b/xorg-server/hw/xquartz/xpr/xprScreen.c
index e37601995..7aa1ae1df 100644
--- a/xorg-server/hw/xquartz/xpr/xprScreen.c
+++ b/xorg-server/hw/xquartz/xpr/xprScreen.c
@@ -54,6 +54,11 @@
#include "damage.h"
#endif
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
+// From NSApplication.h
+extern const double NSAppKitVersionNumber;
+#endif
+
/* 10.4's deferred update makes X slower.. have to live with the tearing
* for now.. */
#define XP_NO_DEFERRED_UPDATES 8
@@ -164,9 +169,14 @@ displayScreenBounds(CGDirectDisplayID id)
(int)frame.size.width, (int)frame.size.height,
(int)frame.origin.x, (int)frame.origin.y);
- /* Remove menubar to help standard X11 window managers. */
- if (XQuartzIsRootless &&
- frame.origin.x == 0 && frame.origin.y == 0) {
+ /* Remove menubar to help standard X11 window managers.
+ * On Mavericks and later, the menu bar is on all displays.
+ */
+ if (XQuartzIsRootless
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
+ && (NSAppKitVersionNumber >= 1265 || (frame.origin.x == 0 && frame.origin.y == 0))
+#endif
+ ) {
frame.origin.y += aquaMenuBarHeight;
frame.size.height -= aquaMenuBarHeight;
}
diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c
index f4a9250c4..b12fa7d68 100644..100755
--- a/xorg-server/hw/xwin/glx/indirect.c
+++ b/xorg-server/hw/xwin/glx/indirect.c
@@ -1046,17 +1046,6 @@ glxWinDrawableDestroy(__GLXdrawable * base)
{
__GLXWinDrawable *glxPriv = (__GLXWinDrawable *) base;
- if (glxPriv->drawContext &&
- (lastGLContext == &((glxPriv->drawContext)->base))) {
- // if this context is current and has unflushed commands, say we have flushed them
- // (don't actually flush them, the window is going away anyhow, and an implict flush occurs
- // on the next context change)
- // (GLX core considers it an error when we try to select a new current context if the old one
- // has unflushed commands, but the window has disappeared..)
- ((__GLXcontext *)lastGLContext)->hasUnflushedCommands = FALSE;
- lastGLContext = NULL;
- }
-
if (glxPriv->hPbuffer)
if (!wglDestroyPbufferARBWrapper(glxPriv->hPbuffer)) {
ErrorF("wglDestroyPbufferARB failed: %s\n", glxWinErrorMessage());
diff --git a/xorg-server/include/misc.h b/xorg-server/include/misc.h
index 19e71035c..594017a26 100644
--- a/xorg-server/include/misc.h
+++ b/xorg-server/include/misc.h
@@ -269,15 +269,19 @@ extern void FormatDouble(double dbl, char *string);
* or a value greater than 0
*/
static inline int
-version_compare(uint16_t a_major, uint16_t a_minor,
- uint16_t b_major, uint16_t b_minor)
+version_compare(uint32_t a_major, uint32_t a_minor,
+ uint32_t b_major, uint32_t b_minor)
{
- int a, b;
+ if (a_major > b_major)
+ return 1;
+ if (a_major < b_major)
+ return -1;
+ if (a_minor > b_minor)
+ return 1;
+ if (a_minor < b_minor)
+ return -1;
- a = a_major << 16 | a_minor;
- b = b_major << 16 | b_minor;
-
- return (a - b);
+ return 0;
}
/* some macros to help swap requests, replies, and events */
diff --git a/xorg-server/include/servermd.h b/xorg-server/include/servermd.h
index 61beaf2ea..b785e931d 100755
--- a/xorg-server/include/servermd.h
+++ b/xorg-server/include/servermd.h
@@ -319,6 +319,20 @@ SOFTWARE.
#endif /* ARC */
+#ifdef __xtensa__
+
+#ifdef __XTENSA_EL__
+#define IMAGE_BYTE_ORDER LSBFirst
+#define BITMAP_BIT_ORDER LSBFirst
+#endif
+#ifdef __XTENSA_EB__
+#define IMAGE_BYTE_ORDER MSBFirst
+#define BITMAP_BIT_ORDER MSBFirst
+#endif
+#define GLYPHPADBYTES 4
+
+#endif /* __xtensa__ */
+
/* size of buffer to use with GetImage, measured in bytes. There's obviously
* a trade-off between the amount of heap used and the number of times the
* ddx routine has to be called.
diff --git a/xorg-server/include/xwin-config.h.in b/xorg-server/include/xwin-config.h.in
index a5e6b17b3..176c01980 100644
--- a/xorg-server/include/xwin-config.h.in
+++ b/xorg-server/include/xwin-config.h.in
@@ -26,5 +26,8 @@
/* Vendor web address for support */
#undef __VENDORDWEBSUPPORT__
+/* Default log location */
+#undef DEFAULT_LOGDIR
+
/* Whether we should re-locate the root to where the executable lives */
#undef RELOCATE_PROJECTROOT
diff --git a/xorg-server/man/Xserver.man b/xorg-server/man/Xserver.man
index b103551fa..7a74e8541 100644
--- a/xorg-server/man/Xserver.man
+++ b/xorg-server/man/Xserver.man
@@ -223,9 +223,8 @@ turns on auto-repeat.
.B -retro
starts the stipple with the classic stipple and cursor visible. The default
is to start with a black root window, and to suppress display of the cursor
-until the first time an application calls XDefineCursor(). For the Xorg
-server, this also sets the default for the DontZap option to FALSE. For
-kdrive servers, this implies -zap.
+until the first time an application calls XDefineCursor(). For kdrive
+servers, this implies -zap.
.TP 8
.B \-s \fIminutes\fP
sets screen-saver timeout time in minutes.
diff --git a/xorg-server/mi/mieq.c b/xorg-server/mi/mieq.c
index dbd5a47ac..ebe03ab44 100644
--- a/xorg-server/mi/mieq.c
+++ b/xorg-server/mi/mieq.c
@@ -515,6 +515,10 @@ mieqProcessDeviceEvent(DeviceIntPtr dev, InternalEvent *event, ScreenPtr screen)
verify_internal_event(event);
+ /* refuse events from disabled devices */
+ if (!dev->enabled)
+ return;
+
/* Custom event handler */
handler = miEventQueue.handlers[event->any.type];
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c
index d63cae882..34d1185b8 100644
--- a/xorg-server/os/log.c
+++ b/xorg-server/os/log.c
@@ -348,7 +348,7 @@ out:
* which directives you use.
*/
static int
-pnprintf(char *string, size_t size, const char *f, va_list args)
+vpnprintf(char *string, int size_in, const char *f, va_list args)
{
int f_idx = 0;
int s_idx = 0;
@@ -359,6 +359,7 @@ pnprintf(char *string, size_t size, const char *f, va_list args)
int i;
uint64_t ui;
int64_t si;
+ size_t size = size_in;
for (; f_idx < f_len && s_idx < size - 1; f_idx++) {
int length_modifier = 0;
@@ -490,6 +491,19 @@ pnprintf(char *string, size_t size, const char *f, va_list args)
return s_idx;
}
+static int
+pnprintf(char *string, int size, const char *f, ...)
+{
+ int rc;
+ va_list args;
+
+ va_start(args, f);
+ rc = vpnprintf(string, size, f, args);
+ va_end(args);
+
+ return rc;
+}
+
/* This function does the actual log message writes. It must be signal safe.
* When attempting to call non-signal-safe functions, guard them with a check
* of the inSignalContext global variable. */
@@ -603,7 +617,6 @@ LogMessageTypeVerbString(MessageType type, int verb)
void
LogVMessageVerb(MessageType type, int verb, const char *format, va_list args)
{
- static unsigned int warned;
const char *type_str;
char buf[1024];
const size_t size = sizeof(buf);
@@ -611,17 +624,8 @@ LogVMessageVerb(MessageType type, int verb, const char *format, va_list args)
size_t len = 0;
if (inSignalContext) {
- if (warned < 3) {
- BUG_WARN_MSG(inSignalContext,
- "Warning: attempting to log data in a signal unsafe "
- "manner while in signal context.\nPlease update to check "
- "inSignalContext and/or use LogMessageVerbSigSafe() or "
- "ErrorFSigSafe().\nThe offending log format message is:\n"
- "%s\n", format);
- warned++;
- if (warned == 3)
- LogMessageVerbSigSafe(X_WARNING, -1, "Warned %u times about sigsafe logging. Will be quiet now.\n", warned);
- }
+ LogVMessageVerbSigSafe(type, verb, format, args);
+ return;
}
type_str = LogMessageTypeVerbString(type, verb);
@@ -693,7 +697,7 @@ LogVMessageVerbSigSafe(MessageType type, int verb, const char *format, va_list a
LogSWrite(verb, " ", 1, FALSE);
}
- len = pnprintf(buf, sizeof(buf), format, args);
+ len = vpnprintf(buf, sizeof(buf), format, args);
/* Force '\n' at end of truncated line */
if (sizeof(buf) - len == 1)
@@ -707,40 +711,37 @@ void
LogVHdrMessageVerb(MessageType type, int verb, const char *msg_format,
va_list msg_args, const char *hdr_format, va_list hdr_args)
{
- static unsigned int warned;
const char *type_str;
char buf[1024];
const size_t size = sizeof(buf);
Bool newline;
size_t len = 0;
-
- if (inSignalContext) {
- if (warned < 3) {
- BUG_WARN_MSG(inSignalContext,
- "Warning: attempting to log data in a signal unsafe "
- "manner while in signal context.\nPlease update to check "
- "inSignalContext and/or use LogMessageVerbSigSafe().\nThe "
- "offending header and log message formats are:\n%s %s\n",
- hdr_format, msg_format);
- warned++;
- if (warned == 3)
- LogMessageVerbSigSafe(X_WARNING, -1, "Warned %u times about sigsafe logging. Will be quiet now.\n", warned);
- }
- }
+ int (*vprintf_func)(char *, int, const char* _X_RESTRICT_KYWD f, va_list args)
+ _X_ATTRIBUTE_PRINTF(3, 0);
+ int (*printf_func)(char *, int, const char* _X_RESTRICT_KYWD f, ...)
+ _X_ATTRIBUTE_PRINTF(3, 4);
type_str = LogMessageTypeVerbString(type, verb);
if (!type_str)
return;
+ if (inSignalContext) {
+ vprintf_func = vpnprintf;
+ printf_func = pnprintf;
+ } else {
+ vprintf_func = Xvscnprintf;
+ printf_func = Xscnprintf;
+ }
+
/* if type_str is not "", prepend it and ' ', to message */
if (type_str[0] != '\0')
- len += Xscnprintf(&buf[len], size - len, "%s ", type_str);
+ len += printf_func(&buf[len], size - len, "%s ", type_str);
if (hdr_format && size - len > 1)
- len += Xvscnprintf(&buf[len], size - len, hdr_format, hdr_args);
+ len += vprintf_func(&buf[len], size - len, hdr_format, hdr_args);
if (msg_format && size - len > 1)
- len += Xvscnprintf(&buf[len], size - len, msg_format, msg_args);
+ len += vprintf_func(&buf[len], size - len, msg_format, msg_args);
/* Force '\n' at end of truncated line */
if (size - len == 1)
diff --git a/xorg-server/present/present.c b/xorg-server/present/present.c
index 1bb459592..fb511eb53 100644
--- a/xorg-server/present/present.c
+++ b/xorg-server/present/present.c
@@ -42,6 +42,9 @@ static struct xorg_list present_flip_queue;
#define DebugPresent(x)
#endif
+static void
+present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc);
+
/*
* Copies the update region from a pixmap to the target drawable
*/
@@ -78,6 +81,20 @@ present_copy_region(DrawablePtr drawable,
FreeScratchGC(gc);
}
+static inline PixmapPtr
+present_flip_pending_pixmap(ScreenPtr screen)
+{
+ present_screen_priv_ptr screen_priv = present_screen_priv(screen);
+
+ if (!screen_priv)
+ return NULL;
+
+ if (!screen_priv->flip_pending)
+ return NULL;
+
+ return screen_priv->flip_pending->pixmap;
+}
+
static Bool
present_check_flip(RRCrtcPtr crtc,
WindowPtr window,
@@ -88,6 +105,7 @@ present_check_flip(RRCrtcPtr crtc,
int16_t y_off)
{
ScreenPtr screen = window->drawable.pScreen;
+ PixmapPtr window_pixmap;
WindowPtr root = screen->root;
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
@@ -104,19 +122,11 @@ present_check_flip(RRCrtcPtr crtc,
if (!screen_priv->info->flip)
return FALSE;
- /* Can't pend a flip while unflipping */
- if (screen_priv->unflip_event_id) {
- return FALSE;
- }
-
- /* Can't have two pending flips at the same time */
- if (screen_priv->flip_pending) {
- return FALSE;
- }
-
/* Make sure the window hasn't been redirected with Composite */
- if (screen->GetWindowPixmap(window) != screen->GetScreenPixmap(screen) &&
- screen->GetWindowPixmap(window) != screen_priv->flip_pixmap)
+ window_pixmap = screen->GetWindowPixmap(window);
+ if (window_pixmap != screen->GetScreenPixmap(screen) &&
+ window_pixmap != screen_priv->flip_pixmap &&
+ window_pixmap != present_flip_pending_pixmap(screen))
return FALSE;
/* Check for full-screen window */
@@ -147,6 +157,7 @@ present_check_flip(RRCrtcPtr crtc,
/* Ask the driver for permission */
if (screen_priv->info->check_flip) {
if (!(*screen_priv->info->check_flip) (crtc, window, pixmap, sync_flip)) {
+ DebugPresent(("\td %08lx -> %08lx\n", window->drawable.id, pixmap ? pixmap->drawable.id : 0));
return FALSE;
}
}
@@ -188,8 +199,10 @@ present_pixmap_idle(PixmapPtr pixmap, WindowPtr window, CARD32 serial, struct pr
{
if (present_fence)
present_fence_set_triggered(present_fence);
- if (window)
+ if (window) {
+ DebugPresent(("\ti %08lx\n", pixmap ? pixmap->drawable.id : 0));
present_send_idle_notify(window, serial, pixmap, present_fence);
+ }
}
RRCrtcPtr
@@ -227,9 +240,8 @@ present_query_capabilities(RRCrtcPtr crtc)
}
static int
-present_get_ust_msc(WindowPtr window, RRCrtcPtr crtc, uint64_t *ust, uint64_t *msc)
+present_get_ust_msc(ScreenPtr screen, RRCrtcPtr crtc, uint64_t *ust, uint64_t *msc)
{
- ScreenPtr screen = window->drawable.pScreen;
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
if (crtc == NULL)
@@ -283,7 +295,7 @@ present_window_to_crtc_msc(WindowPtr window, RRCrtcPtr crtc, uint64_t window_msc
* we'll just use whatever previous MSC we'd seen from this CRTC
*/
- if (present_get_ust_msc(window, window_priv->crtc, &old_ust, &old_msc) != Success)
+ if (present_get_ust_msc(window->drawable.pScreen, window_priv->crtc, &old_ust, &old_msc) != Success)
old_msc = window_priv->msc;
window_priv->msc_offset += new_msc - old_msc;
@@ -293,6 +305,34 @@ present_window_to_crtc_msc(WindowPtr window, RRCrtcPtr crtc, uint64_t window_msc
return window_msc + window_priv->msc_offset;
}
+/*
+ * When the wait fence or previous flip is completed, it's time
+ * to re-try the request
+ */
+static void
+present_re_execute(present_vblank_ptr vblank)
+{
+ uint64_t ust = 0, crtc_msc = 0;
+
+ if (vblank->crtc)
+ (void) present_get_ust_msc(vblank->screen, vblank->crtc, &ust, &crtc_msc);
+
+ present_execute(vblank, ust, crtc_msc);
+}
+
+static void
+present_flip_try_ready(ScreenPtr screen)
+{
+ present_vblank_ptr vblank, tmp;
+
+ xorg_list_for_each_entry_safe(vblank, tmp, &present_exec_queue, event_queue) {
+ if (vblank->flip_ready) {
+ present_re_execute(vblank);
+ return;
+ }
+ }
+}
+
static void
present_flip_idle(ScreenPtr screen)
{
@@ -369,16 +409,14 @@ present_unflip(ScreenPtr screen)
}
static void
-present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc);
-
-static void
present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
{
ScreenPtr screen = vblank->screen;
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
- DebugPresent(("\tn %p %8lld: %08lx -> %08lx\n", vblank, vblank->target_msc,
- vblank->pixmap ? vblank->pixmap->drawable.id : 0,
+ DebugPresent(("\tn %lld %p %8lld: %08lx -> %08lx\n",
+ vblank->event_id, vblank, vblank->target_msc,
+ vblank->pixmap ? vblank->pixmap->drawable.id : 0,
vblank->window->drawable.id));
assert (vblank == screen_priv->flip_pending);
@@ -404,6 +442,8 @@ present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
present_vblank_notify(vblank, PresentCompleteKindPixmap, PresentCompleteModeFlip, ust, crtc_msc);
present_vblank_destroy(vblank);
+
+ present_flip_try_ready(screen);
}
void
@@ -436,6 +476,7 @@ present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc)
DebugPresent(("\tun %lld\n", event_id));
screen_priv->unflip_event_id = 0;
present_flip_idle(screen);
+ present_flip_try_ready(screen);
return;
}
}
@@ -498,15 +539,7 @@ static void
present_wait_fence_triggered(void *param)
{
present_vblank_ptr vblank = param;
- WindowPtr window = vblank->window;
- uint64_t ust = 0, crtc_msc = 0;
-
- if (window) {
- present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE);
- if (window_priv)
- (void) present_get_ust_msc(window, window_priv->crtc, &ust, &crtc_msc);
- }
- present_execute(vblank, ust, crtc_msc);
+ present_re_execute(vblank);
}
/*
@@ -534,14 +567,27 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
}
}
+ if (vblank->flip && vblank->pixmap && vblank->window) {
+ if (screen_priv->flip_pending || screen_priv->unflip_event_id) {
+ DebugPresent(("\tr %lld %p (pending %p unflip %lld)\n",
+ vblank->event_id, vblank,
+ screen_priv->flip_pending, screen_priv->unflip_event_id));
+ vblank->flip_ready = TRUE;
+ return;
+ }
+ }
+
xorg_list_del(&vblank->event_queue);
vblank->queued = FALSE;
if (vblank->pixmap && vblank->window) {
- if (vblank->flip && screen_priv->flip_pending == NULL && !screen_priv->unflip_event_id) {
+ if (vblank->flip) {
+
+ DebugPresent(("\tf %lld %p %8lld: %08lx -> %08lx\n",
+ vblank->event_id, vblank, crtc_msc,
+ vblank->pixmap->drawable.id, vblank->window->drawable.id));
- DebugPresent(("\tf %p %8lld: %08lx -> %08lx\n", vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id));
/* Prepare to flip by placing it in the flip queue and
* and sticking it into the flip_pending field
*/
@@ -644,7 +690,7 @@ present_pixmap(WindowPtr window,
uint64_t target_msc;
uint64_t crtc_msc;
int ret;
- present_vblank_ptr vblank;
+ present_vblank_ptr vblank, tmp;
ScreenPtr screen = window->drawable.pScreen;
present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE);
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
@@ -664,7 +710,7 @@ present_pixmap(WindowPtr window,
target_crtc = present_get_crtc(window);
}
- present_get_ust_msc(window, target_crtc, &ust, &crtc_msc);
+ present_get_ust_msc(screen, target_crtc, &ust, &crtc_msc);
target_msc = present_window_to_crtc_msc(window, target_crtc, window_msc, crtc_msc);
@@ -698,7 +744,7 @@ present_pixmap(WindowPtr window,
*/
if (!update) {
- xorg_list_for_each_entry(vblank, &window_priv->vblank, window_list) {
+ xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->vblank, window_list) {
if (!vblank->pixmap)
continue;
@@ -706,11 +752,11 @@ present_pixmap(WindowPtr window,
if (!vblank->queued)
continue;
- if (vblank->crtc != target_crtc || vblank->target_msc != target_msc)
+ if (vblank->crtc != target_crtc || vblank->target_msc > target_msc)
continue;
DebugPresent(("\tx %lld %p %8lld: %08lx -> %08lx (crtc %p)\n",
- vblank->event_id, vblank, target_msc,
+ vblank->event_id, vblank, vblank->target_msc,
vblank->pixmap->drawable.id, vblank->window->drawable.id,
vblank->crtc));
@@ -720,6 +766,9 @@ present_pixmap(WindowPtr window,
vblank->pixmap = NULL;
vblank->idle_fence = NULL;
+ vblank->flip = FALSE;
+ if (vblank->flip_ready)
+ present_re_execute(vblank);
}
}
@@ -875,7 +924,8 @@ present_vblank_destroy(present_vblank_ptr vblank)
/* Remove vblank from window and screen lists */
xorg_list_del(&vblank->window_list);
- DebugPresent(("\td %p %8lld: %08lx -> %08lx\n", vblank, vblank->target_msc,
+ DebugPresent(("\td %lld %p %8lld: %08lx -> %08lx\n",
+ vblank->event_id, vblank, vblank->target_msc,
vblank->pixmap ? vblank->pixmap->drawable.id : 0,
vblank->window->drawable.id));
diff --git a/xorg-server/present/present_priv.h b/xorg-server/present/present_priv.h
index 8d3e0079c..d8569a2b6 100644
--- a/xorg-server/present/present_priv.h
+++ b/xorg-server/present/present_priv.h
@@ -71,6 +71,7 @@ struct present_vblank {
int num_notifies;
Bool queued; /* on present_exec_queue */
Bool flip; /* planning on using flip */
+ Bool flip_ready; /* wants to flip, but waiting for previous flip or unflip */
Bool sync_flip; /* do flip synchronous to vblank */
Bool abort_flip; /* aborting this flip */
};
diff --git a/xorg-server/test/input.c b/xorg-server/test/input.c
index 9b5db8991..a4615c9c9 100644
--- a/xorg-server/test/input.c
+++ b/xorg-server/test/input.c
@@ -1712,6 +1712,18 @@ mieq_test_event_handler(int screenNum, InternalEvent *ie, DeviceIntPtr dev)
static void
_mieq_test_generate_events(uint32_t start, uint32_t count)
{
+ static DeviceIntRec dev;
+ static SpriteInfoRec spriteInfo;
+ static SpriteRec sprite;
+
+ memset(&dev, 0, sizeof(dev));
+ memset(&spriteInfo, 0, sizeof(spriteInfo));
+ memset(&sprite, 0, sizeof(sprite));
+ dev.spriteInfo = &spriteInfo;
+ spriteInfo.sprite = &sprite;
+
+ dev.enabled = 1;
+
count += start;
while (start < count) {
RawDeviceEvent e = { 0 };
@@ -1721,7 +1733,7 @@ _mieq_test_generate_events(uint32_t start, uint32_t count)
e.time = GetTimeInMillis();
e.flags = start;
- mieqEnqueue(NULL, (InternalEvent *) &e);
+ mieqEnqueue(&dev, (InternalEvent *) &e);
start++;
}
diff --git a/xorg-server/xfixes/cursor.c b/xorg-server/xfixes/cursor.c
index 0db6b4ab1..bc8ad8096 100644
--- a/xorg-server/xfixes/cursor.c
+++ b/xorg-server/xfixes/cursor.c
@@ -1057,6 +1057,8 @@ XFixesCursorInit(void)
if (party_like_its_1989)
CursorVisible = EnableCursor;
+ else
+ CursorVisible = FALSE;
if (!dixRegisterPrivateKey(&CursorScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
return FALSE;