AnsweredAssumed Answered

How to direct a simple graphics application to a different framebuffer?

Question asked by Sudipta subudhi on Mar 18, 2015
Latest reply on Mar 30, 2015 by Bio_TICFSL



I am using a simple graphics application VertexColors.c in gpu_sdk_v1.00 from freescale. It has main(), init(),render(),resize() as the function blocks. and the flow of calls is like


1.main() => init() (i.e. main() is calling init())

2.init() => resize()

3.after init(), main() => render()

and then  eglSwapBuffers(egldisplay, eglsurface) is called.


And now to direct it to /dev/fb1 i assume i have to include:


        int fd_fb,result;

        //Applying color key

        struct mxcfb_color_key color_key;

        color_key.color_key = 0x0;

        color_key.enable = 1;

        if ((fd_fb = open("/dev/fb1", O_RDWR, 0)) < 0)


        return 0;


        if ( ioctl(fd_fb, MXCFB_SET_CLR_KEY, &color_key) < 0) {

        printf("Error in applying Color Key\n");



        struct mxcfb_loc_alpha loc_alpha;

        ioctl(fd_fb, FBIOBLANK, FB_BLANK_NORMAL);

        loc_alpha.enable = 1;

        loc_alpha.alpha_in_pixel = 1;

        result = ioctl(fd_fb, MXCFB_SET_LOC_ALPHA, &loc_alpha);

        if (result < 0)


                printf("fb ioctl MXCFB_SET_LOC_ALPHA fail\n");

                //goto err1;


        ioctl(fd_fb, MXCFB_WAIT_FOR_VSYNC, 0);

        ioctl(fd_fb, FBIOBLANK, FB_BLANK_UNBLANK);




Please correct me if i am wrong or if i am missing any details. But, i wonder where to include this piece of code in the given application.


Thanks in advance.