AnsweredAssumed Answered

Global alpha blending (transparency) not working on i.MX6

Question asked by ralph__ on Nov 13, 2014

I'm having trouble global alpha blending on my i.MX6. Here is what I am doing:


1) Run "export VSALPHA=1"

2) Run "echo "S:1920x1080p-60" > /sys/class/graphics/fb0/mode"

3) Run "echo "D:1920x1080p-60" > /sys/class/graphics/fb2/mode" - at this step my LCD attached by LVDS turns on for some reason. :-S

4) Run "echo 24 > /sys/class/graphics/fb0/bits_per_pixel"

5) Run "echo 24 > /sys/class/graphics/fb2/bits_per_pixel"

6) Display an image on fb0 and fb2 by using mmap to write directly to the framebuffer memory. At this stage I see the image I put on fb0 on screen.

7) I set the global alpha blending to be 50% on fb0 and fb2 however the ioctl fails to set the alpha on fb2 for a reason unknown to me. Here is the code I use:


    int fd = open("/dev/fb0", O_RDWR | O_CLOEXEC);
    if(fd == -1)
        printf("open error!!!\n");
    struct mxcfb_gbl_alpha g_alpha;
    g_alpha.alpha = 127;  //alpha value
    g_alpha.enable = 1;
    if (ioctl(fd, MXCFB_SET_GBL_ALPHA, &g_alpha) < 0)
        printf( "Set global alpha failed\n");
        printf("Set global alpha succeeded\n");


At this stage I would expect fb0 and fb2 to be blended together with 50% of each but I still only see the image on fb0. What am I doing wrong? Is it something to do with my kernel command line?

Here are the kernel boot parameters:


console=ttymxc1,115200 earlyprintk video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24 video=mxcfb1:dev=ldb,1024x600M@60,if=RGB666 video=mxcfb2:dev=lcd,CLAA-WVGA,if=RGB666 serverip= board_serial=EVAL5 fbmem=28M,10M,10M vmalloc=400M rootwait consoleblank=0 enable_wait_mode=off maxcpus=0


I tried putting this:


but that didn't fix anything.

Thanks in advance.