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.

Flip Resizer on DM365 VPFE

Hi all:

     I got a strange problem about the flipping in resizer module on DM365 VPFE.

     I have get two different YUV 420 outputs to display by using resizer module in continuous mode. When i would like flip the video output , there were some strange phenomenon.

     the original output image is followed:

     when I enable two output resizer,  and flip both output image (by setting h_flip=1, v_flip=1 in struct rsz_coninuous_config ), both outputs are not right, like the attached figures below. The output1's luminance looks like keeping null. The output1 and output2 images are followed:

 

     when I vertical flip the output1 image(no matter output2 flipping or not),  both output are not right. The output1's luminance is keeping stationary. The output1 and output2 images are followed:

 

     when I horizontal flip the output1 image(no matter output2 flipping or not), the output's horizontal flipping does not work , but the output2 image is right. The output1 and output2 images are followed:

 

     When I just only flip the output2 image(vertical or horizontal or both), the output1 and output2 images are both right.

     When I enable output1 resizer, disable output2 resizer, and flip the output1 image(vertical or horizontal or both), the output1 image is totally right.

     At last, I change the resizer mode to single-shot mode, the flipping problems remain the same.

     Above all,  I find that when I disable output2 resizer, the output1 flipping will get correct image. when I enable output2 resizer, the output1 flipping will get some problems:  1.the horizontal flipping does not work. 2. the vertical flipping make image Y component staticly and UV component disorderly. 3.the output2 will be distubed by output1's vertical flipping. 

     Can resizer module support  two fliping simultaneously ?

     Can you give me some suggestions about these problem?  

Thanks

Katee

  • who can help me?

    thanks

  • Hi,

    I got the exactly same issue as you and found it was a bug in the driver. Do the following changes into driver will fix the issue.

    In the file of ipipe_dm365_hw.c,

    static void rsz_set_rsz_regs(unsigned int rsz_id, struct ipipe_params *params)
    {
        struct ipipe_rsz_rescale_param *rsc_params;
        struct ipipe_rsz_resize2rgb *rgb;
        struct ipipe_ext_mem_param *ext_mem;
        u32 utemp, reg_base;

        utemp = regr_rsz(RSZ_SEQ);
        if (rsz_id == RSZ_A) {
            rsc_params = &params->rsz_rsc_param[RSZ_A];
            rgb = &params->rsz2rgb[RSZ_A];
            ext_mem = &params->ext_mem_param[RSZ_A];
            utemp = rsc_params->h_flip << RSZA_H_FLIP_SHIFT; ==> change to utemp |= rsc_params->h_flip << RSZA_H_FLIP_SHIFT
            utemp |= rsc_params->v_flip << RSZA_V_FLIP_SHIFT;
            reg_base = RSZ_EN_A;
        } else {
            rsc_params = &params->rsz_rsc_param[RSZ_B];
            rgb = &params->rsz2rgb[RSZ_B];
            ext_mem = &params->ext_mem_param[RSZ_B];
            utemp = rsc_params->h_flip << RSZB_H_FLIP_SHIFT; ==> change to utemp |= rsc_params->h_flip << RSZB_H_FLIP_SHIFT
            utemp |= rsc_params->v_flip << RSZB_V_FLIP_SHIFT;
            reg_base = RSZ_EN_B;
        }
        /* update flip settings */
        regw_rsz(utemp, RSZ_SEQ);

                :

    }

  • Ting-Yu, how do I include this changed file in my build to recompile it?  As linux newbie only using command line tools and not CCS.  Please help.

    thanks, Jinh

  • Hi,

    You don't need CCS. You just need to modify the file dm365_ipipe_hw.c (it should be located in /linux/drivers/char/) and re-build the linux kernel.

    Ting-Yu

  • Hi,

    You don't need CCS. You just need to modify the file dm365_ipipe_hw.c (it should be located in /linux/drivers/char/) and re-build the linux kernel.

    Ting-Yu

  • Hi,

       Deepley appreciate for your anwser.  These changes which you told me make my flipping on DM365 work right.

       Then, however I found another serious problem about flipping or IPIPE.

       When i firstly flip the output image(by changing h_flip=0=>1 or v_flip=0 => 1 or both), the both output images are right. However, when I restart (not power off) my application and flip the output image again(by changing h_flip=1=>0 or v_flip=1 => 0 or both),  there is something wrong with my application. The print information from kenerl is following:

    ==================================================================================

    Unable to handle kernel paging request at virtual address 56555661

    pgd = c3254000

    [56555661] *pgd=00000000

    Internal error: Oops: 1 [#1]

    Modules linked in: dm365mmap edmak irqk cmemk dm3651_gpio

    CPU: 0

    PC is at uart_write_room+0x14/0x30

    LR is at write_chan+0x110/0x348

    pc : [<c020cbb8>]    lr : [<c01eed44>]    Not tainted

    sp : c2eddeb0  ip : c2eddec0  fp : c2eddebc

    r10: c4a15340  r9 : c0aed000  r8 : c2edc000

    r7 : 00000048  r6 : c0aed000  r5 : c07f2000  r4 : c4a662e0

    r3 : 56555655  r2 : 00000002  r1 : c2eddec4  r0 : c07f2000

    Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  Segment user

    Control: 5317F

    Table: 83254000  DAC: 00000015

    Process avserver (pid: 757, stack limit = 0xc2edc258)

    Stack: (0xc2eddeb0 to 0xc2ede000)

    dea0:                                     c2eddf04 c2eddec0 c01eed44 c020cbb4

    dec0: c2eddf04 00000000 c4a662e0 c004d760 c07f212c c07f212c c2eddf04 00000048

    dee0: 40023000 c07f2000 00000048 c2edc000 c4a15340 00000048 c2eddf4c c2eddf08

    df00: c01eb830 c01eec44 00000024 c01eec34 c07f200c 00000000 c2eddf44 c2eddf28

    df20: c00ad628 c4a15340 40023000 c2eddf78 00000048 c003af88 c2edc000 00000000

    df40: c2eddf74 c2eddf50 c0098780 c01eb6c4 c0099620 00000000 00000000 00000000

    df60: c4a15340 00000004 c2eddfa4 c2eddf78 c00990ac c00986b4 00000000 00000000

    df80: c00977d4 00000001 00000001 00000048 40023000 404bf630 00000000 c2eddfa8

    dfa0: c003ade0 c0099078 00000048 40023000 00000001 40023000 00000048 00000000

    dfc0: 00000048 40023000 404bf630 00000004 00000048 00109290 00000005 4003677c

    dfe0: 00000000 41e93b00 4046e220 40454d14 60000010 00000001 54542448 8c624c52

    Backtrace:

    [<c020cba4>] (uart_write_room+0x0/0x30) from [<c01eed44>] (write_chan+0x110/0x348)

    [<c01eec34>] (write_chan+0x0/0x348) from [<c01eb830>] (tty_write+0x17c/0x228)

    [<c01eb6b4>] (tty_write+0x0/0x228) from [<c0098780>] (vfs_write+0xdc/0x1b8)

    [<c00986a4>] (vfs_write+0x0/0x1b8) from [<c00990ac>] (sys_write+0x44/0x70)

     r7 = 00000004  r6 = C4A15340  r5 = 00000000  r4 = 00000000

    [<c0099068>] (sys_write+0x0/0x70) from [<c003ade0>] (ret_fast_syscall+0x0/0x2c)

     r6 = 404BF630  r5 = 40023000  r4 = 00000048

    Code: e92dd800 e24cb004 e5903170 e5933010 (e593000c)

     prev->state: 2 != TASK_RUNNING??

    avserver/757[CPU#0]: BUG in __schedule at kernel/sched.c:3826

    ……

    =====================================================================

        Whether I modify the I ipipe_dm365_hw.c or not, this problem would existis when I change flip = 1 to flip = 0(vertical or horizenal)

        But if I don't change, there is no problem after I restart my application

        I think the IPIPE driver in dm365 cause this problem, but i can't find where.

        Can you give me some suggestions about this problem? 

        Do you have the same problem?

    Thanks

    Katee 

  • Sorry, I have no ideal about this issue.

    One thing you can try is to make sure you close all drivers before you restart your application.

    Ting-Yu

  • Thanks

    I will try...

    But if I don't change the flip 1 to 0(vertical or horizenal or both), there is no problem after I restart my application.

    Katee

  • Hi,

    I am using dm365 board with 2.6.32 kernel.I am also facing the same problem. When i run a camera application i am getting the output image in reverse format with greenish colour.I changed  ipipe_dm365_hw.c file as per ur suggestion but i didnt get any change. Where to change this h_flip value in kernel level.Can u please help me to solve this issue

  • Hi Katee,

    Have you solved your problem.

    I have the exact problem. After modified kernel driver, resizer A can do flipping. However once it flipped, it can not flip back. Restart application, reload driver does not help. Only power off and on...

  • Hi Ting-yu,

        utemp = rsc_params->h_flip << RSZA_H_FLIP_SHIFT; ==> change to utemp |= rsc_params->h_flip << RSZA_H_FLIP_SHIFT

    could you please explain why you made the change? arent they the same?

    thanks.

  • Hi,

    The reason of doing this is that "RSZ_SEQ" is losing its older value, if we dont do "|" operation with rsz_params->h_flip.

    Regards,

    Anshuman

    PS: Please mark this post as verified, if you think it has answered your question. Thanks.

  • oh ic. then again, if we use |, it wont clear the bit if we want to "flip back". maybe that's the reason why now i cant flip back. will do some test to see...

  • this solved my resizer problem:

     

            utemp = regr_rsz(RSZ_SEQ);
            if (rsz_id == RSZ_A) {
                    rsc_params = &params->rsz_rsc_param[RSZ_A];
                    rgb = &params->rsz2rgb[RSZ_A];
                    ext_mem = &params->ext_mem_param[RSZ_A];

                    if (rsc_params->h_flip)
                            utemp |= rsc_params->h_flip << RSZA_H_FLIP_SHIFT;
                    else
                            utemp &= ~(1 << RSZA_H_FLIP_SHIFT);

                    if (rsc_params->v_flip)
                            utemp |= rsc_params->v_flip << RSZA_V_FLIP_SHIFT;
                    else
                            utemp &= ~(1 << RSZA_V_FLIP_SHIFT);


                    reg_base = RSZ_EN_A;
            } else {
                    rsc_params = &params->rsz_rsc_param[RSZ_B];
                    rgb = &params->rsz2rgb[RSZ_B];
                    ext_mem = &params->ext_mem_param[RSZ_B];

                    if (rsc_params->h_flip)
                            utemp |= rsc_params->h_flip << RSZB_H_FLIP_SHIFT;
                    else
                            utemp &= ~(1 << RSZB_H_FLIP_SHIFT);

                    if (rsc_params->v_flip)
                            utemp |= rsc_params->v_flip << RSZB_V_FLIP_SHIFT;
                    else
                            utemp &= ~(1 << RSZB_V_FLIP_SHIFT);


                    reg_base = RSZ_EN_B;
            }