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.

VPort Access DM6446

Hello There,

                Is there a CSL available to access the Video Ports on DM6446 from the DSP side?

                I know that TI does not support the peripheral access from the DSP side on DM6446. I am looking for CSL written by developers who would have accessed Vport from the DSP side.

-Regards                                                                                                                                                                                                                                                 Vallabha

                   

  

  • Unfortunately there is no driver or chip support library type software for the C64x+ on the DM6446, as shown in the datasheet memory map most peripherals are considered reserved to the C64x+ anyway, thus the physical connection to the peripheral from the C64x+ is not validated or tested and we cannot guarantee it will work.

  • Thanks for the reply.

    I have few more queries about the VPort.

    If I do not use the standard drivers provided and want to write my own library for handling the video port (ARM Side), then 

    1) Which module of VPBE should I use, OSD or VENC or combination of both to send the video out on composite port?

    2) I have a YUV (4:2:0) file loaded into memory. What are the typical steps to be followed (Without using the standard drivers) to get it on the display using composite video port?

    -Regards port

    Vallabha

     

  • 1) You will need both hardware blocks, OSD and VENC (and internal DACs)

    2) If you look at the VPBE UG (http://focus.ti.com/lit/ug/sprue37c/sprue37c.pdf), you will see the the OSD can only read in YCbCr 422 for video windows (420 is not supported).

     

  • To elaborate further, you do need both OSD and VENC to display something, the OSD portion collects the data from memory and the VENC itself actually does the final formatting to display. As Juan mentions the VPSS works in 4:2:2 so if you have a 4:2:0 image you will have to expand it out in software before giving it to your display driver.

    As to what steps need to be followed I think this is best covered by chapter 5 of SPRUE37, though this gives a fairly vague description and not specific steps that must be done, for an example of what exact steps need to be taken you will probably want to examine the existing driver code. The vast majority of what needs to be done is simply configuration of the VPSS, the OSD needs to be setup to access your buffer properly and the VENC needs to be configured to conform to your display standard. Once it is configured properly the rest is just a matter of letting it run and taking the frame completion events to know when to give a new frame to the display at which point the VPSS must be shown to the next buffer you want to display. Once it is configured and started if you never touched it than it would just output the same image buffer over and over.

  • Thanks Juan & Bernie for your response.

    I have done the following to display a YUV. I dont see anything happening on the screen Let me know if I'm missing something.

    void main()
    {
       INT8 *Y;

       Y  = 0x80000004;

       memcpy (Y,  logo_y, SIZE_Y);
       memcpy (Y+SIZE_Y, logo_u, SIZE_U);
       memcpy (Y+SIZE_Y+SIZE_U, logo_v, SIZE_V);

       VENC_Init ();
       OSD_Init ();

      Display_YUV ();
     
    }

    void VENC_Init ()
    {
     /************************VENC INIT**************************************/

     VMOD   = 0x00000000u;   /* Disbale VENC */

     VMOD   = 0x00001403u;   /* YCbcr, Non-Interlace, SDTV, NTSC, Master, Composite Vid, Enable */  

     }

    void OSD_Init()
    {
     /************************OSD INIT***************************************/

     OSDMOD   = 0x00008000u;   /* Cb/Cr mode */

     OSDWIN0MD   = 0x00000000u;   /* Disabling OSD Win 0 */
    }


    void Display_YUV ()
    {
     /************************OSD SETUP***************************************/
     OSDWIN0ADR    = 0x80000004u;    /* YUV Address */
     OSDWIN0OFST  = 0x00000003u;    /* Horizontal Offset 8-bit mode round (((widx8)/8)/32) */
     
     OSDWIN0XP  = 0x00000000u;       /* Display X Position */
     OSDWIN0YP  = 0x00000000u;       /* Display Y Position */
     
     OSDWIN0XL  = 0x00000050u;       /* Frame Width  80 */
     OSDWIN0YL  = 0x00000046u;       /* Frame Height 140/2 */

     OSDWIN0MD  = 0x00000002u;     /* Disabling Zoom & Setting Frame type */
     VIDWINMD     = 0x00000002u;        /* Disabling Expansion */

     OSDWIN0MD  = 0x00000001u;     /* Activate OSD Win 0 */
    }

     

  • OSD hardware block has 4 windows, two OSD and two Video.  The video windows support YCbCr 422, the OSD windows do not.  From your code snippet, it appears you are trying to send YUV data to OSD0 window.  See http://focus.ti.com/lit/ug/sprue37c/sprue37c.pdf for more details.

    Also, I assume you are develpoing this in CCS under windows; is this correct?

    Regardless of your development enviroment, there are Linux software drivers provided with DVSDK software that you can use as reference code; by the amount of registers that are being programmed above, there may be other registers that you are missing.

     

  • Thanks Juan.

    Yes Im trying to send the image out via OSD Window 0. And Im doing this on the CCS.

    "The video windows support YCbCr 422, the OSD windows do not."

    Neither VENC or OSD has an option for specifying the YUV format. So Im assuming that they only support YUV 422.

  • YCbCr is the default pixel format for the video windows (not the OSD windows), but you can use MISCCTL register to condifure one of the video windows to accept RGB888 instead.

    There are similar control registers for OSD windows to switch between RGB and bitmap (YCbCr not supported in OSD windows).

    All of this is documented in VPBE UG (http://focus.ti.com/lit/ug/sprue37c/sprue37c.pdf); please take a look at this document as it will probrably be very useful for what you are trying to do.

  • Now I have programmed to use the Video Win0. I have followed the steps mentioned in SPRAAN0 (http://focus.ti.com/apps/docs/techdocsabstract.tsp?appId=79&abstractName=spraan0).

    Code:

    ---------

    void main()
    {
     UINT8  *YUV;

     YUV = (UINT8 *)0x80600000;

     memcpy (YUV, Lena, 512*1024);  /* YUV 422 Data */

     /* Initialization */
     OSDWIN_Init  ();

     /* Display YUV */
     Display_YUV ();
     
    }

    void Display_YUV ()
    {
      VID_Display();
      VENC_Init ();
    }

    void VENC_Init ()
    {
     VMOD   = 0x00000000u;  /*  Disable VENC */

     VDPRO   = 0x00000022u;  /*  YCbCR -> 0 - 255 C Sig Up Sampling */

     CVBS   = 0x00000000u;  /*  Set NTSC O/P 0% */

     DACTST   = 0x00000000u;  /*  Set all the DAC's Power to Normal Mode */

     HSPLS   = 120;
     VSPLS   = 18;
     HINT   = 1649;
     HSTART   = 300;
     HVALID   = 512;
     VINT   = 749;
     VSTART   = 26;
     VVALID   = 512;
     HSDLY   = 0;
     VSDLY   = 0;
     YCCTL   = 0;
     VSTARTA   = 0;

     DCLKCTL      = 0x00000800;
     DCLKPTN0      = 1;
     DCLKPTN1      = 0;
     DCLKPTN2      = 0;
     DCLKPTN3     = 0;
      DCLKPTN0A    = 2;
      DCLKPTN1A     = 0;
      DCLKPTN2A     = 0;
     DCLKPTN3A     = 0;
     DCLKHS        = 0;
     DCLKHSA      = 1;
     DCLKHR       = 0;
     DCLKVS        = 0;
     DCLKVR       = 0;

     LCDOUT   = 0x1;
     SYNCTL   = 0x00000003u;

     VMOD   = 0x00000001u;  /*  8-bit YCbCr SDTV, NTSC, Interlace Slave, Composite Vid VENC Enable */

    }

    void OSDWIN_Init()
    {
     OSDMOD   = 0x00000000u;  /*  Cb/Cr mode Expansion Filter - Disable Vert & Horz Exapnsion - Disbale Field Signal Inversion - FALSE BCLUT - ROM, CABG = 00 */

     VIDWINMD  = 0x00000000u;  /*  Disable Video Win0 */

     BASEPX   = 120;    /*  Horz Disp Reference */
     BASEPY   = 18;     /*  Vert Disp Reference */
    }

    void VID_Display()
    {
     VIDWIN0OFST  = 512/16;   /*  Horizontal Offset 8-bit mode round */

     VIDWIN0ADR  = 0x80600000u;  /*  YUV Address */

     VIDWIN0XP  = 0x00000000u;  /*  Display X Position */

     VIDWIN0YP  = 0x00000000u;  /*  Display Y Position */

     VIDWIN0XL  = 512;    /*  Frame Width */

     VIDWIN0YL  = 512/2;   /*  Frame Height */

     VIDWINMD  = 0x00000002u;  /*  Setting Video Win0 FRAME TYPE */

     VIDWINMD   = 0x00000001u;  /*  Activate Video Win0 */
     
    }

    Can somebody give me a pointer as to what I might be missing.

     

  • Do you still see nothing on the screen?  Are you trying to enable analog (composite video output on EVM) or digital video output (DC5 connector on EVM, requires daughter card)?  Please note that the App Note you mentioned above pertains to digital video output.

    If you are indeed doing digital video, the first thing I would check is to make sure you have a clock signal out of VCLK pin (using an oscilloscope).

    In either case (analog or digital), I would enable the color pattern bar feature in the hardware and get VENC working first (reduce variables that can go wrong); once VENC is working, you can use your own buffered data as in your program and focus on making sure OSD hardware is properly configured.

     

  • Thanks for your inputs Juan.

    I made the changes and now I am able to get the display. [:)]

    Theres however a strange behaviour. I have the display format to be NTSC (720x480).

    Now when I try to display an image of size (512x512, YUV 422) I get 3 strips of the original image rather than 1 image.

    What might be the cause?

  • One more quick question.

    Is there any condition on the YUV formatting? Does it support both Planar & Packed format for YUV 422? 

     

  • Fixed the issues.

    Now on the display I see the image properly with the specified Height & Width. Fomated the YUV data to 422 interleaved.

    On the other hand I see the colors inverted [:(]

    The image has whole lot of violet & green. 

     

  • I can see you have been busy at work :).  It appears you have already figured out most of the questions you asked on your own, so I will stick to responding to your last post

    With regards to the inverted colors, there is an option on the video back end to swap order of Cb and Cr components; I believe this may be the source of this issue; see YCCCTL.YCP register field in VPBE UG (http://focus.ti.com/lit/ug/spruf72c/spruf72c.pdf)

     

  • Thanks for the input Juan.

    I had tried modifying that register field (YCCTL.YCP) but to no avail. Changing its value had no effect on the output what so ever.

    Although YCCTL.CHM = 0, the device still latches the chroma value at the first pixel.

    So I changed my input file with UYVY format and now it produces the correct output. I dont know why this behaviour. 

  • so it appears that it was not the chroma values themselves that were swaped, but rather the Luma and chroma values (e.g. Y bus and CbCr bus); fortunately, there is also a regiter field in the VPBE that can be used to swap Y and CbCr bus (no need to change your input source). see "VIDCTL.YCSWAP" register field in VPBE UG.

  • Just a note on the YCSWAP bit, it only effectively does a Y and CbCr swapping if you are using YCC16 (16 bit bus), if you are using YCC8 (8 bit bus) this just swaps which bus the YCC8 data comes out on. In the case of YCC8 the YCP bits are what you want to change to modify the YCbCr ordering as shown in section 6.2.15 of SPRUE37.

    I should have caught this previously, but the neon green and pinkish looking output you were probably seeing is the result of a luma/chroma swap not a Cb/Cr swap, I saw this a great deal when working with the YCC8 output mode of the VPBE, a Cb/Cr swap just messes up what colors are where but looks much closer to what the image should be than a luma/chroma swap.

  • Thanks Juan & Bernie for your valuable inputs.

    Got the VPort working with the desired results. [:D]

     

     

  • Hi

      I saw your queries regarding LCD interface with DM6446.

      I tried your test code but i am not getting.

     Can i have your sample test code so that i will check in my LCD.

     

    Regards

    Kirthika