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.

[Solved]How to get Linux framebuffer fully displayed on an interlaced mode DVO?

I am using RDK4.0 with TI8168. In my application cases,

DVO2 output has two input inner sources, graphics0 and video0.

I have 1280x720 ARGB framebuffer which uses graphics0 with built-in scaler and

SwMs output with 1920x1080 YUYV format which uses video0.

When DVO2 works in 1080P60, both of them can be fully displayed(alpha blending enabled).

When DVO2 works in 1080I60, both of them will be displayed abnormally.

It seem that DVO2 skip bottom field of the two sources.

I notice that FVID2_Format and FVID2_Frame have some members to process progressive frame to be displayed

as interlaced frame without skipping one field of frame.

So I modified displayLink_drv.c and finally I get the output of SwMs(progressive frame) to be fully displayed without skipping one fileld of frame.

But when I applied the same mechanism to graphic driver in grpx.c in the kernel sources.

It failed to start the framebuffer, these are the debug messages:

VPSS_GRPX : start grpx0
VPSS_GRPX : (0)- get resolution.
VPSS_DCTRL: enter get output format
VPSS_FVID2: send control with cmd 0x1004001a
VPSS_FVID2: control event 0x1004001a return 0 within 0 ms.
VPSS_FVID2: send control with cmd 0x00000003
VPSS_FVID2: control event 0x3 return 0 within 0 ms.
VPSS_FVID2: send control with cmd 0x10000002
VPSS_FVID2: control event 0x10000002 return -1 within 0 ms.
ti81xxfb ti81xxfb: failed to star.

How to get the progressive frame of framebuffer to be fully displayed on an interlaced DVO with

the built-in scaler enabled?

Thanks!

  • Pls explain your data flow for video and the changes you did to display full video frame when showing 1080i60 in displayLink. Also mention what changes you did to the grpx driver

  • Badri Narayanan said:

    Pls explain your data flow for video and the changes you did to display full video frame when showing 1080i60 in displayLink. Also mention what changes you did to the grpx driver

    Hi Narayanan, thanks for you replay. Here are my data flows:

    (YUVSP420)                     (1920x1080P YUYV420)

    VIP0-------->Merge------->SwMs----------------------->Display(DVO2 with 1080I@60)

                  ^                                         ^

    (YUVSP420)    |                                         | (scale up to 1920x1080)

    VIP1----------|                                                                                         linux fb0(ARGB 1280x720)

    two captures will be merged to SwMs, which produces 1920x1080P video frame.

    Linux fb0 is 1280x720. It will be scaled up to 1920x1080 by Graphic built-in SC.

    For displayLink_drv.c I just made a few changes:

    In DisplayLink_drvProcessData, I changed

    pFrame->addr[1][0] =
        (UInt8 *) pFrame->addr[0][0] + pitch0;
    pFrame->addr[1][1] =
        (UInt8 *) pFrame->addr[0][1] + pitch1;

    to

    pFrame->addr[1][0] =
        (UInt8 *) pFrame->addr[0][0];
    pFrame->addr[1][1] =
        (UInt8 *) pFrame->addr[0][1];

    This may be strange, because according to the document of FVID2,

    the former one is right. But in actually the video will be displayed abnormally.

    I read relative sources of hdvpss and know that when filedMerged member in FVID2_Format

    is set, the VPDMA will work with a effective pitch with double.

    So I try the latter one, to my surprise, the video was displayed normally.

    I think maybe the Graphics have the same behaviour.

    So I made a few changes in grpx.c in kernel.

    The first one:

    static int vps_grpx_start(struct vps_grpx_ctrl *gctrl)
    {
        int r = 0;
        VPSSDBG("start grpx%d\n", gctrl->grpx_num);
        if ((gctrl == NULL) || (gctrl->handle == NULL))
            return -EINVAL;

        if (!gctrl->gstate.isstarted) {
            grpx_pre_start(gctrl);
            /*start everything over, set format,
              params, queue buffer*/
    #if 1  /* xyf for test */
            gctrl->inputf->fieldmerged[0] = true;
            gctrl->inputf->fieldmerged[1] = true;
            gctrl->inputf->fieldmerged[2] = true;
            gctrl->inputf->scanformat = FVID2_SF_INTERLACED;
    #endif

    The second one:

    static int vps_grpx_set_buffer(struct vps_grpx_ctrl *gctrl,
                 u32 buffer_addr)
    {
        int r = 0;

        VPSSDBG("(%d)- add buffer %#x\n", gctrl->grpx_num, buffer_addr);

        grpx_cs_lock(gctrl);
        gctrl->buffer_addr = buffer_addr;
        gctrl->frames->addr[FVID2_RGB_ADDR_IDX]
            [FVID2_RGB_ADDR_IDX] = (void *)buffer_addr;
        /* BEGIN: Added by xyf, 2013/09/02   PN:pn*/
        gctrl->frames->addr[1]
            [FVID2_RGB_ADDR_IDX] = (void *)(buffer_addr);
        /* END:   Added by xyf, 2013/09/02 */

        grpx_cs_free(gctrl);
        return r;
    }
    But the grpx couldn't be started.

  • Is your capture 1080P60 capture ? WHat is the swms outputFPS and are you setting displayLink create params. forceFieldSeparatedInputMode to TRUE.

  • Hi Json Hsui,

    I am also using IPNC_RDK_3.8.0. I want to use framebuffer device nodes for QT applications on my board.

    I am able to create /dev/fb0 node , when I insert ti81xxfb.ko kernel module. But when my application tries to open that node, it gives an error.

    Driver says: ti81xxfb: failed to start

    debugging the issue further, I could find that error comes from grpx.c file

    function vps_fvid2_control is returning -1, when vps_fvid2_start is called.

    Please assist me on this issue.

    I am juggling through this, for last few days. Any help would be highly appreciated.

    Thanks,

    Krinali Shah

  • I am not sure what problem you meet.
    I modified grpx.c and ti81xxfb to meet my case.
    I suggest you to add some debug infomation in hdvpss grpx source code to see what's wrong.