On Thu, Feb 17, 2005 at 06:51:49PM +0100, Frank Buss wrote: > I'm trying to use the pxafb driver on mach-pxa, but I can't mmap the > framebuffer memory. I can access it from the driver, filling the entire > screen, but when I access the pointer returned from mmap from a user space > program, the following two things happens: > > - the vm_pgoff is ignored and I get the start of the internal buffer, which > caused writing to the palette and DMA descriptors > > - when I change the location of the framebuffer to the start of the internal > buffer, I can write to the screen, but only to the first 4 k; any write > after this address is ignored, but no segfault is generated. > > Any ideas what I can do to find the reason? I don't think that it is a > kernel bug, but perhaps a wrong configuration for my platform.
Please try this (and revert your changes): ===== arch/arm/mm/consistent.c 1.27 vs edited ===== --- 1.27/arch/arm/mm/consistent.c 2005-01-21 05:02:14 +00:00 +++ edited/arch/arm/mm/consistent.c 2005-02-17 18:11:50 +00:00 @@ -284,13 +284,15 @@ spin_unlock_irqrestore(&consistent_lock, flags); if (c) { + unsigned long off = vma->vm_pgoff; + kern_size = (c->vm_end - c->vm_start) >> PAGE_SHIFT; - if (vma->vm_pgoff < kern_size && - user_size <= (kern_size - vma->vm_pgoff)) { + if (off < kern_size && + user_size <= (kern_size - off)) { vma->vm_flags |= VM_RESERVED; ret = remap_pfn_range(vma, vma->vm_start, - page_to_pfn(c->vm_pages), + page_to_pfn(c->vm_pages) + off, user_size, vma->vm_page_prot); } } -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/