* Framebuffer using system memory
@ 2009-04-25 1:13 Alessio Sangalli
2009-04-25 7:45 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: Alessio Sangalli @ 2009-04-25 1:13 UTC (permalink / raw)
To: linux-fbdev-devel@lists.sourceforge.net
Hi I am working on a framebuffer that uses the system memory.
What I mean here is that I need to pass mem=120M to a system that has
128MB to "reserve" 8MB of memory for the framebuffer; then I program the
hardware to use that region of memory.
The reason I do this is that it seems impossible to kmalloc more that
4MB of contiguos physical memory with the Linux Kernel.
Bottom line, I do not know how to map those 8MB back to userspace. If
userspace opens mmaps /dev/mem and writes to the appropriate location it
can access the fb perfectly.
Any hints? All of this is on ARM9.
Thank you
Alessio
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Framebuffer using system memory
2009-04-25 1:13 Framebuffer using system memory Alessio Sangalli
@ 2009-04-25 7:45 ` Geert Uytterhoeven
2009-04-25 9:37 ` Alessio Sangalli
2009-04-25 19:08 ` Alessio Sangalli
0 siblings, 2 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2009-04-25 7:45 UTC (permalink / raw)
To: Alessio Sangalli; +Cc: linux-fbdev-devel@lists.sourceforge.net
On Sat, Apr 25, 2009 at 03:13, Alessio Sangalli <alesan@manoweb.com> wrote:
> Hi I am working on a framebuffer that uses the system memory.
>
> What I mean here is that I need to pass mem=120M to a system that has
> 128MB to "reserve" 8MB of memory for the framebuffer; then I program the
> hardware to use that region of memory.
>
> The reason I do this is that it seems impossible to kmalloc more that
> 4MB of contiguos physical memory with the Linux Kernel.
>
> Bottom line, I do not know how to map those 8MB back to userspace. If
> userspace opens mmaps /dev/mem and writes to the appropriate location it
> can access the fb perfectly.
>
> Any hints? All of this is on ARM9.
Alternatively, you could use__alloc_bootmem() in the early platform
code to reserve
the memory, cfr. arch/powerpc/platforms/ps3/setup.c
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Framebuffer using system memory
2009-04-25 7:45 ` Geert Uytterhoeven
@ 2009-04-25 9:37 ` Alessio Sangalli
2009-04-25 19:08 ` Alessio Sangalli
1 sibling, 0 replies; 5+ messages in thread
From: Alessio Sangalli @ 2009-04-25 9:37 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-fbdev-devel@lists.sourceforge.net
Geert Uytterhoeven wrote:
> Alternatively, you could use__alloc_bootmem() in the early platform
> code to reserve
> the memory, cfr. arch/powerpc/platforms/ps3/setup.c
Yeah thanks, that example is pretty complete. I will try that. Anyway,
for my personal curiosity, is it possible at all to map memory not
managed by the kernel to userspace?
bye
as
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Framebuffer using system memory
2009-04-25 7:45 ` Geert Uytterhoeven
2009-04-25 9:37 ` Alessio Sangalli
@ 2009-04-25 19:08 ` Alessio Sangalli
2009-04-26 18:03 ` Geert Uytterhoeven
1 sibling, 1 reply; 5+ messages in thread
From: Alessio Sangalli @ 2009-04-25 19:08 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-fbdev-devel@lists.sourceforge.net
Geert Uytterhoeven wrote:
> Alternatively, you could use__alloc_bootmem() in the early platform
> code to reserve
> the memory, cfr. arch/powerpc/platforms/ps3/setup.c
So the usage patter seems to be:
- I use __alloc_bootmem() to reserve memory
- I export a structure that contains data about this memory (location
and size mainly)
- In the init of my framebuffer driver I use the data in that structure
to configure the hardware
- I map that area of memory to userspace when they try to mmap() this fb
device
Can you comment on this?
bye
Alessio
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Framebuffer using system memory
2009-04-25 19:08 ` Alessio Sangalli
@ 2009-04-26 18:03 ` Geert Uytterhoeven
0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2009-04-26 18:03 UTC (permalink / raw)
To: Alessio Sangalli; +Cc: linux-fbdev-devel@lists.sourceforge.net
On Sat, Apr 25, 2009 at 21:08, Alessio Sangalli <alesan@manoweb.com> wrote:
> Geert Uytterhoeven wrote:
>
>> Alternatively, you could use__alloc_bootmem() in the early platform
>> code to reserve
>> the memory, cfr. arch/powerpc/platforms/ps3/setup.c
>
>
> So the usage patter seems to be:
>
> - I use __alloc_bootmem() to reserve memory
> - I export a structure that contains data about this memory (location
> and size mainly)
> - In the init of my framebuffer driver I use the data in that structure
> to configure the hardware
> - I map that area of memory to userspace when they try to mmap() this fb
> device
>
> Can you comment on this?
That's correct. Note that you don't have to do anything special for mmap()
(i.e. you do not need your own device-specific fb_mmap()), as the default one
should work fine.
If you use a platform device, you can store the memory location and size in the
platform device's platform data.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-04-26 18:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-25 1:13 Framebuffer using system memory Alessio Sangalli
2009-04-25 7:45 ` Geert Uytterhoeven
2009-04-25 9:37 ` Alessio Sangalli
2009-04-25 19:08 ` Alessio Sangalli
2009-04-26 18:03 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).