aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fontconfig/configure.in1
-rw-r--r--fontconfig/src/fcarch.c4
-rw-r--r--fontconfig/src/fccfg.c2
-rw-r--r--fontconfig/src/fcdbg.c79
-rw-r--r--fontconfig/src/fcint.h8
-rw-r--r--mesalib/include/GL/internal/dri_interface.h1
-rw-r--r--mesalib/src/glsl/TODO14
-rw-r--r--mesalib/src/glsl/opt_copy_propagation_elements.cpp1
-rw-r--r--mesalib/src/mesa/main/teximage.c7
-rw-r--r--xorg-server/Xi/xiqueryversion.c41
-rw-r--r--xorg-server/dix/devices.c1
-rw-r--r--xorg-server/dix/getevents.c3
-rw-r--r--xorg-server/dix/globals.c1
-rw-r--r--xorg-server/dix/touch.c5
-rw-r--r--xorg-server/hw/dmx/dmxlog.c13
-rw-r--r--xorg-server/hw/dmx/dmxlog.h19
-rw-r--r--xorg-server/include/opaque.h1
-rw-r--r--xorg-server/man/Xserver.man7
-rw-r--r--xorg-server/os/WaitFor.c18
-rw-r--r--xorg-server/os/connection.c68
-rw-r--r--xorg-server/os/utils.c9
-rw-r--r--xorg-server/test/Makefile.am2
-rw-r--r--xorg-server/test/xi2/protocol-xiqueryversion.c113
-rw-r--r--xorg-server/xkeyboard-config/symbols/dk1
-rw-r--r--xorg-server/xkeyboard-config/symbols/latin2
-rw-r--r--xorg-server/xkeyboard-config/symbols/me18
26 files changed, 343 insertions, 96 deletions
diff --git a/fontconfig/configure.in b/fontconfig/configure.in
index b77c52a29..b2174d99b 100644
--- a/fontconfig/configure.in
+++ b/fontconfig/configure.in
@@ -110,7 +110,6 @@ dnl ==========================================================================
AC_ARG_WITH(arch,
[AC_HELP_STRING([--with-arch=ARCH],
[Force architecture to ARCH])],
- ,
arch="$withval", arch=auto)
if test "x$arch" != xauto; then
diff --git a/fontconfig/src/fcarch.c b/fontconfig/src/fcarch.c
index 09d24b31b..5fe7d97d8 100644
--- a/fontconfig/src/fcarch.c
+++ b/fontconfig/src/fcarch.c
@@ -56,7 +56,9 @@ FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcStrSet *));
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcCharLeaf **));
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcChar16 *));
-FC_ASSERT_STATIC (0x08 + 1*ALIGNOF_DOUBLE == sizeof (FcValue));
+#define FC_MAX(a,b) ((a) > (b) ? (a) : (b))
+
+FC_ASSERT_STATIC (0x08 + 1*FC_MAX(4,ALIGNOF_DOUBLE) == sizeof (FcValue));
FC_ASSERT_STATIC (0x00 + 2*SIZEOF_VOID_P == sizeof (FcPatternElt));
FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcPattern));
FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcCharSet));
diff --git a/fontconfig/src/fccfg.c b/fontconfig/src/fccfg.c
index 0d0b778d2..f9cdaaf46 100644
--- a/fontconfig/src/fccfg.c
+++ b/fontconfig/src/fccfg.c
@@ -1302,7 +1302,7 @@ FcConfigAdd (FcValueListPtr *head,
if (FcDebug () & FC_DBG_EDIT)
{
printf ("%s list before ", append ? "Append" : "Prepend");
- FcValueListPrint (*head);
+ FcValueListPrintWithPosition (*head, *prev);
printf ("\n");
}
diff --git a/fontconfig/src/fcdbg.c b/fontconfig/src/fcdbg.c
index cf2ff0870..10f3cc9aa 100644
--- a/fontconfig/src/fcdbg.c
+++ b/fontconfig/src/fcdbg.c
@@ -26,59 +26,92 @@
#include <stdio.h>
#include <stdlib.h>
-void
-FcValuePrint (const FcValue v)
+static void
+_FcValuePrint (const FcValue v)
{
switch (v.type) {
case FcTypeVoid:
- printf (" <void>");
+ printf ("<void>");
break;
case FcTypeInteger:
- printf (" %d(i)", v.u.i);
+ printf ("%d(i)", v.u.i);
break;
case FcTypeDouble:
- printf (" %g(f)", v.u.d);
+ printf ("%g(f)", v.u.d);
break;
case FcTypeString:
- printf (" \"%s\"", v.u.s);
+ printf ("\"%s\"", v.u.s);
break;
case FcTypeBool:
- printf (" %s", v.u.b ? "FcTrue" : "FcFalse");
+ printf ("%s", v.u.b ? "FcTrue" : "FcFalse");
break;
case FcTypeMatrix:
- printf (" (%f %f; %f %f)", v.u.m->xx, v.u.m->xy, v.u.m->yx, v.u.m->yy);
+ printf ("(%f %f; %f %f)", v.u.m->xx, v.u.m->xy, v.u.m->yx, v.u.m->yy);
break;
case FcTypeCharSet: /* XXX */
- printf (" ");
FcCharSetPrint (v.u.c);
break;
case FcTypeLangSet:
- printf (" ");
FcLangSetPrint (v.u.l);
break;
case FcTypeFTFace:
- printf (" face");
+ printf ("face");
break;
}
}
void
+FcValuePrint (const FcValue v)
+{
+ printf (" ");
+ _FcValuePrint (v);
+}
+
+void
+FcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark)
+{
+ if (show_pos_mark)
+ printf (" [insert here] ");
+ else
+ printf (" ");
+ _FcValuePrint (v);
+}
+
+static void
+FcValueBindingPrint (const FcValueListPtr l)
+{
+ switch (l->binding) {
+ case FcValueBindingWeak:
+ printf ("(w)");
+ break;
+ case FcValueBindingStrong:
+ printf ("(s)");
+ break;
+ case FcValueBindingSame:
+ printf ("(=)");
+ break;
+ }
+}
+
+void
+FcValueListPrintWithPosition (FcValueListPtr l, const FcValueListPtr pos)
+{
+ for (; l != NULL; l = FcValueListNext(l))
+ {
+ FcValuePrintWithPosition (FcValueCanonicalize (&l->value), pos != NULL && l == pos);
+ FcValueBindingPrint (l);
+ }
+ if (!pos)
+ printf (" [insert here]");
+}
+
+void
FcValueListPrint (FcValueListPtr l)
{
for (; l != NULL; l = FcValueListNext(l))
{
- FcValuePrint (FcValueCanonicalize(&l->value));
- switch (l->binding) {
- case FcValueBindingWeak:
- printf ("(w)");
- break;
- case FcValueBindingStrong:
- printf ("(s)");
- break;
- case FcValueBindingSame:
- printf ("(=)");
- break;
- }
+ FcValuePrint (FcValueCanonicalize (&l->value));
+ FcValueBindingPrint (l);
}
}
diff --git a/fontconfig/src/fcint.h b/fontconfig/src/fcint.h
index fb4a64b9d..a982b7710 100644
--- a/fontconfig/src/fcint.h
+++ b/fontconfig/src/fcint.h
@@ -701,7 +701,13 @@ FcCharSetGetNumbers(const FcCharSet *c);
/* fcdbg.c */
FcPrivate void
-FcValueListPrint (const FcValueListPtr l);
+FcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark);
+
+FcPrivate void
+FcValueListPrintWithPosition (FcValueListPtr l, const FcValueListPtr pos);
+
+FcPrivate void
+FcValueListPrint (FcValueListPtr l);
FcPrivate void
FcLangSetPrint (const FcLangSet *ls);
diff --git a/mesalib/include/GL/internal/dri_interface.h b/mesalib/include/GL/internal/dri_interface.h
index da8366652..eafbe10f9 100644
--- a/mesalib/include/GL/internal/dri_interface.h
+++ b/mesalib/include/GL/internal/dri_interface.h
@@ -906,6 +906,7 @@ struct __DRIdri2ExtensionRec {
#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
#define __DRI_IMAGE_FORMAT_ABGR8888 0x1004
+#define __DRI_IMAGE_FORMAT_XBGR8888 0x1005
#define __DRI_IMAGE_USE_SHARE 0x0001
#define __DRI_IMAGE_USE_SCANOUT 0x0002
diff --git a/mesalib/src/glsl/TODO b/mesalib/src/glsl/TODO
index c99d7e152..eb73fc2e8 100644
--- a/mesalib/src/glsl/TODO
+++ b/mesalib/src/glsl/TODO
@@ -6,22 +6,10 @@
constant index values. For others it is more complicated. Perhaps these
cases should be silently converted to uniforms?
-- Implement support for ir_binop_dot in ir_algebraic.cpp. Perform
+- Implement support for ir_binop_dot in opt_algebraic.cpp. Perform
transformations such as "dot(v, vec3(0.0, 1.0, 0.0))" -> v.y.
- Track source locations throughout the IR. There are currently several
places where we cannot emit line numbers for errors (and currently emit 0:0)
because we've "lost" the line number information. This is particularly
noticeable at link time.
-
-1.30 features:
-
-- Implement AST-to-HIR conversion of switch-statements
- - switch
- - case
- - Update break to correcly handle mixed nexting of switch-statements
- and loops.
-
-- Implement support for gl_ClipDistance. This is non-trivial because
- gl_ClipDistance is exposed as a float[8], but all hardware actually
- implements it as vec4[2]. \ No newline at end of file
diff --git a/mesalib/src/glsl/opt_copy_propagation_elements.cpp b/mesalib/src/glsl/opt_copy_propagation_elements.cpp
index 314db4e18..11d9d7baf 100644
--- a/mesalib/src/glsl/opt_copy_propagation_elements.cpp
+++ b/mesalib/src/glsl/opt_copy_propagation_elements.cpp
@@ -93,6 +93,7 @@ public:
ir_copy_propagation_elements_visitor()
{
this->progress = false;
+ this->killed_all = false;
this->mem_ctx = ralloc_context(NULL);
this->shader_mem_ctx = NULL;
this->acp = new(mem_ctx) exec_list;
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c
index 23486467d..50095d2c6 100644
--- a/mesalib/src/mesa/main/teximage.c
+++ b/mesalib/src/mesa/main/teximage.c
@@ -2692,6 +2692,13 @@ _mesa_EGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image)
texObj = _mesa_get_current_tex_object(ctx, target);
_mesa_lock_texture(ctx, texObj);
+ if (texObj->Immutable) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glEGLImageTargetTexture2D(texture is immutable)");
+ _mesa_unlock_texture(ctx, texObj);
+ return;
+ }
+
texImage = _mesa_get_tex_image(ctx, texObj, target, 0);
if (!texImage) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glEGLImageTargetTexture2D");
diff --git a/xorg-server/Xi/xiqueryversion.c b/xorg-server/Xi/xiqueryversion.c
index fc0ca751b..6081c413d 100644
--- a/xorg-server/Xi/xiqueryversion.c
+++ b/xorg-server/Xi/xiqueryversion.c
@@ -70,28 +70,29 @@ ProcXIQueryVersion(ClientPtr client)
pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
- if (pXIClient->major_version &&
- (stuff->major_version != pXIClient->major_version ||
- stuff->minor_version != pXIClient->minor_version))
- {
- client->errorValue = stuff->major_version;
- return BadValue;
+ if (pXIClient->major_version) {
+ if (version_compare(stuff->major_version, stuff->minor_version,
+ pXIClient->major_version, pXIClient->minor_version) < 0) {
+ client->errorValue = stuff->major_version;
+ return BadValue;
+ }
+ major = pXIClient->major_version;
+ minor = pXIClient->minor_version;
+ } else {
+ if (version_compare(XIVersion.major_version, XIVersion.minor_version,
+ stuff->major_version, stuff->minor_version) > 0) {
+ major = stuff->major_version;
+ minor = stuff->minor_version;
+ }
+ else {
+ major = XIVersion.major_version;
+ minor = XIVersion.minor_version;
+ }
+
+ pXIClient->major_version = major;
+ pXIClient->minor_version = minor;
}
-
- if (version_compare(XIVersion.major_version, XIVersion.minor_version,
- stuff->major_version, stuff->minor_version) > 0) {
- major = stuff->major_version;
- minor = stuff->minor_version;
- }
- else {
- major = XIVersion.major_version;
- minor = XIVersion.minor_version;
- }
-
- pXIClient->major_version = major;
- pXIClient->minor_version = minor;
-
memset(&rep, 0, sizeof(xXIQueryVersionReply));
rep.repType = X_Reply;
rep.RepType = X_XIQueryVersion;
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index 600f8b738..7f3886507 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -437,6 +437,7 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
if (*prev != dev)
return FALSE;
+ ReleaseButtonsAndKeys(dev);
SyncRemoveDeviceIdleTime(dev->idle_counter);
dev->idle_counter = NULL;
diff --git a/xorg-server/dix/getevents.c b/xorg-server/dix/getevents.c
index 23bbe065c..c960d4467 100644
--- a/xorg-server/dix/getevents.c
+++ b/xorg-server/dix/getevents.c
@@ -1598,6 +1598,9 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
/* Now turn the smooth-scrolling axes back into emulated button presses
* for legacy clients, based on the integer delta between before and now */
for (i = 0; i < valuator_mask_size(&mask); i++) {
+ if (i >= pDev->valuator->numAxes)
+ break;
+
if (!valuator_mask_isset(&mask, i))
continue;
diff --git a/xorg-server/dix/globals.c b/xorg-server/dix/globals.c
index a564575f3..332b91f5c 100644
--- a/xorg-server/dix/globals.c
+++ b/xorg-server/dix/globals.c
@@ -128,6 +128,7 @@ int defaultColorVisualClass = -1;
int monitorResolution = 0;
char *display;
+int displayfd;
char *ConnectionInfo;
CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND;
diff --git a/xorg-server/dix/touch.c b/xorg-server/dix/touch.c
index dd16367d0..401cb981a 100644
--- a/xorg-server/dix/touch.c
+++ b/xorg-server/dix/touch.c
@@ -966,6 +966,11 @@ TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener,
int nev;
int i;
+ BUG_WARN(listener < 0);
+ BUG_WARN(listener >= ti->num_listeners);
+ if (listener < 0 || listener >= ti->num_listeners)
+ return BadMatch;
+
if (listener > 0) {
if (mode == XIRejectTouch)
TouchRejected(dev, ti, ti->listeners[listener].listener, NULL);
diff --git a/xorg-server/hw/dmx/dmxlog.c b/xorg-server/hw/dmx/dmxlog.c
index 33aee590a..3249c4867 100644
--- a/xorg-server/hw/dmx/dmxlog.c
+++ b/xorg-server/hw/dmx/dmxlog.c
@@ -86,6 +86,8 @@ ErrorF(const char *format, ...)
/** Provide an VFatalError function when used stand-alone. */
static void
+VFatalError(const char *format, va_list args) _X_ATTRIBUTE_PRINTF(1, 0) _X_NORETURN;
+static void
VFatalError(const char *format, va_list args)
{
vfprintf(stderr, format, args); /* RATS: We assume the format string
@@ -104,7 +106,9 @@ VErrorF(const char *format, va_list args)
}
#else
/** This function was removed between XFree86 4.3.0 and XFree86 4.4.0. */
-extern void AbortServer(void);
+extern void AbortServer(void) _X_NORETURN;
+static void
+VFatalError(const char *format, va_list args) _X_ATTRIBUTE_PRINTF(1, 0) _X_NORETURN;
static void
VFatalError(const char *format, va_list args)
{
@@ -163,6 +167,8 @@ dmxHeader(dmxLogLevel logLevel, DMXInputInfo * dmxInput,
/* Prints the error message with the appropriate low-level X output
* routine. */
static void
+dmxMessage(dmxLogLevel logLevel, const char *format, va_list args) _X_ATTRIBUTE_PRINTF(2, 0);
+static void
dmxMessage(dmxLogLevel logLevel, const char *format, va_list args)
{
if (logLevel == dmxFatal || logLevel >= dmxCurrentLogLevel) {
@@ -300,10 +306,11 @@ dmxLogVisual(DMXScreenInfo * dmxScreen, XVisualInfo * vi, int defaultVisual)
class = "DirectColor";
break;
}
+#define VisualLogFormat "0x%02lx %s %2db %db/rgb %3d 0x%04lx 0x%04lx 0x%04lx%s\n"
if (dmxScreen) {
dmxLogOutput(dmxScreen,
- "0x%02x %s %2db %db/rgb %3d 0x%04x 0x%04x 0x%04x%s\n",
+ VisualLogFormat,
vi->visualid, class, vi->depth, vi->bits_per_rgb,
vi->colormap_size,
vi->red_mask, vi->green_mask, vi->blue_mask,
@@ -311,7 +318,7 @@ dmxLogVisual(DMXScreenInfo * dmxScreen, XVisualInfo * vi, int defaultVisual)
}
else {
dmxLog(dmxInfo,
- " 0x%02x %s %2db %db/rgb %3d 0x%04x 0x%04x 0x%04x%s\n",
+ " " VisualLogFormat,
vi->visualid, class, vi->depth, vi->bits_per_rgb,
vi->colormap_size,
vi->red_mask, vi->green_mask, vi->blue_mask,
diff --git a/xorg-server/hw/dmx/dmxlog.h b/xorg-server/hw/dmx/dmxlog.h
index 4d4cd269a..162484b34 100644
--- a/xorg-server/hw/dmx/dmxlog.h
+++ b/xorg-server/hw/dmx/dmxlog.h
@@ -55,18 +55,23 @@ typedef enum {
/* Logging functions used by Xserver/hw/dmx routines. */
extern dmxLogLevel dmxSetLogLevel(dmxLogLevel newLevel);
extern dmxLogLevel dmxGetLogLevel(void);
-extern void dmxLog(dmxLogLevel logLevel, const char *format, ...);
-extern void dmxLogCont(dmxLogLevel logLevel, const char *format, ...);
+extern void dmxLog(dmxLogLevel logLevel, const char *format,
+ ...) _X_ATTRIBUTE_PRINTF(2, 3);
+extern void dmxLogCont(dmxLogLevel logLevel, const char *format,
+ ...) _X_ATTRIBUTE_PRINTF(2, 3);
extern const char *dmxEventName(int type);
#ifndef DMX_LOG_STANDALONE
-extern void dmxLogOutput(DMXScreenInfo * dmxScreen, const char *format, ...);
+extern void dmxLogOutput(DMXScreenInfo * dmxScreen, const char *format,
+ ...) _X_ATTRIBUTE_PRINTF(2, 3);
extern void dmxLogOutputCont(DMXScreenInfo * dmxScreen, const char *format,
- ...);
+ ...) _X_ATTRIBUTE_PRINTF(2, 3);
extern void dmxLogOutputWarning(DMXScreenInfo * dmxScreen, const char *format,
- ...);
-extern void dmxLogInput(DMXInputInfo * dmxInput, const char *format, ...);
-extern void dmxLogInputCont(DMXInputInfo * dmxInput, const char *format, ...);
+ ...) _X_ATTRIBUTE_PRINTF(2, 3);
+extern void dmxLogInput(DMXInputInfo * dmxInput, const char *format,
+ ...) _X_ATTRIBUTE_PRINTF(2, 3);
+extern void dmxLogInputCont(DMXInputInfo * dmxInput, const char *format,
+ ...) _X_ATTRIBUTE_PRINTF(2, 3);
extern void dmxLogArgs(dmxLogLevel logLevel, int argc, char **argv);
extern void dmxLogVisual(DMXScreenInfo * dmxScreen, XVisualInfo * vi,
int defaultVisual);
diff --git a/xorg-server/include/opaque.h b/xorg-server/include/opaque.h
index 9ca408ae1..b76ab6e6b 100644
--- a/xorg-server/include/opaque.h
+++ b/xorg-server/include/opaque.h
@@ -50,6 +50,7 @@ extern _X_EXPORT int ScreenSaverAllowExposures;
extern _X_EXPORT int defaultScreenSaverBlanking;
extern _X_EXPORT int defaultScreenSaverAllowExposures;
extern _X_EXPORT char *display;
+extern _X_EXPORT int displayfd;
extern _X_EXPORT int defaultBackingStore;
extern _X_EXPORT Bool disableBackingStore;
diff --git a/xorg-server/man/Xserver.man b/xorg-server/man/Xserver.man
index 0cd9b941c..8d243d6b7 100644
--- a/xorg-server/man/Xserver.man
+++ b/xorg-server/man/Xserver.man
@@ -127,6 +127,13 @@ Not obeyed by all servers.
.B \-core
causes the server to generate a core dump on fatal errors.
.TP 8
+.B \-displayfd \fIfd\fP
+specifies a file descriptor in the launching process. Rather than specify
+a display number, the X server will attempt to listen on successively higher
+display numbers, and upon finding a free one, will write the port number back
+on this file descriptor as a newline-terminated string. The \-pn option is
+ignored when using \-displayfd.
+.TP 8
.B \-deferglyphs \fIwhichfonts\fP
specifies the types of fonts for which the server should attempt to use
deferred glyph loading. \fIwhichfonts\fP can be all (all fonts),
diff --git a/xorg-server/os/WaitFor.c b/xorg-server/os/WaitFor.c
index 95e64ba45..393890f19 100644
--- a/xorg-server/os/WaitFor.c
+++ b/xorg-server/os/WaitFor.c
@@ -382,6 +382,7 @@ CheckAllTimers(void)
OsTimerPtr timer;
CARD32 now;
+ OsBlockSignals();
start:
now = GetTimeInMillis();
@@ -391,6 +392,7 @@ CheckAllTimers(void)
goto start;
}
}
+ OsReleaseSignals();
}
static void
@@ -398,11 +400,13 @@ DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev)
{
CARD32 newTime;
+ OsBlockSignals();
*prev = timer->next;
timer->next = NULL;
newTime = (*timer->callback) (timer, now, timer->arg);
if (newTime)
TimerSet(timer, 0, newTime, timer->callback, timer->arg);
+ OsReleaseSignals();
}
OsTimerPtr
@@ -418,6 +422,7 @@ TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
return NULL;
}
else {
+ OsBlockSignals();
for (prev = &timers; *prev; prev = &(*prev)->next) {
if (*prev == timer) {
*prev = timer->next;
@@ -426,6 +431,7 @@ TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
break;
}
}
+ OsReleaseSignals();
}
if (!millis)
return timer;
@@ -445,26 +451,32 @@ TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
if (!millis)
return timer;
}
+ OsBlockSignals();
for (prev = &timers;
*prev && (int) ((*prev)->expires - millis) <= 0;
prev = &(*prev)->next);
timer->next = *prev;
*prev = timer;
+ OsReleaseSignals();
return timer;
}
Bool
TimerForce(OsTimerPtr timer)
{
+ int rc = FALSE;
OsTimerPtr *prev;
+ OsBlockSignals();
for (prev = &timers; *prev; prev = &(*prev)->next) {
if (*prev == timer) {
DoTimer(timer, GetTimeInMillis(), prev);
- return TRUE;
+ rc = TRUE;
+ break;
}
}
- return FALSE;
+ OsReleaseSignals();
+ return rc;
}
void
@@ -474,12 +486,14 @@ TimerCancel(OsTimerPtr timer)
if (!timer)
return;
+ OsBlockSignals();
for (prev = &timers; *prev; prev = &(*prev)->next) {
if (*prev == timer) {
*prev = timer->next;
break;
}
}
+ OsReleaseSignals();
}
void
diff --git a/xorg-server/os/connection.c b/xorg-server/os/connection.c
index 1099752e4..039942f91 100644
--- a/xorg-server/os/connection.c
+++ b/xorg-server/os/connection.c
@@ -142,6 +142,7 @@ Bool AnyClientsWriteBlocked; /* true if some client blocked on write */
static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */
Bool RunFromSigStopParent; /* send SIGSTOP to our own process; Upstart (or
equivalent) will send SIGCONT back. */
+static char dynamic_display[7]; /* display name */
Bool PartialNetwork; /* continue even if unable to bind all addrs */
static Pid_t ParentProcess;
@@ -350,6 +351,10 @@ void
NotifyParentProcess(void)
{
#if !defined(WIN32)
+ if (dynamic_display[0]) {
+ write(displayfd, dynamic_display, strlen(dynamic_display));
+ close(displayfd);
+ }
if (RunFromSmartParent) {
if (ParentProcess > 1) {
kill(ParentProcess, SIGUSR1);
@@ -360,6 +365,18 @@ NotifyParentProcess(void)
#endif
}
+static Bool
+TryCreateSocket(int num, int *partial)
+{
+ char port[20];
+
+ snprintf(port, sizeof(port), "%d", num);
+
+ return (_XSERVTransMakeAllCOTSServerListeners(port, partial,
+ &ListenTransCount,
+ &ListenTransConns) >= 0);
+}
+
/*****************
* CreateWellKnownSockets
* At initialization, create the sockets to listen on for new clients.
@@ -370,7 +387,6 @@ CreateWellKnownSockets(void)
{
int i;
int partial;
- char port[20];
FD_ZERO(&AllSockets);
FD_ZERO(&AllClients);
@@ -386,29 +402,41 @@ CreateWellKnownSockets(void)
FD_ZERO(&WellKnownConnections);
- snprintf(port, sizeof(port), "%d", atoi(display));
-
- if ((_XSERVTransMakeAllCOTSServerListeners(port, &partial,
- &ListenTransCount,
- &ListenTransConns) >= 0) &&
- (ListenTransCount >= 1)) {
- if (!PartialNetwork && partial) {
- FatalError("Failed to establish all listening sockets");
+ /* display is initialized to "0" by main(). It is then set to the display
+ * number if specified on the command line, or to NULL when the -displayfd
+ * option is used. */
+ if (display) {
+ if (TryCreateSocket(atoi(display), &partial) &&
+ ListenTransCount >= 1)
+ if (!PartialNetwork && partial)
+ FatalError ("Failed to establish all listening sockets");
+ }
+ else { /* -displayfd */
+ Bool found = 0;
+ for (i = 0; i < 65535 - X_TCP_PORT; i++) {
+ if (TryCreateSocket(i, &partial) && !partial) {
+ found = 1;
+ break;
+ }
+ else
+ CloseWellKnownConnections();
}
- else {
- ListenTransFds = malloc(ListenTransCount * sizeof(int));
+ if (!found)
+ FatalError("Failed to find a socket to listen on");
+ snprintf(dynamic_display, sizeof(dynamic_display), "%d", i);
+ display = dynamic_display;
+ }
- for (i = 0; i < ListenTransCount; i++) {
- int fd = _XSERVTransGetConnectionNumber(ListenTransConns[i]);
+ ListenTransFds = malloc(ListenTransCount * sizeof (int));
- ListenTransFds[i] = fd;
- FD_SET(fd, &WellKnownConnections);
+ for (i = 0; i < ListenTransCount; i++) {
+ int fd = _XSERVTransGetConnectionNumber(ListenTransConns[i]);
- if (!_XSERVTransIsLocal(ListenTransConns[i])) {
- DefineSelf(fd);
- }
- }
- }
+ ListenTransFds[i] = fd;
+ FD_SET(fd, &WellKnownConnections);
+
+ if (!_XSERVTransIsLocal(ListenTransConns[i]))
+ DefineSelf (fd);
}
if (!XFD_ANYSET(&WellKnownConnections))
diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c
index 30592d2cc..3a1ef9303 100644
--- a/xorg-server/os/utils.c
+++ b/xorg-server/os/utils.c
@@ -659,6 +659,15 @@ ProcessCommandLine(int argc, char *argv[])
else
UseMsg();
}
+ else if (strcmp(argv[i], "-displayfd") == 0) {
+ if (++i < argc) {
+ displayfd = atoi(argv[i]);
+ display = NULL;
+ nolock = TRUE;
+ }
+ else
+ UseMsg();
+ }
#ifdef DPMSExtension
else if (strcmp(argv[i], "dpms") == 0)
/* ignored for compatibility */ ;
diff --git a/xorg-server/test/Makefile.am b/xorg-server/test/Makefile.am
index 85823977b..b2a53aa64 100644
--- a/xorg-server/test/Makefile.am
+++ b/xorg-server/test/Makefile.am
@@ -36,7 +36,7 @@ misc_LDADD=$(TEST_LDADD)
fixes_LDADD=$(TEST_LDADD)
xfree86_LDADD=$(TEST_LDADD)
touch_LDADD=$(TEST_LDADD)
-hashtabletest_LDADD=$(TEST_LDADD) ../Xext/hashtable.c
+hashtabletest_LDADD=$(TEST_LDADD) $(top_srcdir)/Xext/hashtable.c
libxservertest_la_LIBADD = $(XSERVER_LIBS)
if XORG
diff --git a/xorg-server/test/xi2/protocol-xiqueryversion.c b/xorg-server/test/xi2/protocol-xiqueryversion.c
index 2552307f2..1347e866c 100644
--- a/xorg-server/test/xi2/protocol-xiqueryversion.c
+++ b/xorg-server/test/xi2/protocol-xiqueryversion.c
@@ -54,6 +54,8 @@ struct test_data {
int minor_client;
int major_server;
int minor_server;
+ int major_cached;
+ int minor_cached;
};
static void
@@ -82,6 +84,24 @@ reply_XIQueryVersion(ClientPtr client, int len, char *data, void *userdata)
assert((sver > cver) ? ver == cver : ver == sver);
}
+static void
+reply_XIQueryVersion_multiple(ClientPtr client, int len, char *data, void *userdata)
+{
+ xXIQueryVersionReply *rep = (xXIQueryVersionReply *) data;
+ struct test_data *versions = (struct test_data *) userdata;
+
+ reply_check_defaults(rep, len, XIQueryVersion);
+ assert(rep->length == 0);
+
+ if (versions->major_cached == -1) {
+ versions->major_cached = rep->major_version;
+ versions->minor_cached = rep->minor_version;
+ }
+
+ assert(versions->major_cached == rep->major_version);
+ assert(versions->minor_cached == rep->minor_version);
+}
+
/**
* Run a single test with server version smaj.smin and client
* version cmaj.cmin. Verify that return code is equal to 'error'.
@@ -173,12 +193,105 @@ test_XIQueryVersion(void)
reply_handler = NULL;
}
+
+static void
+test_XIQueryVersion_multiple(void)
+{
+ xXIQueryVersionReq request;
+ ClientRec client;
+ struct test_data versions;
+ int rc;
+
+ request_init(&request, XIQueryVersion);
+ client = init_client(request.length, &request);
+
+ /* Change the server to support 2.2 */
+ XIVersion.major_version = 2;
+ XIVersion.minor_version = 2;
+
+ reply_handler = reply_XIQueryVersion_multiple;
+ userdata = (void *) &versions;
+
+ /* run 1 */
+ versions.major_cached = -1;
+ versions.minor_cached = -1;
+
+ /* client is lower than server, noncached */
+ request.major_version = 2;
+ request.minor_version = 1;
+ rc = ProcXIQueryVersion(&client);
+ assert(rc == Success);
+
+ /* client is higher than server, cached */
+ request.major_version = 2;
+ request.minor_version = 3;
+ rc = ProcXIQueryVersion(&client);
+ assert(rc == Success);
+
+ /* client is equal, cached */
+ request.major_version = 2;
+ request.minor_version = 2;
+ rc = ProcXIQueryVersion(&client);
+ assert(rc == Success);
+
+ /* client is low than cached */
+ request.major_version = 2;
+ request.minor_version = 0;
+ rc = ProcXIQueryVersion(&client);
+ assert(rc == BadValue);
+
+ /* run 2 */
+ client = init_client(request.length, &request);
+ XIVersion.major_version = 2;
+ XIVersion.minor_version = 2;
+ versions.major_cached = -1;
+ versions.minor_cached = -1;
+
+ request.major_version = 2;
+ request.minor_version = 2;
+ rc = ProcXIQueryVersion(&client);
+ assert(rc == Success);
+
+ request.major_version = 2;
+ request.minor_version = 3;
+ rc = ProcXIQueryVersion(&client);
+ assert(rc == Success);
+
+ request.major_version = 2;
+ request.minor_version = 1;
+ rc = ProcXIQueryVersion(&client);
+ assert(rc == BadValue);
+
+ /* run 3 */
+ client = init_client(request.length, &request);
+ XIVersion.major_version = 2;
+ XIVersion.minor_version = 2;
+ versions.major_cached = -1;
+ versions.minor_cached = -1;
+
+ request.major_version = 2;
+ request.minor_version = 3;
+ rc = ProcXIQueryVersion(&client);
+ assert(rc == Success);
+
+ request.major_version = 2;
+ request.minor_version = 2;
+ rc = ProcXIQueryVersion(&client);
+ assert(rc == Success);
+
+ request.major_version = 2;
+ request.minor_version = 1;
+ rc = ProcXIQueryVersion(&client);
+ assert(rc == BadValue);
+}
+
int
main(int argc, char **argv)
{
init_simple();
test_XIQueryVersion();
+ test_XIQueryVersion_multiple();
return 0;
}
diff --git a/xorg-server/xkeyboard-config/symbols/dk b/xorg-server/xkeyboard-config/symbols/dk
index 1187a99bd..1deea28aa 100644
--- a/xorg-server/xkeyboard-config/symbols/dk
+++ b/xorg-server/xkeyboard-config/symbols/dk
@@ -69,4 +69,5 @@ xkb_symbols "dvorak" {
include "no(dvorak)"
name[Group1]= "Danish (Dvorak)";
+ key <AD12> { [ asciitilde, asciicircum, dead_diaeresis, dead_tilde ] };
};
diff --git a/xorg-server/xkeyboard-config/symbols/latin b/xorg-server/xkeyboard-config/symbols/latin
index 77b99d46c..424768ead 100644
--- a/xorg-server/xkeyboard-config/symbols/latin
+++ b/xorg-server/xkeyboard-config/symbols/latin
@@ -35,7 +35,7 @@ xkb_symbols "basic" {
key <AC04> { [ f, F, dstroke, ordfeminine ] };
key <AC05> { [ g, G, eng, ENG ] };
key <AC06> { [ h, H, hstroke, Hstroke ] };
- key <AC07> { [ j, J, j, J ] };
+ key <AC07> { [ j, J, dead_hook, dead_horn ] };
key <AC08> { [ k, K, kra, ampersand ] };
key <AC09> { [ l, L, lstroke, Lstroke ] };
key <AC10> { [ semicolon, colon, dead_acute, dead_doubleacute ] };
diff --git a/xorg-server/xkeyboard-config/symbols/me b/xorg-server/xkeyboard-config/symbols/me
index dd81567c2..54d63e130 100644
--- a/xorg-server/xkeyboard-config/symbols/me
+++ b/xorg-server/xkeyboard-config/symbols/me
@@ -7,8 +7,10 @@ default partial alphanumeric_keys
xkb_symbols "basic" {
include "rs(latin)"
name[Group1]= "Montenegrin";
-};
+ key <AD06> { [ any, any, zacute, Zacute ] }; // z
+ key <AC02> { [ any, any, sacute, Sacute ] }; // s
+};
partial alphanumeric_keys
xkb_symbols "cyrillic" {
@@ -16,7 +18,6 @@ xkb_symbols "cyrillic" {
name[Group1]= "Montenegrin (Cyrillic)";
};
-
partial alphanumeric_keys
xkb_symbols "cyrillicyz" {
include "rs(yz)"
@@ -27,18 +28,27 @@ partial alphanumeric_keys
xkb_symbols "latinunicode" {
include "rs(latinunicode)"
name[Group1]= "Montenegrin (Latin Unicode)";
+
+ key <AD06> { [ any, any, zacute, Zacute ] }; // z
+ key <AC02> { [ any, any, sacute, Sacute ] }; // s
};
partial alphanumeric_keys
xkb_symbols "latinyz" {
include "rs(latinyz)"
name[Group1]= "Montenegrin (Latin qwerty)";
+
+ key <AB02> { [ any, any, zacute, Zacute ] }; // z
+ key <AC02> { [ any, any, sacute, Sacute ] }; // s
};
partial alphanumeric_keys
xkb_symbols "latinunicodeyz" {
include "rs(latinunicodeyz)"
name[Group1]= "Montenegrin (Latin Unicode qwerty)";
+
+ key <AB02> { [ any, any, zacute, Zacute ] }; // z
+ key <AC02> { [ any, any, sacute, Sacute ] }; // s
};
xkb_symbols "cyrillicalternatequotes" {
@@ -49,4 +59,8 @@ xkb_symbols "cyrillicalternatequotes" {
xkb_symbols "latinalternatequotes" {
include "rs(latinalternatequotes)"
name[Group1]= "Montenegrin (Latin with guillemets)";
+
+ key <AD06> { [ any, any, zacute, Zacute ] }; // z
+ key <AC02> { [ any, any, sacute, Sacute ] }; // s
+ key <LSGT> { [ any, any, guillemotleft, guillemotright ] }; // <
};