|
From: Sven <lu...@dp...> - 2001-07-12 10:42:49
|
On Thu, Jul 12, 2001 at 11:57:42AM +0200, Romain Dolbeau wrote: > Hello, > > What happens exactly when an app mmap() a /dev/fb* ? > > If the framebuffer is one bunch of linear memory, > you obviously get access to that, starting from > the first byte. > > But what if a framebuffer use 2 discontinuous memory area, > say one for the main framebuffer, one for offscreen stuff > like overlay buffer, Z-buffer, texture... how can an app > access that ? > > Also, when returning the pointer to an offscreen memory > buffer, is it better to give the physical address, > or an offset from the base address of the FB ? my feeling is that you can mmap the whole region of it. Now, i am not sure if it is possible for a second app to mmap the same region, if it is, it could be considered a security problem. I also don't know if it is possible to mmap only a part of the fb memory, in order for a second app to mmap other parts of it. And the memory region are rarely now really dsicontinous, it is just a big memory region which is shared for different values, at least on consumer level boards, which don't have dedicated texture memory or such, like the wildcat boards for example. That said, X handles this by having an offscreen video memory manager and app, whose code you can find under xfree86/common/xf86fbman.c Friendl,y Sven Luther |