[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#353168: X slowness patch



Package: xserver-xorg
Version: 6.9.0.dfsg.1-4
Tags: patch

-- 
dann frazier <dannf@hp.com>
--- Begin Message ---
   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 ---

Reply to: