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.

about the VPFE buffer size

I use DM6437.Now I know there are 3 buffers for VPFE of DM6437 .The VPFE received the RAW Data.And the image size is 320*253 pixels.So the each buffer size  is 16120Bytes(equal to 640*253 ). But I find the addresses of  the three buffers are 0x80070C00, 0x80098500,  0x800BFD80. The space between 0x80070C00 and 0x80098500 is 162048 Bytes. But the space between 0x80098500 and 0x800BFD80 is 161920.

Why the first buffer is lager than the second and lager than the set-value?

I had increase the number of buffers for VPFE,the problem is also come. During every three buffers,there is a buffer has more 128Bytes than other two buffers. The buffer size is not consistent

Could help me to explain the problem?

  • Zhao,

    Could you please mention the BIOS PSP version which you are using and the sample application being used? 

    Thanks and Regards,

    Sandeep K

  • The DSP/BIOS version is bios_5_41_09_34.

    The dvsdk version is dvsdk_1_11_00_00.The PSP driver version is pspdrivers_1_10_00.

    Could you give me your e-mail?I will send the application that I used. Or you can send me your e-mail to my mailbox. My e-amil is yanlingzhao50@163.com.

    I set the number of buffer is 10. A frame size of video Raw data(YUV422) is 320*280 pixels.   The following is the example:

    Ser Addr Space size(Bytes)
    0 0x80070c00 179328
    1 0x8009c880 179200
    2 0x800c8480 179328
    3 0x800f4100 179200
    4 0x8011fd00 179328
    5 0x8014B980 179200
    6 0x80177580 179328
    7 0x801a3200 179200
    8 0x801cee00 179328
    9 0x801faa80 179200

    Wish your reply! Thank you!

  • Hi Zhao,

    As per my understanding you are using the FVID_allocBuffer() to allocate the buffer in your application, am i right?

    When you call the FVID_allocBuffer(), this will in turn call the DDC_VPFEAllocFrameBuffer() in the file (pspdrivers_1_10_00\packages\ti\sdo\pspdrivers\drivers\vpfe\src)ddc_vpfe.c. In this function, you can see, the PAL_osMemAlloc() function which will basically call the MEM_calloc() of the BIOS API. (definition for PAL_osMemAlloc() is available at pspdrivers_1_10_00\packages\ti\sdo\pspdrivers\pal_os\bios\src\pal_osMem.c )

    Inside the DDC_VPFEAllocFrameBuffer() when we call the PAL_osMemAlloc(), we use the buffer alignement 32 bytes and 128 bytes (third parameter of the  PAL_osMemAlloc() ), because of which when you take the difference between the successive buffers you are observing the variable gap.

    Note: The first  PAL_osMemAlloc() is for FVID_Frame structure (32 byte aligned) and the second PAL_osMemAlloc() is for actual buffer (128 bytes aligned).

    If i am right, then FVID_Frame structure address should have the value between 0x8009C800 and 0x8009C880. Please confirm.  

    Thanks and Regads,

    Sandeep K

  • Thank you very much  for your detailed reply!

    Sandeep Krishnaswamy said:
    As per my understanding you are using the FVID_allocBuffer() to allocate the buffer in your application, am i right?

    Yes,you are right!

    Sandeep Krishnaswamy said:
    If i am right, then FVID_Frame structure address should have the value between 0x8009C800 and 0x8009C880. Please confirm.  

    Yes,FVID_Frame structure address has the value between 0x8009C800 and 0x8009C880.

    Sandeep Krishnaswamy said:
    the second PAL_osMemAlloc() is for actual buffer (128 bytes aligned).

    So I think the address of  buffer should be divided by 128.The 0x80070C00 adds 320*2*280Bytes  should equal to 0x8009C800.The 0x8009C800 is also can be divided by 128.Why is it 0x8009C800+128Bytes?

  • Thanks for the confirmation.

    zhao yanjie said:

    So I think the address of  buffer should be divided by 128.The 0x80070C00 adds 320*2*280Bytes  should equal to 0x8009C800.The 0x8009C800 is also can be divided by 128.Why is it 0x8009C800+128Bytes?

     As you have mentioned, the FVID_Frame address falls between 0x8009C800 and 0x8009C880, then the next available address for the allocation with 128 bytes aligned is 0x8009C800 + 0x80 = 0x8009C880, which is what allocated for the next (second) buffer.

    The address 0x8009C800 cannot be allocated since the FVID_Frame structure allocation already done in the range 0x8009C800 and 0x8009C880. This happens because in DDC_VPFEAllocFrameBuffer() the FVID_Frame is allocated first and then the actual buffer will be allocated.

    Regards,

    Sandeep K

  • Thank you so much!

    Now,I understand.

    Wish you have a good day!