[okl4-developer] Starting with graphic output
Remy Gottschalk
rgottschalk at linagora.com
Sat Apr 26 03:26:35 EST 2008
On Fri, 2008-04-25 at 21:55 +1000, Geoffrey Lee wrote:
>
> Hi Remy
>
Hi
>
> >
> > > As a quick fix you may be able to add a quick hack to eas_map() to
> > > add backdoor range check for your framebuffer physical range.
> >
> > Strangely it seems that my mmap request doesn't arrive to eas_map. I
> > don't really understand what this could means.
> >
>
> How are you mmaping the device? mmaping memory in userspace should arrive at
> eas_map(), this suggests to me that it is failing some check earlier on.
> I suggest using printk() or similar to trace the execution to find
> out where and why exaclty the mmap() call is failing.
>
> -gl
>
I did what you suggested and tracked down where the mmap call fail and
what I found is pretty unexpected.
So if I open the framebuffer with RW rights.
fb_fd = open("/dev/fb0", O_RDWR);
When i mmap it
fb_p = (char *)mmap(0, screensize, PROT_READ | PROT_WRITE, MAP_SHARED,
fb_fd, 0);
My mmap call goes its way to do_mmap_pgoff in mm/mmap.c and fail at a
basic check :
if ((prot&PROT_WRITE) && !(file->f_mode&FMODE_WRITE))
return -EACCES;
This check only verify if when asking a mapping with write access the
file is open with write right.
And when I open the device with writing right only (witch is sufficient
after all since i just want to get my framebuffer uggly :) ) it all goes
fine and I get the good old roottask pagefault at 0x18.
By the way the open goes fine and return no error. Furthermore I can
achieve successful ioctls on the device such as blank screen and
retrieving information structures.
I didn't dig in more for now but it seems that there some problem with
file rights.
I guess I will wait a little before playing with framebuffer or use it a
different way.
Regards,
--
Remy Gottschalk - rgottschalk at linagora.com
Ingénieur informatique embarquée
Groupe LINAGORA - http://www.linagora.com
Tél.: +33(0)1 58 18 68 28 - Fax : +33(0)1 58 18 68 29
More information about the Developer
mailing list