summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2009-08-25 20:57:16 -0700
committerJeremy Huddleston <jeremyhu@freedesktop.org>2009-08-25 20:57:16 -0700
commitdef28e70726f9cd4958b69abeb6d0a6e462d5fb4 (patch)
treecdbdf13d374382e1b1520978648e8b638739affe
parentc232ee0e66c06055ecfed837ed9294217d35ca9f (diff)
parent76a1839b0a7dcb82e46c43533d252288677c6dbb (diff)
Merge commit 'origin/server-1.6-branch' into xorg-server-1.6-apple
-rw-r--r--Xext/sync.c32
-rw-r--r--config/hal.c21
-rw-r--r--configure.ac4
-rw-r--r--dix/dispatch.c22
-rw-r--r--dix/events.c4
-rw-r--r--dix/window.c2
-rw-r--r--glx/glxext.c27
-rw-r--r--hw/xfree86/modes/xf86Cursors.c6
-rw-r--r--hw/xfree86/modes/xf86Rotate.c7
-rw-r--r--include/dix.h6
10 files changed, 92 insertions, 39 deletions
diff --git a/Xext/sync.c b/Xext/sync.c
index 9ae3c6558..3e5c046d2 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -1167,28 +1167,24 @@ SyncComputeBracketValues(pCounter, startOver)
pnewltval = &psci->bracket_less;
}
}
- else if ( (pTrigger->test_type == XSyncPositiveTransition &&
+ else if (pTrigger->test_type == XSyncNegativeTransition &&
ct != XSyncCounterNeverIncreases)
- ||
- (pTrigger->test_type == XSyncNegativeTransition &&
+ {
+ if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) &&
+ XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less))
+ {
+ psci->bracket_less = pTrigger->test_value;
+ pnewltval = &psci->bracket_less;
+ }
+ }
+ else if (pTrigger->test_type == XSyncPositiveTransition &&
ct != XSyncCounterNeverDecreases)
- )
{
- if (XSyncValueLessThan(pCounter->value, pTrigger->test_value))
+ if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) &&
+ XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater))
{
- if (XSyncValueLessThan(pTrigger->test_value,
- psci->bracket_greater))
- {
- psci->bracket_greater = pTrigger->test_value;
- pnewgtval = &psci->bracket_greater;
- }
- else
- if (XSyncValueGreaterThan(pTrigger->test_value,
- psci->bracket_less))
- {
- psci->bracket_less = pTrigger->test_value;
- pnewltval = &psci->bracket_less;
- }
+ psci->bracket_greater = pTrigger->test_value;
+ pnewgtval = &psci->bracket_greater;
}
}
} /* end for each trigger */
diff --git a/config/hal.c b/config/hal.c
index 59bff6613..28f55a02f 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -489,13 +489,13 @@ connect_and_register(DBusConnection *connection, struct config_hal_info *info)
if (!libhal_ctx_set_dbus_connection(info->hal_ctx, info->system_bus)) {
LogMessage(X_ERROR, "config/hal: couldn't associate HAL context with bus\n");
- goto out_ctx;
+ goto out_err;
}
if (!libhal_ctx_init(info->hal_ctx, &error)) {
LogMessage(X_ERROR, "config/hal: couldn't initialise context: %s (%s)\n",
error.name ? error.name : "unknown error",
error.message ? error.message : "null");
- goto out_ctx;
+ goto out_err;
}
if (!libhal_device_property_watch_all(info->hal_ctx, &error)) {
LogMessage(X_ERROR, "config/hal: couldn't watch all properties: %s (%s)\n",
@@ -526,19 +526,20 @@ connect_and_register(DBusConnection *connection, struct config_hal_info *info)
out_ctx:
dbus_error_free(&error);
- if (info->hal_ctx) {
- if (!libhal_ctx_shutdown(info->hal_ctx, &error)) {
- LogMessage(X_WARNING, "config/hal: couldn't shut down context: %s (%s)\n",
- error.name ? error.name : "unknown error",
- error.message ? error.message : "null");
- dbus_error_free(&error);
- }
- libhal_ctx_free(info->hal_ctx);
+ if (!libhal_ctx_shutdown(info->hal_ctx, &error)) {
+ LogMessage(X_WARNING, "config/hal: couldn't shut down context: %s (%s)\n",
+ error.name ? error.name : "unknown error",
+ error.message ? error.message : "null");
+ dbus_error_free(&error);
}
out_err:
dbus_error_free(&error);
+ if (info->hal_ctx) {
+ libhal_ctx_free(info->hal_ctx);
+ }
+
info->hal_ctx = NULL;
info->system_bus = NULL;
diff --git a/configure.ac b/configure.ac
index 3ab455385..b6f6fbae2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1243,7 +1243,7 @@ if test "x$XORG" = xyes; then
XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
XORG_INCS="$XORG_DDXINCS $XORG_OSINCS"
XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H"
- XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $SELINUX_LIB"
+ XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB"
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
SAVE_LIBS=$LIBS
@@ -1254,7 +1254,7 @@ if test "x$XORG" = xyes; then
AC_CHECK_FUNCS([pci_device_enable])
LIBS=$SAVE_LIBS
CFLAGS=$SAVE_CFLAGS
- XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS"
+ XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS $SELINUX_LIB"
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
case $host_os in
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 1ca08b641..7e16589da 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -247,6 +247,7 @@ long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL;
long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL;
long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE;
long SmartScheduleTime;
+int SmartScheduleLatencyLimited = 0;
static ClientPtr SmartLastClient;
static int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1];
@@ -317,7 +318,7 @@ SmartScheduleClient (int *clientReady, int nready)
/*
* Adjust slice
*/
- if (nready == 1)
+ if (nready == 1 && SmartScheduleLatencyLimited == 0)
{
/*
* If it's been a long time since another client
@@ -337,6 +338,23 @@ SmartScheduleClient (int *clientReady, int nready)
return best;
}
+void
+EnableLimitedSchedulingLatency(void)
+{
+ ++SmartScheduleLatencyLimited;
+ SmartScheduleSlice = SmartScheduleInterval;
+}
+
+void
+DisableLimitedSchedulingLatency(void)
+{
+ --SmartScheduleLatencyLimited;
+
+ /* protect against bugs */
+ if (SmartScheduleLatencyLimited < 0)
+ SmartScheduleLatencyLimited = 0;
+}
+
#define MAJOROP ((xReq *)client->requestBuffer)->reqType
void
@@ -356,6 +374,7 @@ Dispatch(void)
if (!clientReady)
return;
+ SmartScheduleSlice = SmartScheduleInterval;
while (!dispatchException)
{
if (*icheck[0] != *icheck[1])
@@ -466,6 +485,7 @@ Dispatch(void)
KillAllClients();
xfree(clientReady);
dispatchException &= ~DE_RESET;
+ SmartScheduleLatencyLimited = 0;
}
#undef MAJOROP
diff --git a/dix/events.c b/dix/events.c
index 17868272a..f9448ba76 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2661,8 +2661,8 @@ WindowsRestructured(void)
DeviceIntPtr pDev = inputInfo.devices;
while(pDev)
{
- if (DevHasCursor(pDev))
- CheckMotion((xEvent *)NULL, pDev);
+ if (pDev->isMaster || !pDev->u.master)
+ CheckMotion(NULL, pDev);
pDev = pDev->next;
}
}
diff --git a/dix/window.c b/dix/window.c
index 2a2fb1871..b85856b37 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -3169,8 +3169,6 @@ dixSaveScreens(ClientPtr client, int on, int mode)
if (on == SCREEN_SAVER_FORCER)
{
- UpdateCurrentTimeIf();
- lastDeviceEventTime = currentTime;
if (mode == ScreenSaverReset)
what = SCREEN_SAVER_OFF;
else
diff --git a/glx/glxext.c b/glx/glxext.c
index fe99e4e80..ca1d2ec8d 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -127,6 +127,33 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
__GLXcontext *c;
for (c = glxAllContexts; c; c = c->next) {
+ if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) {
+ int i;
+
+ (*c->loseCurrent)(c);
+ c->isCurrent = GL_FALSE;
+ if (c == __glXLastContext)
+ __glXFlushContextCache();
+
+ for (i = 1; i < currentMaxClients; i++) {
+ if (clients[i]) {
+ __GLXclientState *cl = glxGetClient(clients[i]);
+
+ if (cl->inUse) {
+ int j;
+
+ for (j = 0; j < cl->numCurrentContexts; j++) {
+ if (cl->currentContexts[j] == c)
+ cl->currentContexts[j] = NULL;
+ }
+ }
+ }
+ }
+
+ if (!c->idExists) {
+ __glXFreeContext(c);
+ }
+ }
if (c->drawPriv == glxPriv)
c->drawPriv = NULL;
if (c->readPriv == glxPriv)
diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index fe0e1afe7..e68d7e237 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -639,9 +639,11 @@ xf86_reload_cursors (ScreenPtr screen)
(*cursor_info->LoadCursorARGB) (scrn, cursor);
else if (src)
#endif
- (*cursor_info->LoadCursorImage)(cursor_info->pScrn, src);
+ (*cursor_info->LoadCursorImage)(scrn, src);
- (*cursor_info->SetCursorPosition)(cursor_info->pScrn, x, y);
+ x += scrn->frameX0 + cursor_screen_priv->HotX;
+ y += scrn->frameY0 + cursor_screen_priv->HotY;
+ (*cursor_info->SetCursorPosition)(scrn, x, y);
}
}
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 302edacd0..ea0f5a59b 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -197,6 +197,7 @@ xf86RotatePrepare (ScreenPtr pScreen)
DamageRegister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
xf86_config->rotation_damage);
xf86_config->rotation_damage_registered = TRUE;
+ EnableLimitedSchedulingLatency();
}
xf86CrtcDamageShadow (crtc);
@@ -262,11 +263,12 @@ xf86RotateBlockHandler(int screenNum, pointer blockData,
ScreenPtr pScreen = screenInfo.screens[screenNum];
ScrnInfoPtr pScrn = xf86Screens[screenNum];
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ Bool rotation_active;
+ rotation_active = xf86RotateRedisplay(pScreen);
pScreen->BlockHandler = xf86_config->BlockHandler;
(*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask);
- if (xf86RotateRedisplay(pScreen))
- {
+ if (rotation_active) {
/* Re-wrap if rotation is still happening */
xf86_config->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = xf86RotateBlockHandler;
@@ -306,6 +308,7 @@ xf86RotateDestroy (xf86CrtcPtr crtc)
DamageUnregister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
xf86_config->rotation_damage);
xf86_config->rotation_damage_registered = FALSE;
+ DisableLimitedSchedulingLatency();
}
DamageDestroy (xf86_config->rotation_damage);
xf86_config->rotation_damage = NULL;
diff --git a/include/dix.h b/include/dix.h
index 66af953b2..9c2c73fb7 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -229,6 +229,12 @@ extern void WakeupHandler(
int /*result*/,
pointer /*pReadmask*/);
+void
+EnableLimitedSchedulingLatency(void);
+
+void
+DisableLimitedSchedulingLatency(void);
+
typedef void (* WakeupHandlerProcPtr)(
pointer /* blockData */,
int /* result */,