Bug 9692

Summary: xf86 does not mmap the frame buffer read/write
Product: xorg Reporter: Jonathan Lim <jlim>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: edwardsg, mat, sndirsch
Version: 6.9.0   
Hardware: SGI   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

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.