--- Begin Message ---
- To: Dannf@hp.com
- Subject: X slowness patch
- From: Alex Williamson <alex.williamson@hp.com>
- Date: Thu, 16 Feb 2006 09:12:23 -0700
- Message-id: <1140106343.12626.7.camel@localhost>
Read the ROM in big chunks rather than byte-at-a-time. This reduces
X startup time by 21 seconds for me.
Alex
--
Alex Williamson HP Linux & Open Source Lab
--- xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c.orig 2005-12-21 18:53:54.000000000 -0700
+++ xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c 2005-12-21 19:01:28.000000000 -0700
@@ -791,8 +791,10 @@
write(fd, "1", 2);
lseek(fd, 0, SEEK_SET);
+ len = min(Len, st.st_size);
+
/* copy the ROM until we hit Len, EOF or read error */
- for (i = 0; i < Len && read(fd, Buf, 1) > 0; Buf++, i++)
+ for (; len && (size = read(fd, Buf, len)) > 0 ; Buf+=size, len-=size)
;
write(fd, "0", 2);
--- End Message ---