sync with F9

This commit is contained in:
Adam Jackson 2008-08-28 17:58:59 +00:00
parent 18bafdc2e1
commit e7739c1d27
4 changed files with 64 additions and 18 deletions

View File

@ -1,16 +1,16 @@
diff -up libpciaccess-20071031/src/linux_sysfs.c.cache libpciaccess-20071031/src/linux_sysfs.c diff -up libpciaccess-0.10.3/src/linux_sysfs.c.cache libpciaccess-0.10.3/src/linux_sysfs.c
--- libpciaccess-20071031/src/linux_sysfs.c.cache 2007-10-23 09:19:36.000000000 -0400 --- libpciaccess-0.10.3/src/linux_sysfs.c.cache 2008-06-10 15:21:36.000000000 -0400
+++ libpciaccess-20071031/src/linux_sysfs.c 2008-01-22 19:23:12.000000000 -0500 +++ libpciaccess-0.10.3/src/linux_sysfs.c 2008-08-28 13:56:28.000000000 -0400
@@ -55,6 +55,8 @@ @@ -57,6 +57,8 @@
#include "pciaccess_private.h"
#include "linux_devmem.h" static void pci_device_linux_sysfs_enable(struct pci_device *dev);
+static void pci_device_linux_sysfs_destroy( void ); +static void pci_device_linux_sysfs_destroy( void );
+ +
static int pci_device_linux_sysfs_read_rom( struct pci_device * dev, static int pci_device_linux_sysfs_read_rom( struct pci_device * dev,
void * buffer ); void * buffer );
@@ -74,7 +76,7 @@ @@ -76,7 +78,7 @@ static int pci_device_linux_sysfs_write(
pciaddr_t * bytes_wrtten ); pciaddr_t * bytes_wrtten );
static const struct pci_system_methods linux_sysfs_methods = { static const struct pci_system_methods linux_sysfs_methods = {
@ -19,7 +19,7 @@ diff -up libpciaccess-20071031/src/linux_sysfs.c.cache libpciaccess-20071031/src
.destroy_device = NULL, .destroy_device = NULL,
.read_rom = pci_device_linux_sysfs_read_rom, .read_rom = pci_device_linux_sysfs_read_rom,
.probe = pci_device_linux_sysfs_probe, .probe = pci_device_linux_sysfs_probe,
@@ -362,6 +364,53 @@ @@ -368,6 +370,53 @@ pci_device_linux_sysfs_read_rom( struct
return err; return err;
} }
@ -73,7 +73,7 @@ diff -up libpciaccess-20071031/src/linux_sysfs.c.cache libpciaccess-20071031/src
static int static int
pci_device_linux_sysfs_read( struct pci_device * dev, void * data, pci_device_linux_sysfs_read( struct pci_device * dev, void * data,
@@ -378,23 +427,9 @@ @@ -384,23 +433,9 @@ pci_device_linux_sysfs_read( struct pci_
*bytes_read = 0; *bytes_read = 0;
} }
@ -91,7 +91,7 @@ diff -up libpciaccess-20071031/src/linux_sysfs.c.cache libpciaccess-20071031/src
- -
- fd = open( name, O_RDONLY ); - fd = open( name, O_RDONLY );
- if ( fd == -1 ) { - if ( fd == -1 ) {
+ fd = open_config_fd( dev, O_RDONLY ); + fd = open_config_fd( dev, O_RDWR );
+ if ( fd == -1 ) + if ( fd == -1 )
return errno; return errno;
- } - }
@ -99,7 +99,7 @@ diff -up libpciaccess-20071031/src/linux_sysfs.c.cache libpciaccess-20071031/src
while ( temp_size > 0 ) { while ( temp_size > 0 ) {
const ssize_t bytes = pread64( fd, data_bytes, temp_size, offset ); const ssize_t bytes = pread64( fd, data_bytes, temp_size, offset );
@@ -416,7 +451,6 @@ @@ -422,7 +457,6 @@ pci_device_linux_sysfs_read( struct pci_
*bytes_read = size - temp_size; *bytes_read = size - temp_size;
} }
@ -107,7 +107,7 @@ diff -up libpciaccess-20071031/src/linux_sysfs.c.cache libpciaccess-20071031/src
return err; return err;
} }
@@ -436,23 +470,9 @@ @@ -442,23 +476,9 @@ pci_device_linux_sysfs_write( struct pci
*bytes_written = 0; *bytes_written = 0;
} }
@ -125,7 +125,7 @@ diff -up libpciaccess-20071031/src/linux_sysfs.c.cache libpciaccess-20071031/src
- -
- fd = open( name, O_WRONLY ); - fd = open( name, O_WRONLY );
- if ( fd == -1 ) { - if ( fd == -1 ) {
+ fd = open_config_fd( dev, O_WRONLY ); + fd = open_config_fd( dev, O_RDWR );
+ if ( fd == -1 ) + if ( fd == -1 )
return errno; return errno;
- } - }
@ -133,7 +133,7 @@ diff -up libpciaccess-20071031/src/linux_sysfs.c.cache libpciaccess-20071031/src
while ( temp_size > 0 ) { while ( temp_size > 0 ) {
const ssize_t bytes = pwrite64( fd, data_bytes, temp_size, offset ); const ssize_t bytes = pwrite64( fd, data_bytes, temp_size, offset );
@@ -474,7 +494,6 @@ @@ -480,7 +500,6 @@ pci_device_linux_sysfs_write( struct pci
*bytes_written = size - temp_size; *bytes_written = size - temp_size;
} }

View File

@ -0,0 +1,28 @@
From b30d458202bc0304c705eb081b12ead860584bea Mon Sep 17 00:00:00 2001
From: Keith Packard <keithp@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

View File

@ -2,8 +2,8 @@
%define gitrev e392082abb5696c8837224da86cc0af4f21d7010 %define gitrev e392082abb5696c8837224da86cc0af4f21d7010
Name: libpciaccess Name: libpciaccess
Version: 0.10 Version: 0.10.3
Release: 1%{?dist} Release: 3%{?dist}
Summary: PCI access library Summary: PCI access library
Group: System Environment/Libraries Group: System Environment/Libraries
@ -18,6 +18,7 @@ Source1: make-libpciaccess-snapshot.sh
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch0: libpciaccess-fd-cache.patch Patch0: libpciaccess-fd-cache.patch
Patch1: libpciaccess-kludge-wc-mmap.patch
BuildRequires: autoconf automake libtool pkgconfig BuildRequires: autoconf automake libtool pkgconfig
Requires: hwdata Requires: hwdata
@ -38,6 +39,7 @@ Development package for libpciaccess.
%prep %prep
%setup -q -n %{name}-%{version} %setup -q -n %{name}-%{version}
%patch0 -p1 -b .cache %patch0 -p1 -b .cache
%patch1 -p1 -b .wc
%build %build
#autoreconf -v --install #autoreconf -v --install
@ -59,7 +61,7 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc COPYING AUTHORS ChangeLog %doc COPYING AUTHORS ChangeLog
%{_libdir}/libpciaccess.so.0 %{_libdir}/libpciaccess.so.0
%{_libdir}/libpciaccess.so.0.10.0 %{_libdir}/libpciaccess.so.0.10.*
%files devel %files devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
@ -68,6 +70,22 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/pkgconfig/pciaccess.pc %{_libdir}/pkgconfig/pciaccess.pc
%changelog %changelog
* Thu Aug 28 2008 Adam Jackson <ajax@redhat.com> 0.10.3-3
- Rediff for --fuzz=0
* Wed Jul 02 2008 Adam Jackson <ajax@redhat.com> 0.10.3-2
- Fix file access mode in config fd cache. (#452910)
* Tue Jul 01 2008 Adam Jackson <ajax@redhat.com> 0.10.3-1
- libpciaccess 0.10.3
* Tue May 20 2008 Adam Jackson <ajax@redhat.com> 0.10-3
- libpciaccess-no-pci-fix.patch: Fix init when /sys/bus/pci is empty or
nonexistent.
* Mon Apr 21 2008 Dave Airlie <airlied@redhat.com> 0.10-2
- fix major problem with libpciaccess and write combining.
* Thu Mar 06 2008 Adam Jackson <ajax@redhat.com> 0.10-1 * Thu Mar 06 2008 Adam Jackson <ajax@redhat.com> 0.10-1
- libpciaccess 0.10 - libpciaccess 0.10

View File

@ -1 +1 @@
fadacd7f13c3c2f83e14f670925487a1 libpciaccess-0.10.tar.bz2 6d5468debf76fac84576ca26c9535821 libpciaccess-0.10.3.tar.bz2