Re: m68k: trying accessing fb memory

angelo <[email protected]>
Newsgroups gmane.linux.uclinux.devel
Message-ID <[email protected]>
Hi Lambert,

thanks, well, i implemented the handler:

static int amcorefb_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
	printk(KERN_INFO "AMCORE frame buffer: mmapping\r\n");

	...
	
}

static struct fb_ops amcorefb_ops = {
	.owner			= THIS_MODULE,
	.fb_open		= amcorefb_open,
	.fb_write		= amcorefb_write,
	.fb_release		= amcorefb_release,
	.fb_pan_display		= amcorefb_pan_display,
	.fb_fillrect		= amcorefb_fillrect,
	.fb_copyarea		= amcorefb_copyarea,
	.fb_imageblit		= amcorefb_imageblit,
 -->    .fb_mmap                = amcorefb_mmap,
};

But "amcorefb_mmap" never get called (no printk output).

mmap(), when used with MAP_SHARED, returns error 19 (ENODEV)

Looking inside nommu.c, seems the error is generated from this line:

	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))
          -->		return -ENODEV;


Seems i miss the "get_unmapped_area/BDI_CAP_MAP_DIRECT) capability.
Could this be due to the fact i am using a mainline kernel ?

Regards,
Angelo


On 12/12/2012 22:37, Gavin Lambert wrote:
> Quoth angelo:
>> I have written then a little framebuffer driver for a 128x64 graphic 
>> lcd.
> [...]
>> buffer = mmap( 0, buflen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 ); 
>> This fails (-1) Then i tried:
>> buffer = mmap( 0, buflen, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0 
>> ); works, returns a valid pointer, but i cannot see any change on the 
>> screen writing in this area.
> 
> Have you read the nommu mmap documentation in the kernel tree?  You have to
> implement an extra handler in your driver in order to support shared mmaps
> on nommu.
> 





-- 


_______________________________________________
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.