forked from pool/xorg-x11-server
Accepting request 38448 from home:eeich:branches:X11:XOrg
Copy from home:eeich:branches:X11:XOrg/xorg-x11-server via accept of submit request 38448 revision 4. Request was accepted with message: reviewed ok. OBS-URL: https://build.opensuse.org/request/show/38448 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=253
This commit is contained in:
parent
a71d142831
commit
2363d794d4
@ -0,0 +1,80 @@
|
|||||||
|
From d1d9d4e5f8f9ac1d22e1258759d6ee9e49c7fe90 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Egbert Eich <eich@freedesktop.org>
|
||||||
|
Date: Fri, 9 Apr 2010 15:10:32 +0200
|
||||||
|
Subject: [PATCH] Prevent XSync Alarms from senslessly calling CheckTrigger() when inactive.
|
||||||
|
|
||||||
|
If an XSync Alarm is set to inactive there is no need to check if a trigger
|
||||||
|
needs to fire. Doing so if the counter is the IdleCounter will put the
|
||||||
|
server on 100 percent CPU load since the select timeout is set to 0.
|
||||||
|
---
|
||||||
|
xorg-server-1.8.0/Xext/sync.c | 11 +++++++++--
|
||||||
|
xorg-server-1.8.0/Xext/syncsrv.h | 1 +
|
||||||
|
2 files changed, 10 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/xorg-server-1.8.0/Xext/sync.c b/xorg-server-1.8.0/Xext/sync.c
|
||||||
|
index fd7b1ad..4c45399 100644
|
||||||
|
--- a/Xext/sync.c
|
||||||
|
+++ b/Xext/sync.c
|
||||||
|
@@ -518,6 +518,10 @@ SyncAlarmTriggerFired(SyncTrigger *pTrigger)
|
||||||
|
pAlarm->state = XSyncAlarmInactive;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ /* Stop server from looping! */
|
||||||
|
+ if (pAlarm->state == XSyncAlarmInactive)
|
||||||
|
+ SyncDeleteTriggerFromCounter(&pAlarm->trigger);
|
||||||
|
+
|
||||||
|
/* The AlarmNotify event has to have the "new state of the alarm"
|
||||||
|
* which we can't be sure of until this point. However, it has
|
||||||
|
* to have the "old" trigger test value. That's the reason for
|
||||||
|
@@ -730,7 +734,7 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm *pAlarm, Mask mask,
|
||||||
|
XSyncCounter counter;
|
||||||
|
Mask origmask = mask;
|
||||||
|
|
||||||
|
- counter = pAlarm->trigger.pCounter ? pAlarm->trigger.pCounter->id : None;
|
||||||
|
+ counter = pAlarm->counter_id;
|
||||||
|
|
||||||
|
while (mask)
|
||||||
|
{
|
||||||
|
@@ -741,7 +745,7 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm *pAlarm, Mask mask,
|
||||||
|
case XSyncCACounter:
|
||||||
|
mask &= ~XSyncCACounter;
|
||||||
|
/* sanity check in SyncInitTrigger */
|
||||||
|
- counter = *values++;
|
||||||
|
+ counter = pAlarm->counter_id = *values++;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case XSyncCAValueType:
|
||||||
|
@@ -815,6 +819,7 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm *pAlarm, Mask mask,
|
||||||
|
return status;
|
||||||
|
|
||||||
|
/* XXX spec does not really say to do this - needs clarification */
|
||||||
|
+ /* It's the only place where it is set to XSyncAlarmActive! */
|
||||||
|
pAlarm->state = XSyncAlarmActive;
|
||||||
|
return Success;
|
||||||
|
}
|
||||||
|
@@ -1617,8 +1622,10 @@ ProcSyncCreateAlarm(ClientPtr client)
|
||||||
|
|
||||||
|
pAlarm->client = client;
|
||||||
|
pAlarm->alarm_id = stuff->id;
|
||||||
|
+ pAlarm->counter_id = None;
|
||||||
|
XSyncIntToValue(&pAlarm->delta, 1L);
|
||||||
|
pAlarm->events = TRUE;
|
||||||
|
+ /* SyncChangeAlarmAttributes() changes this - no need to set this here! */
|
||||||
|
pAlarm->state = XSyncAlarmInactive;
|
||||||
|
pAlarm->pEventClients = NULL;
|
||||||
|
status = SyncChangeAlarmAttributes(client, pAlarm, vmask,
|
||||||
|
diff --git a/xorg-server-1.8.0/Xext/syncsrv.h b/xorg-server-1.8.0/Xext/syncsrv.h
|
||||||
|
index 6d0e3d6..527729d 100644
|
||||||
|
--- a/Xext/syncsrv.h
|
||||||
|
+++ b/Xext/syncsrv.h
|
||||||
|
@@ -129,6 +129,7 @@ typedef struct _SyncAlarm {
|
||||||
|
int events;
|
||||||
|
int state;
|
||||||
|
SyncAlarmClientList *pEventClients;
|
||||||
|
+ XSyncCounter counter_id;
|
||||||
|
} SyncAlarm;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
--
|
||||||
|
1.6.4.2
|
||||||
|
|
@ -1,3 +1,12 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Apr 21 16:03:07 CEST 2010 - eich@suse.de
|
||||||
|
|
||||||
|
- Prevent XSync Alarms from senslessly calling CheckTrigger() when inactive.
|
||||||
|
If an XSync Alarm is set to inactive there is no need to check if a trigger
|
||||||
|
needs to fire. Doing so if the counter is the IdleCounter will put the
|
||||||
|
server on 100 percent CPU load since the select timeout is set to 0
|
||||||
|
(bnc #584919).
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sat Apr 10 20:54:18 CEST 2010 - sndirsch@suse.de
|
Sat Apr 10 20:54:18 CEST 2010 - sndirsch@suse.de
|
||||||
|
|
||||||
|
@ -110,8 +110,9 @@ Patch205: xorg-server-1.8.0.diff
|
|||||||
Patch206: fix_fglrx_screendepth_issue.patch
|
Patch206: fix_fglrx_screendepth_issue.patch
|
||||||
Patch207: xorg-server-option_libxf86config.diff
|
Patch207: xorg-server-option_libxf86config.diff
|
||||||
Patch208: xorg-evdev-conf.diff
|
Patch208: xorg-evdev-conf.diff
|
||||||
Patch209: sw_cursor_on_randr.patch
|
Patch209: sw_cursor_on_randr.patch
|
||||||
Patch210: pio_ia64.diff
|
Patch210: pio_ia64.diff
|
||||||
|
Patch211: 0001-Prevent-XSync-Alarms-from-senslessly-calling-CheckTr.patch
|
||||||
%if %moblin
|
%if %moblin
|
||||||
Patch300: moblin-use_preferred_mode_for_all_outputs.diff
|
Patch300: moblin-use_preferred_mode_for_all_outputs.diff
|
||||||
%endif
|
%endif
|
||||||
@ -234,6 +235,7 @@ popd
|
|||||||
%patch208 -p0
|
%patch208 -p0
|
||||||
%patch209 -p1
|
%patch209 -p1
|
||||||
%patch210 -p1
|
%patch210 -p1
|
||||||
|
%patch211 -p1
|
||||||
%if %moblin
|
%if %moblin
|
||||||
%patch300 -p1
|
%patch300 -p1
|
||||||
%endif
|
%endif
|
||||||
|
Loading…
Reference in New Issue
Block a user