This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Android FB driving on AM3352

Other Parts Discussed in Thread: AM3352, AM3359, AM1808

Dear TI,

I'm using AM3352 for our Android based products. Because AM3352 doesn't have SGX support, surely I disabled that part and tested on AM3359-based EVM board (and BeagleBone also). The screen output color is wrong. It looks like R/B colors are swapped. Further, it has a lot of flickers when a dialog box shows up, or a selection widget pops up. So, where I should look at and get these problems fixed ?

Thanks in advance.

Max

  • You can remove the flickering tearing effect by modifying the android sources.

    Change 'hardware/libhardware/modules/gralloc/hardware/framebuffer.cpp' as follows:

    @@ -102,11 +102,28 @@ static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer)
             const size_t offset = hnd->base - m->framebuffer->base;
             m->info.activate = FB_ACTIVATE_VBL;
             m->info.yoffset = offset / m->finfo.line_length;
    +#if 0
             if (ioctl(m->framebuffer->fd, FBIOPUT_VSCREENINFO, &m->info) == -1) {
                 LOGE("FBIOPUT_VSCREENINFO failed");
                 m->base.unlock(&m->base, buffer);
                 return -errno;
             }
    +#else
    +#define FBIO_WAITFORVSYNC      _IOW('F', 0x20, __u32)
    +
    +        if (ioctl(m->framebuffer->fd, FBIOPAN_DISPLAY, &m->info)) {
    +            LOGE("ioctl FBIPAN_DISPLAY failed!!\n");
    +            m->base.unlock(&m->base, buffer);
    +            return -errno;
    +        }
    +
    +        if (ioctl(m->framebuffer->fd, FBIO_WAITFORVSYNC, 0)) {
    +            LOGE("FBIO_WAITFORVSYNC failed");
    +            m->base.unlock(&m->base, buffer);
    +            return -errno;
    +        }
    +#endif
    +
             m->currentBuffer = buffer;
             
         } else {

    The LCD colour-swap is a known hardware issue. Please refer the errata at http://www.ti.com/product/am3358

  • Hi Max,

    For R/B color swapping, please refer section 3.1.1 of Device errata http://www.ti.com/product/am3359.

    Regarding flicker, can you make sure if below changes are present in kernel you are using?

    http://arago-project.org/git/projects/?p=linux-am33x.git;a=commitdiff;h=346aefad0cb97b57e31d64f1535ef7c41973069a

    Thanks,

    Prakash

     

  • Thanks for your responses. I'll check both Android's framebuffer.cpp and kernel's FB driving today. Forgot to mention, I'm using Android SDK v2.1.1 released in 2011/12/12.

    About the color swap issue, the errata talks about hardware fix by modifying LCD panel's wiring. But I'm a little curious that, when I enable SGX driver, the color output is correct, both on EVM and BeagleBone's VNC output. But color is wrong if SGX driver is removed, also both on EVM's LCD and BeagleBone's VNC output. So, the RBG arrangement should be wrong in frame buffer memory. Is this also expected as errata describes?

    I'll also check with our h/w guys if they apply errata 3.1.1's fix when designing our own PCBA, but any chance to correct it by software ?

    Thank you and B.Regards

    Max

  • Hi, Vishveshwar,

    I add your patch to framebuffer.cpp but my problem remains. And the patch Prakash mentioned is already in my linux kernel build.

    Maybe I didn't describe my issue correctly. Here I post a screen shot to show it: (sorry that focus is not well)

    In this case, I try to move app list upward and let it overshot. When I release mouse, it will try to update screen,  then a triangle form of screen update behavior will come up.

    This screen shot is taken on BeagleBone's VNC output. TI's AM3359 EVM also has this behavior. This only happens when I disable SGX support. If I enable SGX support, everything is correct, including color.

    So is this the same issue as flickering/tearing effect?

    B.R.

    Max

  • That looks like tearing-effect.

    We have tested the patch ourselves to verify that the tearing-effect is not seen. Please make sure that the updated gralloc.default.so is copied to the filesystem.

    You may also wish to add some logs in the code to see if it is getting called or if the call failed. The logs will be seen in logcat output.

    AFAIK, SGX uses a similar approach to eliminate tearing-effect.

  • Hi, Vishveshwar,

    Yes, I'm sure it is copied to filesystem. 

    I saw your another reply on rowboat issues sites, it is about AM1808:

    http://code.google.com/p/rowboat/issues/detail?id=91

    You mentioned this:

    Re: flickering...
    In file rowboat/hardware/libhardware/modules/gralloc/framebuffer.cpp change the line
    #define NUM_BUFFERS 2 to
    #define NUM_BUFFERS 1

    I tried this on BeagleBone, and the tearing effect seems gone. Is this the one that I should included in my build ?

    B.R.

    Max

  • Changing NUM_BUFFERS to 1 forces android to use single-buffer mode. There will be no tearing-effect  but the display would seem to be slower.

    You can continue with single-buffer mode if it satisfies your requirements.

  • Hi Max,

    I am trapped with the same issue of  running android based AM3352,  how do you resolve the flickering problem  ? 

    Would you offer me some help? Thanks for  your kindness?

    Best wishes

    sibling

  • Hi MAX,

    I have similar issue with my AM3352 custom board.

    If i run QT and linux then color is ok. Problem with android only.

    Have find solution?????

    Regards,

    Bharat Gohil

  • Hi Gentlemen,

    Is there a good solution in firmware to resolve the problem -- red/blue swaped ? thank you in advanced!!!!