Merge commit 'origin/server-1.6-branch' into xorg-server-1.6-apple

This commit is contained in:
Jeremy Huddleston 2009-08-25 20:57:16 -07:00
commit def28e7072
10 changed files with 93 additions and 40 deletions

View File

@ -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 &&
ct != XSyncCounterNeverDecreases)
)
{
if (XSyncValueLessThan(pCounter->value, pTrigger->test_value))
if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) &&
XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less))
{
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_less = pTrigger->test_value;
pnewltval = &psci->bracket_less;
}
}
else if (pTrigger->test_type == XSyncPositiveTransition &&
ct != XSyncCounterNeverDecreases)
{
if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) &&
XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater))
{
psci->bracket_greater = pTrigger->test_value;
pnewgtval = &psci->bracket_greater;
}
}
} /* end for each trigger */

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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;
}
}

View File

@ -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

View File

@ -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)

View File

@ -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);
}
}

View File

@ -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;

View File

@ -229,6 +229,12 @@ extern void WakeupHandler(
int /*result*/,
pointer /*pReadmask*/);
void
EnableLimitedSchedulingLatency(void);
void
DisableLimitedSchedulingLatency(void);
typedef void (* WakeupHandlerProcPtr)(
pointer /* blockData */,
int /* result */,