I want to do some very simple manipulation of the framebuffer on a pixel by pixel basis and I am
doing something like this at the moment:
main(){
int fbdev;
unsigned int fb;
int x,y,px;
fbdev=open("/dev/fb0", O_RDWR);
fb=(unsigned int )mmap(0, 640480sizeof(unsigned int), PROT_WRITE, MAP_SHARED, fbdev, 0);
for(y=0;y<480;y++){
for(x=0;x<640;x++){
px=x<<8;
fb[x+y*640]=px;
}
}
printf(“Done\n”);
}
Which works fine provided I stop X and the display was present / turn on at the start. If the display
is turned off and back on again the code executes fine but the display doesn’t change. The only
way I have of bringing back to life is to start and stop X again. There must be a better way to do this could
someone point me in the right direction*.
Cheers,
SA
- I have strace Xorg to see what it does and it OMAPFB_QUERY_PLANE and OMAPFB_SETUP_PLANE presumably
fixing the structure inbetween but I cannot find documentation for this and so far my attempts haven’t produced
the right results.