rpms/libpciaccess/F-9 libpciaccess-kludge-wc-mmap.patch, NONE, 1.1 libpciaccess.spec, 1.11, 1.12

Dave Airlie (airlied) fedora-extras-commits at redhat.com
Tue Apr 22 21:08:11 UTC 2008


Author: airlied

Update of /cvs/pkgs/rpms/libpciaccess/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv7049

Modified Files:
	libpciaccess.spec 
Added Files:
	libpciaccess-kludge-wc-mmap.patch 
Log Message:
* Mon Apr 21 2008 Dave Airlie <airlied at redhat.com> 0.10-2
- fix major problem with libpciaccess and write combining.


libpciaccess-kludge-wc-mmap.patch:

--- NEW FILE libpciaccess-kludge-wc-mmap.patch ---
>From b30d458202bc0304c705eb081b12ead860584bea Mon Sep 17 00:00:00 2001
From: Keith Packard <keithp at keithp.com>
Date: Wed, 16  Apr  2008  19:10:52  +0000
Subject: Kludge around linux bug and turn off write-through and cache-disable bits

When mmaping the PCI device, the kernel turns on the write-through and
cache-disable bits in the allocated PTEs. This disables write-combining mode
and dramatically reduces write bandwidth to the frame buffer. While that
should be fixed in the kernel, we'll kludge around it here by using mprotect
to rewrite the PTEs and get those bits turned off.
---
diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
index 873dc02..78584d6 100644
--- a/src/linux_sysfs.c
+++ b/src/linux_sysfs.c
@@ -558,6 +558,9 @@ pci_device_linux_sysfs_map_range(struct pci_device *dev,
 		    strerror(errno), errno);
 /*            err = errno;*/
 	}
+	/* KLUDGE ALERT -- rewrite the PTEs to turn off the CD and WT bits */
+	mprotect (map->memory, map->size, PROT_NONE);
+	mprotect (map->memory, map->size, PROT_READ|PROT_WRITE);
     }
 #endif
 
--
cgit v0.7.2-37-g538c



Index: libpciaccess.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libpciaccess/F-9/libpciaccess.spec,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- libpciaccess.spec	6 Mar 2008 20:40:43 -0000	1.11
+++ libpciaccess.spec	22 Apr 2008 21:07:31 -0000	1.12
@@ -3,7 +3,7 @@
 
 Name:           libpciaccess
 Version:        0.10
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        PCI access library
 
 Group:          System Environment/Libraries
@@ -18,6 +18,7 @@
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Patch0:		libpciaccess-fd-cache.patch
+Patch1:		libpciaccess-kludge-wc-mmap.patch
 
 BuildRequires:  autoconf automake libtool pkgconfig
 Requires:       hwdata
@@ -38,6 +39,7 @@
 %prep
 %setup -q -n %{name}-%{version}
 %patch0 -p1 -b .cache
+%patch1 -p1 -b .wc
 
 %build
 #autoreconf -v --install
@@ -68,6 +70,9 @@
 %{_libdir}/pkgconfig/pciaccess.pc
 
 %changelog
+* Mon Apr 21 2008 Dave Airlie <airlied at redhat.com> 0.10-2
+- fix major problem with libpciaccess and write combining.
+
 * Thu Mar 06 2008 Adam Jackson <ajax at redhat.com> 0.10-1
 - libpciaccess 0.10
 




More information about the scm-commits mailing list