From: "Antonino A. Daplas" <adaplas@gmail.com>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: "ruben quiñones ruiz" <yosoytelekin@hotmail.com>
Subject: Re: I can't get mapping ram work (Arm kernel 2.4 )
Date: Fri, 26 Aug 2005 01:57:07 +0800 [thread overview]
Message-ID: <430E0673.4080104@gmail.com> (raw)
In-Reply-To: <BAY109-F126BB75533BFE132A84B9EC8AB0@phx.gbl>
ruben quiñones ruiz wrote:
> Hello everybody,
>
> I'm developing a framebuffer display driver with an armv5 based
> architecture .
> I've been able to send commands and display what I want using the Ioctl
> methods (the display works fine).
>
> But now I want to add the framebuffer funcionality , so I wrote:
>
> static int slcdc_mmap(struct file *filp, struct vm_area_struct *vma)
> {
> unsigned long page,pos;
> unsigned long start = (unsigned long)vma->vm_start;
> unsigned long size = (unsigned long)(vma->vm_end-vma->vm_start);
> printk("\nMMAP CALLED");
> if(size > SLCDC_DATA_MEM_SIZE)
> return -EINVAL;
> pos = (unsigned long)slcdc_par.v_screen_start_address;
> while(size>0){
> page = virt_to_phys((void*)pos);
> vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
> // This is an IO map - tell maydump to skip this VMA
> vma->vm_flags |= VM_IO;
> vma->vm_flags |= VM_RESERVED;
> if(remap_page_range(start,page,PAGE_SIZE,PAGE_SHARED)){
> printk("\n\nERRORRRR!!!!!!!!");
> return -EAGAIN;
> }
> start+= PAGE_SIZE;
> pos+= PAGE_SIZE;
> size-= PAGE_SIZE;
> }
>
> return 0;
> }
>
> Where slcdc_par.v_screen_start_address; is the virtual adress of the
> databuffer that must be sent (via a dma provided by the Cpu).
How did you allocate this buffer? Is is system RAM? If it's system RAM,
did you use kmalloc, vmalloc or __get_free_pages. (kmalloc, vmalloc usually
do not work, you have to use __get_free_pages).
Tony
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
next prev parent reply other threads:[~2005-08-25 17:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20050825165333.3D585339DD@sc8-sf-spam1.sourceforge.net>
2005-08-25 17:19 ` I can't get mapping ram work (Arm kernel 2.4 ) ruben quiñones ruiz
2005-08-25 17:57 ` Antonino A. Daplas [this message]
2005-08-25 18:05 ruben quiñones ruiz
2005-08-26 2:05 ` Antonino A. Daplas
-- strict thread matches above, loose matches on Subject: below --
2005-08-26 8:07 ruben quiñones ruiz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=430E0673.4080104@gmail.com \
--to=adaplas@gmail.com \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=yosoytelekin@hotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.