Bug 9692 - xf86 does not mmap the frame buffer read/write
Summary: xf86 does not mmap the frame buffer read/write
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: 6.9.0
Hardware: SGI Linux (All)
: high normal
Assignee: Xorg Project Team
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-17 15:18 UTC by Jonathan Lim
Modified: 2007-01-26 06:32 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Jonathan Lim 2007-01-17 15:18:45 UTC
Currently, the call to linuxPciOpenFile() is always made for read
only access which causes the subseqent mmap call to fail when the
memory is mapped read/write.  The following patch fixes the problem:

Index: xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c
===================================================================
--- xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c.orig      
2006-09-18 16:38:08.067521978 -0700
+++ xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c    2006-08-10
19:32:19.503681311 -0700
@@ -569,7 +569,8 @@
 
        xf86InitVidMem();
 
-       if (((fd = linuxPciOpenFile(Tag ,FALSE)) < 0) ||
+       prot = (Flags & VIDMEM_READONLY) == 0;
+       if (((fd = linuxPciOpenFile(Tag, prot)) < 0) ||
            (ioctl(fd, mmap_ioctl, 0) < 0))
            break;
Comment 1 Matthias Hopf 2007-01-26 04:06:57 UTC
I suggest adding parenthesis around the comparison for clarity. Other than that this seems trivially correct.

Applied as 1627af54497bee659ea30f2850b39cbbf576e22d


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.