aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server')
-rw-r--r--xorg-server/Xext/panoramiX.c14
-rw-r--r--xorg-server/Xext/sync.c13
-rw-r--r--xorg-server/Xext/xvdisp.c8
-rw-r--r--xorg-server/Xi/exevents.c33
-rw-r--r--xorg-server/composite/compext.c7
-rw-r--r--xorg-server/configure.ac17
-rw-r--r--xorg-server/dix/events.c3
-rw-r--r--xorg-server/dix/main.c2
-rw-r--r--xorg-server/dix/touch.c3
-rw-r--r--xorg-server/dix/window.c4
-rw-r--r--xorg-server/fb/fbpict.c8
-rw-r--r--xorg-server/glx/extension_string.c2
-rw-r--r--xorg-server/glx/extension_string.h5
-rw-r--r--xorg-server/glx/glxcmds.c26
-rw-r--r--xorg-server/glx/glxdri.c2
-rw-r--r--xorg-server/glx/glxdri2.c11
-rw-r--r--xorg-server/glx/glxdricommon.c4
-rw-r--r--xorg-server/glx/glxscreens.h3
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyr.c7
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrinit.c6
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrvideo.c24
-rw-r--r--xorg-server/hw/kdrive/ephyr/hostx.c43
-rw-r--r--xorg-server/hw/kdrive/ephyr/hostx.h3
-rw-r--r--xorg-server/hw/kdrive/fbdev/fbdev.c10
-rw-r--r--xorg-server/hw/kdrive/linux/mouse.c6
-rw-r--r--xorg-server/hw/kdrive/src/kinput.c8
-rw-r--r--xorg-server/hw/kdrive/src/kxv.c2
-rw-r--r--xorg-server/hw/xfree86/common/xf86Events.c1
-rw-r--r--xorg-server/hw/xfree86/common/xf86Mode.c17
-rw-r--r--xorg-server/hw/xfree86/common/xf86Option.c2
-rw-r--r--xorg-server/hw/xfree86/common/xf86fbman.c12
-rw-r--r--xorg-server/hw/xfree86/common/xf86xvmc.c4
-rw-r--r--xorg-server/hw/xfree86/ddc/ddc.c7
-rw-r--r--xorg-server/hw/xfree86/ramdac/xf86Cursor.c1
-rw-r--r--xorg-server/hw/xquartz/GL/visualConfigs.c3
-rw-r--r--xorg-server/hw/xwin/glx/indirect.c2
-rw-r--r--xorg-server/include/dix-config.h.in3
-rw-r--r--xorg-server/include/input.h5
-rw-r--r--xorg-server/include/list.h2
-rw-r--r--xorg-server/os/Makefile.am5
-rw-r--r--xorg-server/os/backtrace.c75
-rw-r--r--xorg-server/os/log.c4
-rw-r--r--xorg-server/randr/rrcrtc.c9
-rw-r--r--xorg-server/xfixes/cursor.c10
-rw-r--r--xorg-server/xfixes/xfixesint.h2
-rw-r--r--xorg-server/xkb/xkb.c3
-rw-r--r--xorg-server/xkb/xkbActions.c149
47 files changed, 360 insertions, 230 deletions
diff --git a/xorg-server/Xext/panoramiX.c b/xorg-server/Xext/panoramiX.c
index be475f7f4..7f888e38d 100644
--- a/xorg-server/Xext/panoramiX.c
+++ b/xorg-server/Xext/panoramiX.c
@@ -596,7 +596,7 @@ Bool
PanoramiXCreateConnectionBlock(void)
{
int i, j, length;
- Bool disableBackingStore = FALSE;
+ Bool disable_backing_store = FALSE;
int old_width, old_height;
float width_mult, height_mult;
xWindowRoot *root;
@@ -622,10 +622,10 @@ PanoramiXCreateConnectionBlock(void)
}
if (pScreen->backingStoreSupport !=
screenInfo.screens[0]->backingStoreSupport)
- disableBackingStore = TRUE;
+ disable_backing_store = TRUE;
}
- if (disableBackingStore) {
+ if (disable_backing_store) {
for (i = 0; i < screenInfo.numScreens; i++) {
pScreen = screenInfo.screens[i];
pScreen->backingStoreSupport = NotUseful;
@@ -831,15 +831,15 @@ PanoramiXConsolidate(void)
saver->type = XRT_WINDOW;
FOR_NSCREENS(i) {
- ScreenPtr pScreen = screenInfo.screens[i];
+ ScreenPtr scr = screenInfo.screens[i];
- root->info[i].id = pScreen->root->drawable.id;
+ root->info[i].id = scr->root->drawable.id;
root->u.win.class = InputOutput;
root->u.win.root = TRUE;
- saver->info[i].id = pScreen->screensaver.wid;
+ saver->info[i].id = scr->screensaver.wid;
saver->u.win.class = InputOutput;
saver->u.win.root = TRUE;
- defmap->info[i].id = pScreen->defColormap;
+ defmap->info[i].id = scr->defColormap;
}
AddResource(root->info[0].id, XRT_WINDOW, root);
diff --git a/xorg-server/Xext/sync.c b/xorg-server/Xext/sync.c
index 4d11992bb..9ae5b3981 100644
--- a/xorg-server/Xext/sync.c
+++ b/xorg-server/Xext/sync.c
@@ -2747,7 +2747,6 @@ init_system_idle_counter(const char *name, int deviceid)
{
CARD64 resolution;
XSyncValue idle;
- IdleCounterPriv *priv = malloc(sizeof(IdleCounterPriv));
SyncCounter *idle_time_counter;
IdleTimeQueryValue(NULL, &idle);
@@ -2758,10 +2757,14 @@ init_system_idle_counter(const char *name, int deviceid)
IdleTimeQueryValue,
IdleTimeBracketValues);
- priv->deviceid = deviceid;
- priv->value_less = priv->value_greater = NULL;
+ if (idle_time_counter != NULL) {
+ IdleCounterPriv *priv = malloc(sizeof(IdleCounterPriv));
- idle_time_counter->pSysCounterInfo->private = priv;
+ priv->value_less = priv->value_greater = NULL;
+ priv->deviceid = deviceid;
+
+ idle_time_counter->pSysCounterInfo->private = priv;
+ }
return idle_time_counter;
}
@@ -2786,6 +2789,6 @@ void SyncRemoveDeviceIdleTime(SyncCounter *counter)
/* FreeAllResources() frees all system counters before the devices are
shut down, check if there are any left before freeing the device's
counter */
- if (!xorg_list_is_empty(&SysCounterList))
+ if (counter && !xorg_list_is_empty(&SysCounterList))
xorg_list_del(&counter->pSysCounterInfo->entry);
}
diff --git a/xorg-server/Xext/xvdisp.c b/xorg-server/Xext/xvdisp.c
index 31b77839f..787729387 100644
--- a/xorg-server/Xext/xvdisp.c
+++ b/xorg-server/Xext/xvdisp.c
@@ -702,7 +702,7 @@ ProcXvUngrabPort(ClientPtr client)
static int
ProcXvStopVideo(ClientPtr client)
{
- int status, rc;
+ int status, ret;
DrawablePtr pDraw;
XvPortPtr pPort;
@@ -716,9 +716,9 @@ ProcXvStopVideo(ClientPtr client)
return status;
}
- rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
- if (rc != Success)
- return rc;
+ ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
+ if (ret != Success)
+ return ret;
return XvdiStopVideo(client, pPort, pDraw);
}
diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c
index 609b1268f..6779139b5 100644
--- a/xorg-server/Xi/exevents.c
+++ b/xorg-server/Xi/exevents.c
@@ -1126,20 +1126,22 @@ static void
TouchPuntToNextOwner(DeviceIntPtr dev, TouchPointInfoPtr ti,
TouchOwnershipEvent *ev)
{
+ TouchListener *listener = &ti->listeners[0]; /* new owner */
+
/* Deliver the ownership */
- if (ti->listeners[0].state == LISTENER_AWAITING_OWNER ||
- ti->listeners[0].state == LISTENER_EARLY_ACCEPT)
+ if (listener->state == LISTENER_AWAITING_OWNER ||
+ listener->state == LISTENER_EARLY_ACCEPT)
DeliverTouchEvents(dev, ti, (InternalEvent *) ev,
- ti->listeners[0].listener);
- else if (ti->listeners[0].state == LISTENER_AWAITING_BEGIN) {
+ listener->listener);
+ else if (listener->state == LISTENER_AWAITING_BEGIN) {
/* We can't punt to a pointer listener unless all older pointer
* emulated touches have been seen already. */
- if ((ti->listeners[0].type == LISTENER_POINTER_GRAB ||
- ti->listeners[0].type == LISTENER_POINTER_REGULAR) &&
+ if ((listener->type == LISTENER_POINTER_GRAB ||
+ listener->type == LISTENER_POINTER_REGULAR) &&
ti != FindOldestPointerEmulatedTouch(dev))
return;
- TouchEventHistoryReplay(ti, dev, ti->listeners[0].listener);
+ TouchEventHistoryReplay(ti, dev, listener->listener);
}
/* If we've just removed the last grab and the touch has physically
@@ -1150,7 +1152,7 @@ TouchPuntToNextOwner(DeviceIntPtr dev, TouchPointInfoPtr ti,
return;
}
- if (ti->listeners[0].state == LISTENER_EARLY_ACCEPT)
+ if (listener->state == LISTENER_EARLY_ACCEPT)
ActivateEarlyAccept(dev, ti);
}
@@ -1376,7 +1378,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
/* We don't deliver pointer events to non-owners */
if (!TouchResourceIsOwner(ti, listener->listener))
- return Success;
+ return !Success;
nevents = TouchConvertToPointerEvent(ev, &motion, &button);
BUG_RETURN_VAL(nevents == 0, BadValue);
@@ -1398,7 +1400,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
/* 'grab' is the passive grab, but if the grab isn't active,
* don't deliver */
if (!dev->deviceGrab.grab)
- return Success;
+ return !Success;
if (grab->ownerEvents) {
WindowPtr focus = NullWindow;
@@ -1896,13 +1898,16 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
goto out;
}
+ /* A client is waiting for the begin, don't give it a TouchEnd */
if (listener->state == LISTENER_AWAITING_BEGIN) {
listener->state = LISTENER_HAS_END;
goto out;
}
/* Event in response to reject */
- if (ev->device_event.flags & TOUCH_REJECT) {
+ if (ev->device_event.flags & TOUCH_REJECT ||
+ (ev->device_event.flags & TOUCH_ACCEPT && !TouchResourceIsOwner(ti, listener->listener))) {
+ /* Touch has been rejected, or accepted by its owner which is not this listener */
if (listener->state != LISTENER_HAS_END)
rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
listener->state = LISTENER_HAS_END;
@@ -1925,12 +1930,6 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
if (normal_end)
listener->state = LISTENER_HAS_END;
}
- else if (ev->device_event.flags & TOUCH_ACCEPT) {
- /* Touch has been accepted by its owner, which is not this listener */
- if (listener->state != LISTENER_HAS_END)
- rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
- listener->state = LISTENER_HAS_END;
- }
out:
return rc;
diff --git a/xorg-server/composite/compext.c b/xorg-server/composite/compext.c
index 8641eff5e..e4821c5fc 100644
--- a/xorg-server/composite/compext.c
+++ b/xorg-server/composite/compext.c
@@ -803,6 +803,7 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
RT_WINDOW, client, DixGetAttrAccess);
if (rc != Success) {
client->errorValue = stuff->window;
+ free(overlayWin);
return rc;
}
pScreen = pWin->drawable.pScreen;
@@ -812,8 +813,10 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
* interest in the overlay window
*/
pOc = compCreateOverlayClient(pScreen, client);
- if (pOc == NULL)
+ if (pOc == NULL) {
+ free(overlayWin);
return BadAlloc;
+ }
/*
* Make sure the overlay window exists
@@ -822,6 +825,7 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
if (cs->pOverlayWin == NULL)
if (!compCreateOverlayWindow(pScreen)) {
FreeResource(pOc->resource, RT_NONE);
+ free(overlayWin);
return BadAlloc;
}
@@ -831,6 +835,7 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
DixGetAttrAccess);
if (rc != Success) {
FreeResource(pOc->resource, RT_NONE);
+ free(overlayWin);
return rc;
}
}
diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac
index 6e1ff65c4..e0750bbcc 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.14.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2013-03-05"
-RELEASE_NAME="Keemun Mao Feng"
+AC_INIT([xorg-server], 1.14.99.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2013-03-18"
+RELEASE_NAME="Pok Pok Meyer Lemon"
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
@@ -308,6 +308,13 @@ AC_CHECK_HEADER([execinfo.h],[
])]
)
+PKG_CHECK_MODULES(LIBUNWIND, libunwind, [HAVE_LIBUNWIND=yes], [HAVE_LIBUNWIND=no])
+if test "x$HAVE_LIBUNWIND" = xyes; then
+ AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
+fi
+AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$HAVE_LIBUNWIND" = xyes])
+
+
dnl ---------------------------------------------------------------------------
dnl Bus options and CPU capabilities. Replaces logic in
dnl hw/xfree86/os-support/bus/Makefile.am, among others.
@@ -788,7 +795,7 @@ XPROTO="xproto >= 7.0.22"
RANDRPROTO="randrproto >= 1.4.0"
RENDERPROTO="renderproto >= 0.11"
XEXTPROTO="xextproto >= 7.1.99"
-INPUTPROTO="inputproto >= 2.2.99.1"
+INPUTPROTO="inputproto >= 2.3"
KBPROTO="kbproto >= 1.0.3"
FONTSPROTO="fontsproto"
FIXESPROTO="fixesproto >= 5.0"
@@ -1336,7 +1343,7 @@ AC_DEFINE(BIGREQS, 1, [Support BigRequests extension])
if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then
DIX_LIB='$(top_builddir)/dix/dix.O'
- OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS)'
+ OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS) $(LIBUNWIND_LIBS)'
else
DIX_LIB='$(top_builddir)/dix/libdix.la'
OS_LIB='$(top_builddir)/os/libos.la'
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index 2682ecd46..051205233 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -1200,6 +1200,9 @@ PlayReleasedEvents(void)
case ET_KeyRelease:
case ET_ProximityIn:
case ET_ProximityOut:
+ case ET_TouchBegin:
+ case ET_TouchUpdate:
+ case ET_TouchEnd:
ev->root_x += screenInfo.screens[0]->x -
pDev->spriteInfo->sprite->screen->x;
ev->root_y += screenInfo.screens[0]->y -
diff --git a/xorg-server/dix/main.c b/xorg-server/dix/main.c
index fb935c969..bea1a8d5a 100644
--- a/xorg-server/dix/main.c
+++ b/xorg-server/dix/main.c
@@ -357,6 +357,8 @@ main(int argc, char *argv[], char *envp[])
FreeFonts();
+ FreeAllAtoms();
+
FreeAuditTimer();
if (dispatchException & DE_TERMINATE) {
diff --git a/xorg-server/dix/touch.c b/xorg-server/dix/touch.c
index 0db842c65..891cc7803 100644
--- a/xorg-server/dix/touch.c
+++ b/xorg-server/dix/touch.c
@@ -902,7 +902,8 @@ TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev)
}
/**
- * Remove the touch pointer grab from the device. Called from AllowSome()
+ * Remove the touch pointer grab from the device. Called from
+ * DeactivatePointerGrab()
*/
void
TouchRemovePointerGrab(DeviceIntPtr dev)
diff --git a/xorg-server/dix/window.c b/xorg-server/dix/window.c
index a5b28a630..a9297f3c8 100644
--- a/xorg-server/dix/window.c
+++ b/xorg-server/dix/window.c
@@ -1431,6 +1431,8 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
}
}
+ CursorVisible = TRUE;
+
if (pWin->realized)
WindowHasNewCursor(pWin);
@@ -3430,6 +3432,8 @@ ChangeWindowDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev, CursorPtr pCursor)
}
out:
+ CursorVisible = TRUE;
+
if (pWin->realized)
WindowHasNewCursor(pWin);
diff --git a/xorg-server/fb/fbpict.c b/xorg-server/fb/fbpict.c
index 2804ff481..b50385805 100644
--- a/xorg-server/fb/fbpict.c
+++ b/xorg-server/fb/fbpict.c
@@ -185,19 +185,15 @@ fbGlyphs(CARD8 op,
if (maskFormat) {
pixman_format_code_t format;
pixman_box32_t extents;
- int x, y;
format = maskFormat->format | (maskFormat->depth << 24);
pixman_glyph_get_extents(glyphCache, n_glyphs, pglyphs, &extents);
- x = extents.x1;
- y = extents.y1;
-
pixman_composite_glyphs(op, srcImage, dstImage, format,
xSrc + srcXoff + xDst, ySrc + srcYoff + yDst,
- x, y,
- x + dstXoff, y + dstYoff,
+ extents.x1, extents.y1,
+ extents.x1 + dstXoff, extents.y1 + dstYoff,
extents.x2 - extents.x1,
extents.y2 - extents.y1,
glyphCache, n_glyphs, pglyphs);
diff --git a/xorg-server/glx/extension_string.c b/xorg-server/glx/extension_string.c
index 544ca1f5e..58f930f75 100644
--- a/xorg-server/glx/extension_string.c
+++ b/xorg-server/glx/extension_string.c
@@ -71,9 +71,11 @@ static const struct extension_info known_glx_extensions[] = {
{ GLX(ARB_create_context), VER(0,0), N, },
{ GLX(ARB_create_context_profile), VER(0,0), N, },
{ GLX(ARB_create_context_robustness), VER(0,0), N, },
+ { GLX(ARB_framebuffer_sRGB), VER(0,0), N, },
{ GLX(ARB_multisample), VER(1,4), Y, },
{ GLX(EXT_create_context_es2_profile), VER(0,0), N, },
+ { GLX(EXT_framebuffer_sRGB), VER(0,0), N, },
{ GLX(EXT_import_context), VER(0,0), Y, },
{ GLX(EXT_texture_from_pixmap), VER(0,0), Y, },
{ GLX(EXT_visual_info), VER(0,0), Y, },
diff --git a/xorg-server/glx/extension_string.h b/xorg-server/glx/extension_string.h
index 7a4a8b1c2..81b7de372 100644
--- a/xorg-server/glx/extension_string.h
+++ b/xorg-server/glx/extension_string.h
@@ -39,6 +39,7 @@ enum {
ARB_create_context_bit = 0,
ARB_create_context_profile_bit,
ARB_create_context_robustness_bit,
+ ARB_framebuffer_sRGB_bit,
ARB_multisample_bit,
EXT_create_context_es2_profile_bit,
EXT_import_context_bit,
@@ -58,6 +59,10 @@ enum {
__NUM_GLX_EXTS,
};
+/* For extensions which have identical ARB and EXT implementation
+ * in GLX area, use one enabling bit for both. */
+#define EXT_framebuffer_sRGB_bit ARB_framebuffer_sRGB_bit
+
#define __GLX_EXT_BYTES ((__NUM_GLX_EXTS + 7) / 8)
extern int __glXGetExtensionString(const unsigned char *enable_bits,
diff --git a/xorg-server/glx/glxcmds.c b/xorg-server/glx/glxcmds.c
index c1f4e22f8..5b7a628cc 100644
--- a/xorg-server/glx/glxcmds.c
+++ b/xorg-server/glx/glxcmds.c
@@ -913,7 +913,7 @@ __glXDisp_CopyContext(__GLXclientState * cl, GLbyte * pc)
enum {
GLX_VIS_CONFIG_UNPAIRED = 18,
- GLX_VIS_CONFIG_PAIRED = 20
+ GLX_VIS_CONFIG_PAIRED = 22
};
enum {
@@ -1005,8 +1005,17 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
buf[p++] = modes->samples;
buf[p++] = GLX_SAMPLE_BUFFERS_SGIS;
buf[p++] = modes->sampleBuffers;
- buf[p++] = 0; /* copy over visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)? */
- buf[p++] = 0;
+ /* Add attribute only if its value is not default. */
+ if (modes->sRGBCapable != GL_FALSE) {
+ buf[p++] = GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT;
+ buf[p++] = modes->sRGBCapable;
+ }
+ /* Don't add visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)?
+ * Pad the remaining place with zeroes, so that attributes count is constant. */
+ while (p < GLX_VIS_CONFIG_TOTAL) {
+ buf[p++] = 0;
+ buf[p++] = 0;
+ }
assert(p == GLX_VIS_CONFIG_TOTAL);
if (client->swapped) {
@@ -1017,7 +1026,7 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
return Success;
}
-#define __GLX_TOTAL_FBCONFIG_ATTRIBS (36)
+#define __GLX_TOTAL_FBCONFIG_ATTRIBS (37)
#define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2)
/**
* Send the set of GLXFBConfigs to the client. There is not currently
@@ -1109,6 +1118,15 @@ DoGetFBConfigs(__GLXclientState * cl, unsigned screen)
WRITE_PAIR(GLX_BIND_TO_MIPMAP_TEXTURE_EXT, modes->bindToMipmapTexture);
WRITE_PAIR(GLX_BIND_TO_TEXTURE_TARGETS_EXT,
modes->bindToTextureTargets);
+ /* Add attribute only if its value is not default. */
+ if (modes->sRGBCapable != GL_FALSE) {
+ WRITE_PAIR(GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, modes->sRGBCapable);
+ }
+ /* Pad the remaining place with zeroes, so that attributes count is constant. */
+ while (p < __GLX_FBCONFIG_ATTRIBS_LENGTH) {
+ WRITE_PAIR(0, 0);
+ }
+ assert(p == __GLX_FBCONFIG_ATTRIBS_LENGTH);
if (client->swapped) {
__GLX_SWAP_INT_ARRAY(buf, __GLX_FBCONFIG_ATTRIBS_LENGTH);
diff --git a/xorg-server/glx/glxdri.c b/xorg-server/glx/glxdri.c
index da4646845..a997e2f8a 100644
--- a/xorg-server/glx/glxdri.c
+++ b/xorg-server/glx/glxdri.c
@@ -971,6 +971,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
size_t buffer_size;
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+ framebuffer.base = NULL;
+
if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") ||
!DRIQueryDirectRenderingCapable(pScreen, &isCapable) || !isCapable) {
LogMessage(X_INFO,
diff --git a/xorg-server/glx/glxdri2.c b/xorg-server/glx/glxdri2.c
index b26e501dc..e07cb5632 100644
--- a/xorg-server/glx/glxdri2.c
+++ b/xorg-server/glx/glxdri2.c
@@ -857,8 +857,6 @@ initializeExtensions(__GLXDRIscreen * screen)
__glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer");
LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n");
- __glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event");
- LogMessage(X_INFO, "AIGLX: enabled GLX_INTEL_swap_event\n");
#if __DRI_DRI2_VERSION >= 3
if (screen->dri2->base.version >= 3) {
@@ -876,12 +874,21 @@ initializeExtensions(__GLXDRIscreen * screen)
#endif
if (DRI2HasSwapControl(pScreen)) {
+ __glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event");
__glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_swap_control");
__glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_swap_control");
+ LogMessage(X_INFO, "AIGLX: enabled GLX_INTEL_swap_event\n");
LogMessage(X_INFO,
"AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control\n");
}
+ /* enable EXT_framebuffer_sRGB extension (even if there are no sRGB capable fbconfigs) */
+ {
+ __glXEnableExtension(screen->glx_enable_bits,
+ "GLX_EXT_framebuffer_sRGB");
+ LogMessage(X_INFO, "AIGLX: enabled GLX_EXT_framebuffer_sRGB\n");
+ }
+
for (i = 0; extensions[i]; i++) {
#ifdef __DRI_READ_DRAWABLE
if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
diff --git a/xorg-server/glx/glxdricommon.c b/xorg-server/glx/glxdricommon.c
index c90f38098..b027f2498 100644
--- a/xorg-server/glx/glxdricommon.c
+++ b/xorg-server/glx/glxdricommon.c
@@ -105,7 +105,9 @@ __ATTRIB(__DRI_ATTRIB_BUFFER_SIZE, rgbBits),
__ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGB, bindToTextureRgb),
__ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGBA, bindToTextureRgba),
__ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE, bindToMipmapTexture),
- __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),};
+ __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),
+ __ATTRIB(__DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE, sRGBCapable),
+ };
static void
setScalar(__GLXconfig * config, unsigned int attrib, unsigned int value)
diff --git a/xorg-server/glx/glxscreens.h b/xorg-server/glx/glxscreens.h
index b29df58a5..0a7b6043e 100644
--- a/xorg-server/glx/glxscreens.h
+++ b/xorg-server/glx/glxscreens.h
@@ -102,6 +102,9 @@ struct __GLXconfig {
GLint bindToMipmapTexture;
GLint bindToTextureTargets;
GLint yInverted;
+
+ /* ARB_framebuffer_sRGB */
+ GLint sRGBCapable;
};
GLint glxConvertToXVisualType(int visualType);
diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.c b/xorg-server/hw/kdrive/ephyr/ephyr.c
index e6520d035..02d497073 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyr.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyr.c
@@ -56,6 +56,7 @@ typedef struct _EphyrInputPrivate {
} EphyrKbdPrivate, EphyrPointerPrivate;
Bool EphyrWantGrayScale = 0;
+Bool EphyrWantResize = 0;
Bool
ephyrInitialize(KdCardInfo * card, EphyrPriv * priv)
@@ -237,13 +238,11 @@ ephyrMapFramebuffer(KdScreenInfo * screen)
KdComputePointerMatrix(&m, ephyrRandr, screen->width, screen->height);
KdSetPointerMatrix(&m);
- priv->bytes_per_line =
- ((screen->width * screen->fb.bitsPerPixel + 31) >> 5) << 2;
-
buffer_height = ephyrBufferHeight(screen);
priv->base =
- hostx_screen_init(screen, screen->width, screen->height, buffer_height);
+ hostx_screen_init(screen, screen->width, screen->height, buffer_height,
+ &priv->bytes_per_line, &screen->fb.bitsPerPixel);
if ((scrpriv->randr & RR_Rotate_0) && !(scrpriv->randr & RR_Reflect_All)) {
scrpriv->shadow = FALSE;
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrinit.c b/xorg-server/hw/kdrive/ephyr/ephyrinit.c
index 5e2eb672f..adacac949 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrinit.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyrinit.c
@@ -31,6 +31,7 @@
extern Window EphyrPreExistingHostWin;
extern Bool EphyrWantGrayScale;
+extern Bool EphyrWantResize;
extern Bool kdHasPointer;
extern Bool kdHasKbd;
@@ -116,6 +117,7 @@ ddxUseMsg(void)
ErrorF("-host-cursor Re-use exisiting X host server cursor\n");
ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n");
ErrorF("-grayscale Simulate 8bit grayscale\n");
+ ErrorF("-resizeable Make Xephyr windows resizeable\n");
ErrorF
("-fakexa Simulate acceleration using software rendering\n");
ErrorF("-verbosity <level> Set log verbosity level\n");
@@ -210,6 +212,10 @@ ddxProcessArgument(int argc, char **argv, int i)
EphyrWantGrayScale = 1;
return 1;
}
+ else if (!strcmp(argv[i], "-resizeable")) {
+ EphyrWantResize = 1;
+ return 1;
+ }
else if (!strcmp(argv[i], "-fakexa")) {
ephyrFuncs.initAccel = ephyrDrawInit;
ephyrFuncs.enableAccel = ephyrDrawEnable;
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrvideo.c b/xorg-server/hw/kdrive/ephyr/ephyrvideo.c
index 55dbd2e3a..dfc29f533 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrvideo.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyrvideo.c
@@ -1006,7 +1006,6 @@ ephyrPutVideo(KdScreenInfo * a_info,
EphyrPortPriv *port_priv = a_port_priv;
BoxRec clipped_area, dst_box;
int result = BadImplementation;
- int drw_x = 0, drw_y = 0, drw_w = 0, drw_h = 0;
EPHYR_RETURN_VAL_IF_FAIL(a_info->pScreen, BadValue);
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
@@ -1024,11 +1023,6 @@ ephyrPutVideo(KdScreenInfo * a_info,
goto out;
}
- drw_x = clipped_area.x1;
- drw_y = clipped_area.y1;
- drw_w = clipped_area.x2 - clipped_area.x1;
- drw_h = clipped_area.y2 - clipped_area.y1;
-
if (!ephyrHostXVPutVideo(a_info->pScreen->myNum,
port_priv->port_number,
a_vid_x, a_vid_y, a_vid_w, a_vid_h,
@@ -1055,7 +1049,6 @@ ephyrGetVideo(KdScreenInfo * a_info,
EphyrPortPriv *port_priv = a_port_priv;
BoxRec clipped_area, dst_box;
int result = BadImplementation;
- int drw_x = 0, drw_y = 0, drw_w = 0, drw_h = 0;
EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue);
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
@@ -1073,11 +1066,6 @@ ephyrGetVideo(KdScreenInfo * a_info,
goto out;
}
- drw_x = clipped_area.x1;
- drw_y = clipped_area.y1;
- drw_w = clipped_area.x2 - clipped_area.x1;
- drw_h = clipped_area.y2 - clipped_area.y1;
-
if (!ephyrHostXVGetVideo(a_info->pScreen->myNum,
port_priv->port_number,
a_vid_x, a_vid_y, a_vid_w, a_vid_h,
@@ -1104,7 +1092,6 @@ ephyrPutStill(KdScreenInfo * a_info,
EphyrPortPriv *port_priv = a_port_priv;
BoxRec clipped_area, dst_box;
int result = BadImplementation;
- int drw_x = 0, drw_y = 0, drw_w = 0, drw_h = 0;
EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue);
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
@@ -1122,11 +1109,6 @@ ephyrPutStill(KdScreenInfo * a_info,
goto out;
}
- drw_x = clipped_area.x1;
- drw_y = clipped_area.y1;
- drw_w = clipped_area.x2 - clipped_area.x1;
- drw_h = clipped_area.y2 - clipped_area.y1;
-
if (!ephyrHostXVPutStill(a_info->pScreen->myNum,
port_priv->port_number,
a_vid_x, a_vid_y, a_vid_w, a_vid_h,
@@ -1153,7 +1135,6 @@ ephyrGetStill(KdScreenInfo * a_info,
EphyrPortPriv *port_priv = a_port_priv;
BoxRec clipped_area, dst_box;
int result = BadImplementation;
- int drw_x = 0, drw_y = 0, drw_w = 0, drw_h = 0;
EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue);
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
@@ -1171,11 +1152,6 @@ ephyrGetStill(KdScreenInfo * a_info,
goto out;
}
- drw_x = clipped_area.x1;
- drw_y = clipped_area.y1;
- drw_w = clipped_area.x2 - clipped_area.x1;
- drw_h = clipped_area.y2 - clipped_area.y1;
-
if (!ephyrHostXVGetStill(a_info->pScreen->myNum,
port_priv->port_number,
a_vid_x, a_vid_y, a_vid_w, a_vid_h,
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c
index 157ac36b2..f2b458d90 100644
--- a/xorg-server/hw/kdrive/ephyr/hostx.c
+++ b/xorg-server/hw/kdrive/ephyr/hostx.c
@@ -117,6 +117,8 @@ extern EphyrKeySyms ephyrKeySyms;
extern int monitorResolution;
+extern Bool EphyrWantResize;
+
char *ephyrResName = NULL;
int ephyrResNameFromCmd = 0;
char *ephyrTitle = NULL;
@@ -617,7 +619,8 @@ hostx_set_cmap_entry(unsigned char idx,
*/
void *
hostx_screen_init(EphyrScreenInfo screen,
- int width, int height, int buffer_height)
+ int width, int height, int buffer_height,
+ int *bytes_per_line, int *bits_per_pixel)
{
int bitmap_pad;
Bool shm_success = False;
@@ -694,10 +697,13 @@ hostx_screen_init(EphyrScreenInfo screen,
malloc(host_screen->ximg->bytes_per_line * buffer_height);
}
+ *bytes_per_line = host_screen->ximg->bytes_per_line;
+ *bits_per_pixel = host_screen->ximg->bits_per_pixel;
+
XResizeWindow(HostX.dpy, host_screen->win, width, height);
/* Ask the WM to keep our size static */
- if (host_screen->win_pre_existing == None) {
+ if (host_screen->win_pre_existing == None && !EphyrWantResize) {
size_hints = XAllocSizeHints();
size_hints->max_width = size_hints->min_width = width;
size_hints->max_height = size_hints->min_height = height;
@@ -858,7 +864,7 @@ hostx_load_keymap(void)
(max_keycode - min_keycode + 1) *
width);
if (!ephyrKeySyms.map)
- return;
+ goto out;
for (i = 0; i < (max_keycode - min_keycode + 1); i++)
for (j = 0; j < width; j++)
@@ -871,6 +877,7 @@ hostx_load_keymap(void)
ephyrKeySyms.maxKeyCode = max_keycode;
ephyrKeySyms.mapWidth = width;
+ out:
XFree(keymap);
}
@@ -1011,19 +1018,27 @@ hostx_get_event(EphyrHostXEvent * ev)
case ConfigureNotify:
{
- struct EphyrHostScreen *host_screen =
- host_screen_from_window(xev.xconfigure.window);
-
- if (host_screen && host_screen->win_pre_existing != None) {
- ev->type = EPHYR_EV_CONFIGURE;
- ev->data.configure.width = xev.xconfigure.width;
- ev->data.configure.height = xev.xconfigure.height;
- ev->data.configure.window = xev.xconfigure.window;
- ev->data.configure.screen = host_screen->mynum;
- return 1;
+ struct EphyrHostScreen *host_screen;
+
+ /* event compression as for Expose events, cause
+ * we don't want to resize the framebuffer for
+ * every single change */
+ while (XCheckTypedWindowEvent(HostX.dpy, xev.xconfigure.window,
+ ConfigureNotify, &xev));
+ host_screen = host_screen_from_window(xev.xconfigure.window);
+
+ if (!host_screen ||
+ (host_screen->win_pre_existing == None && !EphyrWantResize)) {
+ return 0;
}
- return 0;
+ ev->type = EPHYR_EV_CONFIGURE;
+ ev->data.configure.width = xev.xconfigure.width;
+ ev->data.configure.height = xev.xconfigure.height;
+ ev->data.configure.window = xev.xconfigure.window;
+ ev->data.configure.screen = host_screen->mynum;
+
+ return 1;
}
default:
break;
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.h b/xorg-server/hw/kdrive/ephyr/hostx.h
index 31c4053aa..38b7b3768 100644
--- a/xorg-server/hw/kdrive/ephyr/hostx.h
+++ b/xorg-server/hw/kdrive/ephyr/hostx.h
@@ -193,7 +193,8 @@ hostx_set_cmap_entry(unsigned char idx,
unsigned char r, unsigned char g, unsigned char b);
void *hostx_screen_init(EphyrScreenInfo screen,
- int width, int height, int buffer_height);
+ int width, int height, int buffer_height,
+ int *bytes_per_line, int *bits_per_pixel);
void
diff --git a/xorg-server/hw/kdrive/fbdev/fbdev.c b/xorg-server/hw/kdrive/fbdev/fbdev.c
index fd14afa92..fb6e3a292 100644
--- a/xorg-server/hw/kdrive/fbdev/fbdev.c
+++ b/xorg-server/hw/kdrive/fbdev/fbdev.c
@@ -465,16 +465,6 @@ fbdevRandRSetConfig(ScreenPtr pScreen,
int oldheight;
int oldmmwidth;
int oldmmheight;
- int newwidth, newheight;
-
- if (screen->randr & (RR_Rotate_0 | RR_Rotate_180)) {
- newwidth = pSize->width;
- newheight = pSize->height;
- }
- else {
- newwidth = pSize->height;
- newheight = pSize->width;
- }
if (wasEnabled)
KdDisableScreen(pScreen);
diff --git a/xorg-server/hw/kdrive/linux/mouse.c b/xorg-server/hw/kdrive/linux/mouse.c
index c87507790..f4424478a 100644
--- a/xorg-server/hw/kdrive/linux/mouse.c
+++ b/xorg-server/hw/kdrive/linux/mouse.c
@@ -441,10 +441,8 @@ ps2SkipInit(KdPointerInfo * pi, int ninit, Bool ret_next)
{
Kmouse *km = pi->driverPrivate;
int c = -1;
- int skipping;
Bool waiting;
- skipping = 0;
waiting = FALSE;
while (ninit || ret_next) {
c = MouseReadByte(&km->iob, MOUSE_TIMEOUT);
@@ -469,8 +467,6 @@ static Bool
ps2Init(KdPointerInfo * pi)
{
Kmouse *km = pi->driverPrivate;
- int skipping;
- Bool waiting;
int id;
unsigned char *init;
int ninit;
@@ -483,8 +479,6 @@ ps2Init(KdPointerInfo * pi)
*/
if (!MouseWriteByte(km->iob.fd, PSMC_SEND_DEV_ID, 100))
return FALSE;
- skipping = 0;
- waiting = FALSE;
id = ps2SkipInit(pi, 0, TRUE);
switch (id) {
case 3:
diff --git a/xorg-server/hw/kdrive/src/kinput.c b/xorg-server/hw/kdrive/src/kinput.c
index b1068bbee..c30f1708d 100644
--- a/xorg-server/hw/kdrive/src/kinput.c
+++ b/xorg-server/hw/kdrive/src/kinput.c
@@ -1821,16 +1821,11 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo * ki,
unsigned char scan_code, unsigned char is_up)
{
unsigned char key_code;
- KeyClassPtr keyc = NULL;
- KeybdCtrl *ctrl = NULL;
int type;
if (!ki || !ki->dixdev || !ki->dixdev->kbdfeed || !ki->dixdev->key)
return;
- keyc = ki->dixdev->key;
- ctrl = &ki->dixdev->kbdfeed->ctrl;
-
if (scan_code >= ki->minScanCode && scan_code <= ki->maxScanCode) {
key_code = scan_code + KD_MIN_KEYCODE - ki->minScanCode;
@@ -1864,7 +1859,6 @@ void
KdEnqueuePointerEvent(KdPointerInfo * pi, unsigned long flags, int rx, int ry,
int rz)
{
- CARD32 ms;
unsigned char buttons;
int x, y, z;
int (*matrix)[3] = kdPointerMatrix.matrix;
@@ -1875,8 +1869,6 @@ KdEnqueuePointerEvent(KdPointerInfo * pi, unsigned long flags, int rx, int ry,
if (!pi)
return;
- ms = GetTimeInMillis();
-
/* we don't need to transform z, so we don't. */
if (flags & KD_MOUSE_DELTA) {
if (pi->transformCoordinates) {
diff --git a/xorg-server/hw/kdrive/src/kxv.c b/xorg-server/hw/kdrive/src/kxv.c
index cf656363d..22639728d 100644
--- a/xorg-server/hw/kdrive/src/kxv.c
+++ b/xorg-server/hw/kdrive/src/kxv.c
@@ -1174,7 +1174,6 @@ void
KdXVDisable(ScreenPtr pScreen)
{
XvScreenPtr pxvs;
- KdXVScreenPtr ScreenPriv;
XvAdaptorPtr pAdaptor;
XvPortPtr pPort;
XvPortRecPrivatePtr pPriv;
@@ -1184,7 +1183,6 @@ KdXVDisable(ScreenPtr pScreen)
return;
pxvs = GET_XV_SCREEN(pScreen);
- ScreenPriv = GET_KDXV_SCREEN(pScreen);
for (i = 0; i < pxvs->nAdaptors; i++) {
pAdaptor = &pxvs->pAdaptors[i];
diff --git a/xorg-server/hw/xfree86/common/xf86Events.c b/xorg-server/hw/xfree86/common/xf86Events.c
index d92174edf..055223310 100644
--- a/xorg-server/hw/xfree86/common/xf86Events.c
+++ b/xorg-server/hw/xfree86/common/xf86Events.c
@@ -413,7 +413,6 @@ static void
xf86VTSwitch(void)
{
int i;
- static int prevSIGIO;
InputInfoPtr pInfo;
IHPtr ih;
diff --git a/xorg-server/hw/xfree86/common/xf86Mode.c b/xorg-server/hw/xfree86/common/xf86Mode.c
index d80dec892..706ab64fc 100644
--- a/xorg-server/hw/xfree86/common/xf86Mode.c
+++ b/xorg-server/hw/xfree86/common/xf86Mode.c
@@ -1370,7 +1370,6 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
int saveType;
PixmapFormatRec *BankFormat;
ClockRangePtr cp;
- ClockRangePtr storeClockRanges;
int numTimings = 0;
range hsync[MAX_HSYNC];
range vrefresh[MAX_VREFRESH];
@@ -1492,16 +1491,14 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
/*
* Store the clockRanges for later use by the VidMode extension.
*/
- storeClockRanges = scrp->clockRanges;
- while (storeClockRanges != NULL) {
- storeClockRanges = storeClockRanges->next;
- }
- for (cp = clockRanges; cp != NULL; cp = cp->next,
- storeClockRanges = storeClockRanges->next) {
- storeClockRanges = xnfalloc(sizeof(ClockRange));
+ nt_list_for_each_entry(cp, clockRanges, next) {
+ ClockRangePtr newCR = xnfalloc(sizeof(ClockRange));
+ memcpy(newCR, cp, sizeof(ClockRange));
+ newCR->next = NULL;
if (scrp->clockRanges == NULL)
- scrp->clockRanges = storeClockRanges;
- memcpy(storeClockRanges, cp, sizeof(ClockRange));
+ scrp->clockRanges = newCR;
+ else
+ nt_list_append(newCR, scrp->clockRanges, ClockRange, next);
}
/* Determine which pixmap format to pass to scanLineWidth() */
diff --git a/xorg-server/hw/xfree86/common/xf86Option.c b/xorg-server/hw/xfree86/common/xf86Option.c
index 40c9d15f4..607c33354 100644
--- a/xorg-server/hw/xfree86/common/xf86Option.c
+++ b/xorg-server/hw/xfree86/common/xf86Option.c
@@ -743,7 +743,7 @@ xf86TokenToOptName(const OptionInfoRec * table, int token)
const OptionInfoRec *p;
p = xf86TokenToOptinfo(table, token);
- return p->name;
+ return p ? p->name : NULL;
}
Bool
diff --git a/xorg-server/hw/xfree86/common/xf86fbman.c b/xorg-server/hw/xfree86/common/xf86fbman.c
index c2e7bab9f..4da6af2b6 100644
--- a/xorg-server/hw/xfree86/common/xf86fbman.c
+++ b/xorg-server/hw/xfree86/common/xf86fbman.c
@@ -320,15 +320,17 @@ localRegisterFreeBoxCallback(ScreenPtr pScreen,
newCallbacks = realloc(offman->FreeBoxesUpdateCallback,
sizeof(FreeBoxCallbackProcPtr) *
(offman->NumCallbacks + 1));
+ if (!newCallbacks)
+ return FALSE;
+ else
+ offman->FreeBoxesUpdateCallback = newCallbacks;
newPrivates = realloc(offman->devPrivates,
sizeof(DevUnion) * (offman->NumCallbacks + 1));
-
- if (!newCallbacks || !newPrivates)
+ if (!newPrivates)
return FALSE;
-
- offman->FreeBoxesUpdateCallback = newCallbacks;
- offman->devPrivates = newPrivates;
+ else
+ offman->devPrivates = newPrivates;
offman->FreeBoxesUpdateCallback[offman->NumCallbacks] = FreeBoxCallback;
offman->devPrivates[offman->NumCallbacks].ptr = devPriv;
diff --git a/xorg-server/hw/xfree86/common/xf86xvmc.c b/xorg-server/hw/xfree86/common/xf86xvmc.c
index 78a32bfe1..3169c054c 100644
--- a/xorg-server/hw/xfree86/common/xf86xvmc.c
+++ b/xorg-server/hw/xfree86/common/xf86xvmc.c
@@ -158,8 +158,10 @@ xf86XvMCScreenInit(ScreenPtr pScreen,
if (!(pAdapt = malloc(sizeof(XvMCAdaptorRec) * num_adaptors)))
return FALSE;
- if (!dixRegisterPrivateKey(&XF86XvMCScreenKeyRec, PRIVATE_SCREEN, 0))
+ if (!dixRegisterPrivateKey(&XF86XvMCScreenKeyRec, PRIVATE_SCREEN, 0)) {
+ free(pAdapt);
return FALSE;
+ }
if (!(pScreenPriv = malloc(sizeof(xf86XvMCScreenRec)))) {
free(pAdapt);
diff --git a/xorg-server/hw/xfree86/ddc/ddc.c b/xorg-server/hw/xfree86/ddc/ddc.c
index 28c969646..44c1d535c 100644
--- a/xorg-server/hw/xfree86/ddc/ddc.c
+++ b/xorg-server/hw/xfree86/ddc/ddc.c
@@ -91,15 +91,16 @@ resort(unsigned char *s_block)
unsigned char *d_new, *d_ptr, *d_end, *s_ptr, *s_end;
unsigned char tmp;
+ s_ptr = find_header(s_block);
+ if (!s_ptr)
+ return NULL;
s_end = s_block + EDID1_LEN;
+
d_new = malloc(EDID1_LEN);
if (!d_new)
return NULL;
d_end = d_new + EDID1_LEN;
- s_ptr = find_header(s_block);
- if (!s_ptr)
- return NULL;
for (d_ptr = d_new; d_ptr < d_end; d_ptr++) {
tmp = *(s_ptr++);
*d_ptr = tmp;
diff --git a/xorg-server/hw/xfree86/ramdac/xf86Cursor.c b/xorg-server/hw/xfree86/ramdac/xf86Cursor.c
index 8d48a7542..d32aac1cf 100644
--- a/xorg-server/hw/xfree86/ramdac/xf86Cursor.c
+++ b/xorg-server/hw/xfree86/ramdac/xf86Cursor.c
@@ -16,7 +16,6 @@
* Externing inputInfo is not the nice way to do it but it works.
*/
#include "inputstr.h"
-extern InputInfo inputInfo;
DevPrivateKeyRec xf86CursorScreenKeyRec;
diff --git a/xorg-server/hw/xquartz/GL/visualConfigs.c b/xorg-server/hw/xquartz/GL/visualConfigs.c
index 03486cd66..a00abf29a 100644
--- a/xorg-server/hw/xquartz/GL/visualConfigs.c
+++ b/xorg-server/hw/xquartz/GL/visualConfigs.c
@@ -262,6 +262,9 @@ __GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
c->bindToTextureTargets = 0;
c->yInverted = 0;
+ /* EXT_framebuffer_sRGB */
+ c->sRGBCapable = GL_FALSE;
+
c = c->next;
}
}
diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c
index 00cef3673..14a47110a 100644
--- a/xorg-server/hw/xwin/glx/indirect.c
+++ b/xorg-server/hw/xwin/glx/indirect.c
@@ -2025,6 +2025,7 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen * screen)
c->base.bindToMipmapTexture = -1;
c->base.bindToTextureTargets = -1;
c->base.yInverted = -1;
+ c->base.sRGBCapable = 0;
n++;
@@ -2419,6 +2420,7 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen * screen)
GLX_TEXTURE_1D_BIT_EXT | GLX_TEXTURE_2D_BIT_EXT |
GLX_TEXTURE_RECTANGLE_BIT_EXT;
c->base.yInverted = -1;
+ c->base.sRGBCapable = 0;
n++;
diff --git a/xorg-server/include/dix-config.h.in b/xorg-server/include/dix-config.h.in
index e1cb9eb51..a643dfcc8 100644
--- a/xorg-server/include/dix-config.h.in
+++ b/xorg-server/include/dix-config.h.in
@@ -60,6 +60,9 @@
/* Has backtrace support */
#undef HAVE_BACKTRACE
+/* Has libunwind support */
+#undef HAVE_LIBUNWIND
+
/* Define to 1 if you have the <byteswap.h> header file. */
#undef HAVE_BYTESWAP_H
diff --git a/xorg-server/include/input.h b/xorg-server/include/input.h
index 5c65597e4..304895ffc 100644
--- a/xorg-server/include/input.h
+++ b/xorg-server/include/input.h
@@ -638,6 +638,11 @@ extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, int axis, int mode);
xfixes/cursor.c uses it to determine if the cursor is enabled */
extern Bool EnableCursor;
+/* Set to FALSE by default - ChangeWindowAttributes sets it to TRUE on
+ * CWCursor, xfixes/cursor.c uses it to determine if the cursor is enabled
+ */
+extern Bool CursorVisible;
+
extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators);
extern _X_EXPORT void valuator_mask_free(ValuatorMask **mask);
extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,
diff --git a/xorg-server/include/list.h b/xorg-server/include/list.h
index 067c6794f..11de7c561 100644
--- a/xorg-server/include/list.h
+++ b/xorg-server/include/list.h
@@ -119,7 +119,7 @@ struct xorg_list {
*
* @param The list to initialized.
*/
-static void
+static inline void
xorg_list_init(struct xorg_list *list)
{
list->next = list->prev = list;
diff --git a/xorg-server/os/Makefile.am b/xorg-server/os/Makefile.am
index 88914852f..364b6da2d 100644
--- a/xorg-server/os/Makefile.am
+++ b/xorg-server/os/Makefile.am
@@ -34,6 +34,11 @@ if XDMCP
libos_la_SOURCES += $(XDMCP_SRCS)
endif
+if HAVE_LIBUNWIND
+AM_CFLAGS += $(LIBUNWIND_CFLAGS)
+libos_la_LIBADD += $(LIBUNWIND_LIBS)
+endif
+
EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS)
if SPECIAL_DTRACE_OBJECTS
diff --git a/xorg-server/os/backtrace.c b/xorg-server/os/backtrace.c
index daac60cf6..426f9b15b 100644
--- a/xorg-server/os/backtrace.c
+++ b/xorg-server/os/backtrace.c
@@ -30,6 +30,80 @@
#include <errno.h>
#include <string.h>
+#ifdef HAVE_LIBUNWIND
+
+#define UNW_LOCAL_ONLY
+#include <libunwind.h>
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+#include <dlfcn.h>
+
+void
+xorg_backtrace(void)
+{
+ unw_cursor_t cursor;
+ unw_context_t context;
+ unw_word_t off;
+ unw_proc_info_t pip;
+ int ret, i = 0;
+ char procname[256];
+ const char *filename;
+ Dl_info dlinfo;
+
+ pip.unwind_info = NULL;
+ ret = unw_getcontext(&context);
+ if (ret) {
+ ErrorFSigSafe("unw_getcontext failed: %s [%d]\n", unw_strerror(ret),
+ ret);
+ return;
+ }
+
+ ret = unw_init_local(&cursor, &context);
+ if (ret) {
+ ErrorFSigSafe("unw_init_local failed: %s [%d]\n", unw_strerror(ret),
+ ret);
+ return;
+ }
+
+ ErrorFSigSafe("\n");
+ ErrorFSigSafe("Backtrace:\n");
+ ret = unw_step(&cursor);
+ while (ret > 0) {
+ ret = unw_get_proc_info(&cursor, &pip);
+ if (ret) {
+ ErrorFSigSafe("unw_get_proc_info failed: %s [%d]\n",
+ unw_strerror(ret), ret);
+ break;
+ }
+
+ ret = unw_get_proc_name(&cursor, procname, 256, &off);
+ if (ret && ret != -UNW_ENOMEM) {
+ if (ret != -UNW_EUNSPEC)
+ ErrorFSigSafe("unw_get_proc_name failed: %s [%d]\n",
+ unw_strerror(ret), ret);
+ procname[0] = '?';
+ procname[1] = 0;
+ }
+
+ if (dladdr((void *)(pip.start_ip + off), &dlinfo) && dlinfo.dli_fname &&
+ *dlinfo.dli_fname)
+ filename = dlinfo.dli_fname;
+ else
+ filename = "?";
+
+ ErrorFSigSafe("%u: %s (%s%s+0x%x) [%p]\n", i++, filename, procname,
+ ret == -UNW_ENOMEM ? "..." : "", (int)off,
+ (void *)(pip.start_ip + off));
+
+ ret = unw_step(&cursor);
+ if (ret < 0)
+ ErrorFSigSafe("unw_step failed: %s [%d]\n", unw_strerror(ret), ret);
+ }
+ ErrorFSigSafe("\n");
+}
+#else /* HAVE_LIBUNWIND */
#ifdef HAVE_BACKTRACE
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@@ -246,3 +320,4 @@ xorg_backtrace(void)
#endif
#endif
+#endif
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c
index 95bd8cca9..dc6e2888b 100644
--- a/xorg-server/os/log.c
+++ b/xorg-server/os/log.c
@@ -279,6 +279,10 @@ LogSetParameter(LogParameter param, int value)
}
}
+/**
+ * Signal-safe snprintf, with some limitations over snprintf. Be careful
+ * which directives you use.
+ */
static int
pnprintf(char *string, size_t size, const char *f, va_list args)
{
diff --git a/xorg-server/randr/rrcrtc.c b/xorg-server/randr/rrcrtc.c
index 6e2eca5ad..721b05ac3 100644
--- a/xorg-server/randr/rrcrtc.c
+++ b/xorg-server/randr/rrcrtc.c
@@ -363,13 +363,12 @@ void
RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
{
ScreenPtr master = crtc->pScreen->current_master;
- int ret;
PixmapPtr mscreenpix;
rrScrPriv(crtc->pScreen);
mscreenpix = master->GetScreenPixmap(master);
- ret = pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL);
+ pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL);
if (crtc->scanout_pixmap) {
master->StopPixmapTracking(mscreenpix, crtc->scanout_pixmap);
/*
@@ -442,7 +441,7 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
RRCrtcPtr rr_crtc, int x, int y, int w, int h)
{
RegionRec root_pixmap_region, total_region, new_crtc_region;
- int i, c;
+ int c;
BoxRec newbox;
BoxPtr newsize;
ScreenPtr slave;
@@ -502,10 +501,8 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
new_height == screen_pixmap->drawable.height) {
ErrorF("adjust shatters %d %d\n", newsize->x1, newsize->x2);
} else {
- int ret;
rrScrPriv(pScreen);
- ret = pScrPriv->rrScreenSetSize(pScreen,
- new_width, new_height, 0, 0);
+ pScrPriv->rrScreenSetSize(pScreen, new_width, new_height, 0, 0);
}
/* set shatters TODO */
diff --git a/xorg-server/xfixes/cursor.c b/xorg-server/xfixes/cursor.c
index 568e717fa..90a026b28 100644
--- a/xorg-server/xfixes/cursor.c
+++ b/xorg-server/xfixes/cursor.c
@@ -129,8 +129,7 @@ typedef struct _CursorScreen {
#define Unwrap(as,s,elt,backup) (((backup) = (s)->elt), (s)->elt = (as)->elt)
/* The cursor doesn't show up until the first XDefineCursor() */
-static Bool CursorVisible = FALSE;
-
+Bool CursorVisible = FALSE;
Bool EnableCursor = TRUE;
static Bool
@@ -142,12 +141,7 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
Unwrap(cs, pScreen, DisplayCursor, backupProc);
- /*
- * Have to check ConnectionInfo to distinguish client requests from
- * initial root window setup. Not a great way to do it, I admit.
- */
- if (ConnectionInfo)
- CursorVisible = EnableCursor;
+ CursorVisible = CursorVisible && EnableCursor;
if (cs->pCursorHideCounts != NULL || !CursorVisible) {
ret = (*pScreen->DisplayCursor) (pDev, pScreen, NullCursor);
diff --git a/xorg-server/xfixes/xfixesint.h b/xorg-server/xfixes/xfixesint.h
index 334c71fbf..44e889040 100644
--- a/xorg-server/xfixes/xfixesint.h
+++ b/xorg-server/xfixes/xfixesint.h
@@ -291,8 +291,10 @@ int
SProcXFixesDestroyPointerBarrier(ClientPtr client);
/* Xinerama */
+#ifdef PANORAMIX
extern int (*PanoramiXSaveXFixesVector[XFixesNumberRequests]) (ClientPtr);
void PanoramiXFixesInit(void);
void PanoramiXFixesReset(void);
+#endif
#endif /* _XFIXESINT_H_ */
diff --git a/xorg-server/xkb/xkb.c b/xorg-server/xkb/xkb.c
index 7e51e4080..c78aceb78 100644
--- a/xorg-server/xkb/xkb.c
+++ b/xorg-server/xkb/xkb.c
@@ -3073,6 +3073,7 @@ XkbComputeGetIndicatorMapReplySize(XkbIndicatorPtr indicators,
nIndicators++;
}
rep->length = (nIndicators * SIZEOF(xkbIndicatorMapWireDesc)) / 4;
+ rep->nIndicators = nIndicators;
return Success;
}
@@ -3984,13 +3985,11 @@ _XkbSetNamesCheck(ClientPtr client, DeviceIntPtr dev,
xkbSetNamesReq * stuff, CARD32 *data)
{
XkbDescRec *xkb;
- XkbNamesRec *names;
CARD32 *tmp;
Atom bad;
tmp = data;
xkb = dev->key->xkbInfo->desc;
- names = xkb->names;
if (stuff->which & XkbKeyTypeNamesMask) {
int i;
diff --git a/xorg-server/xkb/xkbActions.c b/xorg-server/xkb/xkbActions.c
index 416de925d..e32005cf6 100644
--- a/xorg-server/xkb/xkbActions.c
+++ b/xorg-server/xkb/xkbActions.c
@@ -222,7 +222,6 @@ _XkbFilterSetState(XkbSrvInfoPtr xkbi,
#define LATCH_KEY_DOWN 1
#define LATCH_PENDING 2
-#define NO_LATCH 3
static int
_XkbFilterLatchState(XkbSrvInfoPtr xkbi,
@@ -230,6 +229,7 @@ _XkbFilterLatchState(XkbSrvInfoPtr xkbi,
{
if (filter->keycode == 0) { /* initial press */
+ AccessXCancelRepeatKey(xkbi,keycode);
filter->keycode = keycode;
filter->active = 1;
filter->filterOthers = 1;
@@ -250,91 +250,102 @@ _XkbFilterLatchState(XkbSrvInfoPtr xkbi,
else if (pAction && (filter->priv == LATCH_PENDING)) {
if (((1 << pAction->type) & XkbSA_BreakLatch) != 0) {
filter->active = 0;
- if (filter->upAction.type == XkbSA_LatchMods)
- xkbi->state.latched_mods &= ~filter->upAction.mods.mask;
- else
- xkbi->state.latched_group -=
- XkbSAGroup(&filter->upAction.group);
- }
- else if ((pAction->type == filter->upAction.type) &&
- (pAction->mods.flags == filter->upAction.mods.flags) &&
- (pAction->mods.mask == filter->upAction.mods.mask)) {
- if (filter->upAction.mods.flags & XkbSA_LatchToLock) {
- XkbControlsPtr ctrls = xkbi->desc->ctrls;
-
- if (filter->upAction.type == XkbSA_LatchMods)
- pAction->mods.type = XkbSA_LockMods;
- else
- pAction->group.type = XkbSA_LockGroup;
- if (XkbAX_NeedFeedback(ctrls, XkbAX_StickyKeysFBMask) &&
- (ctrls->enabled_ctrls & XkbStickyKeysMask)) {
- XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_LOCK,
- XkbStickyKeysMask);
- }
- }
- else {
- if (filter->upAction.type == XkbSA_LatchMods)
- pAction->mods.type = XkbSA_SetMods;
- else
- pAction->group.type = XkbSA_SetGroup;
- }
- if (filter->upAction.type == XkbSA_LatchMods)
- xkbi->state.latched_mods &= ~filter->upAction.mods.mask;
- else
- xkbi->state.latched_group -=
- XkbSAGroup(&filter->upAction.group);
- filter->active = 0;
+ /* If one latch is broken, all latches are broken, so it's no use
+ to find out which particular latch this filter tracks. */
+ xkbi->state.latched_mods = 0;
+ xkbi->state.latched_group = 0;
}
}
- else if (filter->keycode == keycode) { /* release */
+ else if (filter->keycode == keycode && filter->priv != LATCH_PENDING){
+ /* The test above for LATCH_PENDING skips subsequent releases of the
+ key after it has been released first time and the latch became
+ pending. */
XkbControlsPtr ctrls = xkbi->desc->ctrls;
- int needBeep;
- int beepType = _BEEP_NONE;
+ int needBeep = ((ctrls->enabled_ctrls & XkbStickyKeysMask) &&
+ XkbAX_NeedFeedback(ctrls, XkbAX_StickyKeysFBMask));
- needBeep = ((ctrls->enabled_ctrls & XkbStickyKeysMask) &&
- XkbAX_NeedFeedback(ctrls, XkbAX_StickyKeysFBMask));
if (filter->upAction.type == XkbSA_LatchMods) {
- xkbi->clearMods = filter->upAction.mods.mask;
- if ((filter->upAction.mods.flags & XkbSA_ClearLocks) &&
- (xkbi->clearMods & xkbi->state.locked_mods) ==
- xkbi->clearMods) {
- xkbi->state.locked_mods &= ~xkbi->clearMods;
- filter->priv = NO_LATCH;
- beepType = _BEEP_STICKY_UNLOCK;
+ unsigned char mask = filter->upAction.mods.mask;
+ unsigned char common;
+
+ xkbi->clearMods = mask;
+
+ /* ClearLocks */
+ common = mask & xkbi->state.locked_mods;
+ if ((filter->upAction.mods.flags & XkbSA_ClearLocks) && common) {
+ mask &= ~common;
+ xkbi->state.locked_mods &= ~common;
+ if (needBeep)
+ XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_UNLOCK,
+ XkbStickyKeysMask);
+ }
+ /* LatchToLock */
+ common = mask & xkbi->state.latched_mods;
+ if ((filter->upAction.mods.flags & XkbSA_LatchToLock) && common) {
+ unsigned char newlocked;
+
+ mask &= ~common;
+ newlocked = common & ~xkbi->state.locked_mods;
+ if(newlocked){
+ xkbi->state.locked_mods |= newlocked;
+ if (needBeep)
+ XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_LOCK,
+ XkbStickyKeysMask);
+
+ }
+ xkbi->state.latched_mods &= ~common;
+ }
+ /* Latch remaining modifiers, if any. */
+ if (mask) {
+ xkbi->state.latched_mods |= mask;
+ filter->priv = LATCH_PENDING;
+ if (needBeep)
+ XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_LATCH,
+ XkbStickyKeysMask);
}
}
else {
xkbi->groupChange = -XkbSAGroup(&filter->upAction.group);
+ /* ClearLocks */
if ((filter->upAction.group.flags & XkbSA_ClearLocks) &&
(xkbi->state.locked_group)) {
xkbi->state.locked_group = 0;
- filter->priv = NO_LATCH;
- beepType = _BEEP_STICKY_UNLOCK;
+ if (needBeep)
+ XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_UNLOCK,
+ XkbStickyKeysMask);
}
- }
- if (filter->priv == NO_LATCH) {
- filter->active = 0;
- }
- else {
- filter->priv = LATCH_PENDING;
- if (filter->upAction.type == XkbSA_LatchMods) {
- xkbi->state.latched_mods |= filter->upAction.mods.mask;
- needBeep = xkbi->state.latched_mods ? needBeep : 0;
- xkbi->state.latched_mods |= filter->upAction.mods.mask;
+ /* LatchToLock */
+ else if ((filter->upAction.group.flags & XkbSA_LatchToLock)
+ && (xkbi->state.latched_group)) {
+ xkbi->state.locked_group += XkbSAGroup(&filter->upAction.group);
+ xkbi->state.latched_group -= XkbSAGroup(&filter->upAction.group);
+ if(XkbSAGroup(&filter->upAction.group) && needBeep)
+ XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_LOCK,
+ XkbStickyKeysMask);
}
- else {
- xkbi->state.latched_group +=
- XkbSAGroup(&filter->upAction.group);
+ /* Latch group */
+ else if(XkbSAGroup(&filter->upAction.group)){
+ xkbi->state.latched_group += XkbSAGroup(&filter->upAction.group);
+ filter->priv = LATCH_PENDING;
+ if (needBeep)
+ XkbDDXAccessXBeep(xkbi->device, _BEEP_STICKY_LATCH,
+ XkbStickyKeysMask);
}
- if (needBeep && (beepType == _BEEP_NONE))
- beepType = _BEEP_STICKY_LATCH;
}
- if (needBeep && (beepType != _BEEP_NONE))
- XkbDDXAccessXBeep(xkbi->device, beepType, XkbStickyKeysMask);
+
+ if (filter->priv != LATCH_PENDING)
+ filter->active = 0;
}
- else if (filter->priv == LATCH_KEY_DOWN) {
- filter->priv = NO_LATCH;
- filter->filterOthers = 0;
+ else if (pAction && (filter->priv == LATCH_KEY_DOWN)) {
+ /* Latch was broken before it became pending: degrade to a
+ SetMods/SetGroup. */
+ if (filter->upAction.type == XkbSA_LatchMods)
+ filter->upAction.type = XkbSA_SetMods;
+ else
+ filter->upAction.type = XkbSA_SetGroup;
+ filter->filter = _XkbFilterSetState;
+ filter->priv = 0;
+ return filter->filter(xkbi, filter, keycode, pAction);
}
return 1;
}