xserver: Branch 'master'

David Nusinow gravity at kemper.freedesktop.org
Mon May 28 18:42:08 PDT 2007


 hw/xfree86/os-support/bus/linuxPci.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

New commits:
diff-tree 6bf8d5019313ee2251a44dfb7ad3435a3c6db7eb (from 6fdd134a0c3e6fdde9b089100e8783705c9cc6ac)
Author: David Nusinow <dnusinow at debian.org>
Date:   Mon May 28 21:42:10 2007 -0400

    Read ROM in chunks
    This patch speeds up reads of the ROM by reading in large chunks rather
    than one byte at a time. This patch was by Dann Frazier.

diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index 2aaa89c..3d8266e 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -788,8 +788,10 @@ xf86ReadDomainMemory(PCITAG Tag, ADDRESS
 	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);


More information about the xorg-commit mailing list