Re: m68k: trying accessing fb memory

angelo <[email protected]>
Newsgroups gmane.linux.uclinux.devel
Message-ID <[email protected]>
I confirm there is no chance to use framebuffer mmap() and MAP_SHARED to
access framebuffer screen memory with _coldfire_ _mcf5307_.

Actually, i call

buffer = mmap(0, buflen, PROT_WRITE, MAP_SHARED, fd, 0);

over fd open on "/dev/fb0" as ORDWR.

Call fail inside
mm/nommu.c, validate_mmap_request(), line 920



              if (flags & MAP_SHARED) {
                        /* do checks for writing, appending and locking */
                        if ((prot & PROT_WRITE) &&
                            !(file->f_mode & FMODE_WRITE))
                                return -EACCES;

                        if (IS_APPEND(file->f_path.dentry->d_inode) &&
                            (file->f_mode & FMODE_WRITE))
                                return -EACCES;

                        if
(locks_verify_locked(file->f_path.dentry->d_inode))
                                return -EAGAIN;

                        if (!(capabilities & BDI_CAP_MAP_DIRECT))
                        {
-->                             printk (KERN_INFO "ENODEV 2\n");
 -->                            return -ENODEV;
                        }


So, as i explained, i cannot have BDI_CAP_MAP_DIRECT for this
architecture, and the mmap call using MAP_SHARED fails.

Looking the code, error is still at a mmap params "validation" level,
and far from any "fb_mmap" to get called.

Code is complex, and still i can miss something. Anyway i hope you can
confirm i cannot use mmap() to access framebuffer for this cpu, or
maybe, you can suggest me some example that can do it.

Regards,
Angelo


On 12/12/2012 23:21, Gavin Lambert wrote:
> Quoth angelo:
>> thanks, well, i implemented the handler:
>>
>> static int amcorefb_mmap(struct fb_info *info, struct vm_area_struct
>> *vma) {
> 
> No, that's not the right one.  You don't need to implement that.
> 
>> Seems i miss the "get_unmapped_area/BDI_CAP_MAP_DIRECT) capability.
> 
> fbmem.c implements the main get_unmapped_area handler.  In your framebuffer
> driver you just need to either implement fb_get_unmapped_area or (easier,
> but only works on nommu) set fix.smem_start and .smem_len correctly in your
> fb_info.
> 

-- 


_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.