Re: How to use ISRAm as a frame buffer in Linux
From: Prakhar Vig <hidden>
Date: 2006-05-31 09:40:58
Hi Antonino, thanks for ur help. As u have told I am using an application that reads a data from framebuffer by opening /dev/fb0. I am attaching the code for ur convineance, I would like to ask following questions: 1) In this code I am using mmap to allocate memory to frame buffer which has one argument MAP_SHARED or MAP_PRIVATE. Could you please explain for what this meant for i.e whether it ie related to allocation in SDRAM or ISRAM. MAP_SHARED in SDRAM and MAP_PRIVATE in ISRAM is it so. 2) If not, Could you please tell me how to allocate framebuffer to ISRAM as is faster to access from ISRAM than SDRAM. 3) Also, tell me whether I need to use DMA to access data from ISRAM, will it improve the speed of accessing the data from ISRAM. Is it mandatory to use DMA if you want to make it work fast. Once again thanks for yr earnest help. Thanks And Regards Prakhar On 5/31/06, Antonino A. Daplas [off-list ref] wrote:
Prakhar Vig wrote:quoted
Hi Antonino, I tried reading the data from framebuffer using cat as u have told, I wrote the following command: cat /dev/fb0 > image.txt Is the command correct or not, as I am getting some corrupted data...... Below is the some part of data, which I am getting:W<8d>õ<8c>^U<8d>Ã<8c><8c>c<86>2^D"Ã(c)^YÃ2Ã*uC[\<9c>dÃ^\m^\u]u|}\}}}<9d><85>^?<8^?<85>¿<8d>Ã<8d>þ<95>Ã<95>ý<95>ý<95>ÿ<9d>ÿ<9d>^_<9e>^_<9e>^_<9e>?<9e>><9e>9d><98>Â¥pquoted
And could you please tell me how to get the RGB data from framebuffer.What you get is raw framebuffer format. If you 'cat image.txt > /dev/fb0', you'll get the same image you dumped previously. In order for it to be read by an image viewer, you have to convert it into a standard format. Try searching for fbshot or fbgrab and look at the source. Tony