forgot the actual patch, oops
This commit is contained in:
parent
468a0ae166
commit
c481edbf9e
29
gpm-1.20.1-aligned-sleep.patch
Normal file
29
gpm-1.20.1-aligned-sleep.patch
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
--- gpm-1.20.1/src/console.c.org 2006-09-03 10:11:17.000000000 +0200
|
||||||
|
+++ gpm-1.20.1/src/console.c 2006-09-03 10:14:34.000000000 +0200
|
||||||
|
@@ -30,6 +30,7 @@
|
||||||
|
#include <time.h> /* time() */
|
||||||
|
#include <sys/fcntl.h> /* O_RDONLY */
|
||||||
|
#include <sys/stat.h> /* mkdir() */
|
||||||
|
+#include <sys/time.h>
|
||||||
|
#include <asm/types.h> /* __u32 */
|
||||||
|
|
||||||
|
#include <linux/vt.h> /* VT_GETSTATE */
|
||||||
|
@@ -102,8 +103,17 @@ int is_text_console(void)
|
||||||
|
/*-------------------------------------------------------------------*/
|
||||||
|
void wait_text_console(void)
|
||||||
|
{
|
||||||
|
+ struct timeval now;
|
||||||
|
+ int usecs;
|
||||||
|
do {
|
||||||
|
- sleep(2);
|
||||||
|
+ /* sleep to the top of the seconds about 2 seconds from now */
|
||||||
|
+ gettimeofday(&now, NULL);
|
||||||
|
+ usecs = 2000000;
|
||||||
|
+ if (now.tv_usec <= 250000)
|
||||||
|
+ usecs -= 1000000;
|
||||||
|
+ usecs += 1000000 - now.tv_usec;
|
||||||
|
+
|
||||||
|
+ usleep(usecs);
|
||||||
|
} while (!is_text_console());
|
||||||
|
}
|
||||||
|
|
2
gpm.spec
2
gpm.spec
@ -184,7 +184,7 @@ fi
|
|||||||
%changelog
|
%changelog
|
||||||
* Tue Oct 10 2006 Petr Rockai <prockai@redhat.com> - 1.20-1-76
|
* Tue Oct 10 2006 Petr Rockai <prockai@redhat.com> - 1.20-1-76
|
||||||
- align sleeps to tick boundary, should reduce cpu wakeups
|
- align sleeps to tick boundary, should reduce cpu wakeups
|
||||||
on laptops, fixes #205064
|
on laptops, fixes #205064 (patch by Arjan van de Ven)
|
||||||
- disable gpm altogether in runlevel 5, it is probably not
|
- disable gpm altogether in runlevel 5, it is probably not
|
||||||
worth the overhead considering it is barely used at all
|
worth the overhead considering it is barely used at all
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user