Bugzilla – Attachment 95368 Details for
Bug 197572
X.Org PCI patches stilll left
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
p_pci-legacy-mmap.diff
p_pci-legacy-mmap.diff (text/plain), 1.96 KB, created by
Stefan Dirsch
on 2006-08-07 15:22:17 UTC
(
hide
)
Description:
p_pci-legacy-mmap.diff
Filename:
MIME Type:
Creator:
Stefan Dirsch
Created:
2006-08-07 15:22:17 UTC
Size:
1.96 KB
patch
obsolete
>If we're mapping something in the "legacy range" (0-1Mb), we shouldn't >expand the requested range to the entire 0-1Mb range. Typically this >is for mapping the VGA frame buffer, and some platforms support mmap of >the frame buffer but not the entire 0-1Mb range. > >For example, HP sx1000 and sx2000 ia64 platforms can have memory from >0-0x9ffff, VGA frame buffer from 0xa0000-0xbffff, and memory from >0xc0000-0xfffff. On these platforms, we can't map the entire 0-1Mb >range with the same attribute because the memory only supports WB, >while the frame buffer supports only UC. But an mmap of just the >frame buffer should work fine. > >--- BUILD/xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c.orig 2006-04-03 08:27:52.000000000 -0600 >+++ BUILD/xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c 2006-04-03 08:33:26.000000000 -0600 >@@ -625,7 +625,6 @@ > > #define MAX_DOMAINS 256 > static pointer DomainMmappedIO[MAX_DOMAINS]; >-static pointer DomainMmappedMem[MAX_DOMAINS]; > > static int > linuxOpenLegacy(PCITAG Tag, char *name) >@@ -682,6 +681,7 @@ > { > int domain = xf86GetPciDomain(Tag); > int fd; >+ pointer addr; > > /* > * We use /proc/bus/pci on non-legacy addresses or if the Linux sysfs >@@ -695,20 +695,14 @@ > return linuxMapPci(ScreenNum, Flags, Tag, Base, Size, > PCIIOC_MMAP_IS_MEM); > >- >- /* If we haven't already mapped this legacy space, try to. */ >- if (!DomainMmappedMem[domain]) { >- DomainMmappedMem[domain] = mmap(NULL, 1024*1024, PROT_READ|PROT_WRITE, >- MAP_SHARED, fd, 0); >- if (DomainMmappedMem[domain] == MAP_FAILED) { >- close(fd); >- perror("mmap failure"); >- FatalError("xf86MapDomainMem(): mmap() failure\n"); >- } >+ addr = mmap(NULL, Size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, Base); >+ if (addr == MAP_FAILED) { >+ close (fd); >+ perror("mmap failure"); >+ FatalError("xf86MapDomainMem(): mmap() failure\n"); > } >- > close(fd); >- return (pointer)((char *)DomainMmappedMem[domain] + Base); >+ return addr; > } > > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 197572
:
95362
|
95365
|
95366
|
95367
| 95368 |
96794
|
96866
|
96867
|
96898
|
97000
|
97003
|
97027
|
97046
|
97112
|
100972
|
100983
|
101011