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.

DM365_Oneshot mode_how to do vertical flip function

dear all,

In one shot mode, how can i use vertical flip function?

As DM365_VPFE datasheet, one-shot mode not supported  IPIPE Flip function and only ISIF flip data, write raw data in the SDRAM in one-shot mode.

but, ISIF support Horizontal Flip by HSIZE register. then,  i don't know how to do vertical flip function.

i wanna know method as simple as it.

pls advise me .

  • Can you please describe the scenario with more details?

    Are you capturing buffers into SDRAM from CCDC? Do you want to vertically flip frames in CCDC?

    Do you want to use Previewer in one-shot mode? Do you want to use RESIZER in one-shot mode? Do you want to vertically flip in one-shot modes? Please give us what exactly you are trying to achieve, what setup you are using.

    -Nag

  • As a result, i want to use vertically flip in one-shot mode  and i captured into SDRAM from CCDC.

    My system data flow is as below.

    Raw sensor -> IPIPEIF -> ISIF -> SDRAM -> IPIPEIF -> IPIPE -> SDRAM -> RESIZE(IPIPE-passthrough) -> Codec

    I checked about image flip in oneshot mode.

    In the non on-the-fly operation mode, ISIF flips the data and write raw data in the SDRAM. IPIPE does not
    flip data in the mode. (DM365 DMSoC Video Processing Front End - sprufg8b.pdf)

    but, if i try to control raw data in SDRAM. i think that vertical flip method is become complex.

    horizontal Flip is possible as using ISIF (HSIZE) register value setting and a little source modification. it is relatively simle.

    help me..

  • seol hee park,

    Looks like CCDC supports only horizontal flipping. Instead of using CCDC for flipping, you can use RESIZER for both vertical and horizontal flipping. [refer to section 6.4.21 of Dm365 VPFE user guide]. This is supported by RESIZER in both on-the-fly and single-shot modes. 

    ------------------------------------------------------------------------------------------------------------------------

    Note: The below statement doesn't mean "RESIZER doesn't support flipping in single-shot mode". It just trying to indicate that when IPIPE/IPIPEIF is not connected to CCDC(which is not on-the-fly mode), user has to use CCDC for flipping.

    In the non on-the-fly operation mode, ISIF flips the data and write raw data in the SDRAM. IPIPE does not
    flip data in the mode. (DM365 DMSoC Video Processing Front End - sprufg8b.pdf)

    Regards,

    Nag

  • thank you.

    and then, is it possible that image flip control just changing SEQ(Resizer register) value?

    i try it but result is failed.

    1. normal image (no flipping)

     

    2. h_flip = 1 / v_flip =0

    : in this case, it is very unnaturally image movement. it seem like that it loss of image.

    3. h_flip =0 , v_flip =1

    : in this case, upper of image is dummy data (stoped image) and lower of image( green color) is output.

     

    4. h_flip =1 , v_flip =1

    image is stopped.

    and i found about Image flip problem by E2E. device_driver(dm365_ipipe_hw.c) has bug.

    so i applied a modified source(red color).

     refer to below. (ps, image problem was same.)

    **********************************************************************************************

    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];
      

    #if 1  
      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);
    #endif  


    //  utemp = rsc_params->h_flip << RSZA_H_FLIP_SHIFT;
    //  utemp |= rsc_params->v_flip << RSZA_V_FLIP_SHIFT;
      reg_base = RSZ_EN_A;
      printk("<<<<<<<<shpark debugmesg!!>>>>>>>>\n");
     } else {
      rsc_params = &params->rsz_rsc_param[RSZ_B];
      rgb = &params->rsz2rgb[RSZ_B];
      ext_mem = &params->ext_mem_param[RSZ_B];
    #if 1  
      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); 
    #endif
    //  utemp = rsc_params->h_flip << RSZB_H_FLIP_SHIFT;
    //  utemp |= rsc_params->v_flip << RSZB_V_FLIP_SHIFT;
      reg_base = RSZ_EN_B;
      printk("<<<<<<<<shpark debugmesg2>>>>>>>>\n");
     }
     /* update flip settings */
     regw_rsz(utemp, RSZ_SEQ);

     regw_rsz(rsc_params->mode, reg_base + RSZ_MODE);
     utemp = (rsc_params->cen << RSZ_CEN_SHIFT) | rsc_params->yen;
     regw_rsz(utemp, reg_base + RSZ_420);

     

  • only h_flip enable. refer to avi.

  • seol hee park,

    Along with setting SEQ register, you have to make appropriate changes to SDRAM address as described in section 4.3.11.8 of VPFE user guide. Also, please make a note of bit 4 of SEQ register, you may have set the same based on your usage.

    Regards, Nag


  • Thanks Mr.Seol Hee Park,

    for the modified source, which helped me immidiately to solve my flip/Mirror setting.

    Other wise i couldn't have found out this bug in the kernel source code.

    Thank you very much.

  • Hi Mr.Seol Hee Park,

    Could you please help to explain how to do horizontal flip in single shot mode?

    I am using Linux 2.6.18 and try to do horizontal flip

    I changed HSIZE and CADL, but it did not work.

    Thank you very much!

    Ivy