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.

Changing VPSS display timings causes mode change error

Using the DM8148 EVM.

I'm trying to change the timings for display0 front porch and back porch. When I try to do this the mode is automatically changed to an erroneous value and I cant re-enable the display. If I manually change the mode back to a valid setting then the timings are automatically changed back to the default!

For example:

I stop the display first: echo 0 > enabled

I change the front porch/back porch settings (in this example im actually keeping them the same): echo 74250,1920/88/148/44,1080/4/36/5,1 > timings

If i now check the mode it is set to 1920x1080@30, which is an invalid value. It should be 1080p-30.

If i try to enable the display it reports an invalid value and wont enable. If i change the mode to 1080p-30 it changes the timings back to the default!

How do I change these settings?

  • Margarita,

    I had a feeling you would reply with a link to that document. I have read it many times! Please re-read my original post.

    Try it for yourself. I think this is a bug.

    Please provide an answer soon since we have a deadline to meet that requires this to be fixed.

  • Hi Steven,

     

    Do you use HDMI for the display? If yes, why do you want to change the timings since timings are as per the standard for the HDMI output.

    If not, can remove hdmi module and try it out?

     

    Rgds,

    Brijesh

  • Hi Brijesh,

    Actually I meant display1 rather than display0.

    We have a custom board we are testing this on where display1 is connected to an FPGA. I am trying to write a script that will allow our FPGA developer to easily and quickly change the front porch and back porch settings but I ran into this problem. I tested it on the EVM and I see the same problem.

    The script is below. It fails when re-enabling the display because changing the timings automatically sets the mode to 1920x1080@30, which is invalid. It should be setting the mode to 1080p-60:

    #!/bin/bash

    #usage: ./set_porch.sh H_FRONT_PORCH H_BACK_PORCH V_FRONT_PORCH V_BACK_PORCH H_SYNC_WIDTH V_SYNC_WIDTH
    #e.g. ./set_porch.sh 88 148 4 36 44 5

    # Default settings.
    H_FRONT_PORCH=88
    H_BACK_PORCH=148
    V_FRONT_PORCH=4
    V_BACK_PORCH=36
    H_SYNC_WIDTH=44
    V_SYNC_WIDTH=5
    PIXEL_CLOCK=74250
    WIDTH=1920
    HEIGHT=1080
    PROGRESSIVE=1

    if [ "$1" != "" ]
    then
    H_FRONT_PORCH=$1
    fi

    if [ "$2" != "" ]
    then
    H_BACK_PORCH=$2
    fi

    if [ "$3" != "" ]
    then
    V_FRONT_PORCH=$3
    fi

    if [ "$4" != "" ]
    then
    V_BACK_PORCH=$4
    fi

    if [ "$5" != "" ]
    then
    H_SYNC_WIDTH=$5
    fi

    if [ "$6" != "" ]
    then
    V_SYNC_WIDTH=$6
    fi

    echo Horizontal Front Porch: $H_FRONT_PORCH
    echo Horizontal Back Porch: $H_BACK_PORCH
    echo Vertical Front Porch: $V_FRONT_PORCH
    echo Vertical Back Porch: $V_BACK_PORCH
    echo Horizontal Sync Width: $H_SYNC_WIDTH
    echo Vertical Sync Width: $V_SYNC_WIDTH


    pushd .
    cd /sys/devices/platform/vpss/display1
    echo 0 > enabled
    echo $PIXEL_CLOCK,$WIDTH/$H_FRONT_PORCH/$H_BACK_PORCH/$H_SYNC_WIDTH,$HEIGHT/$V_FRONT_PORCH/$V_BACK_PORCH/$V_SYNC_WIDTH,$PROGRESSIVE > timings
    echo 1 > enabled #FAILS HERE!!!!!!!!!!!!!!
    popd

  • Hello,

    Here is the difference:

    static const struct dc_vencmode_info vmode_info[]

    ....

        {"1080p-30", FVID2_STD_1080P_30,
            {FVID2_STD_1080P_30, 1920, 1080, FVID2_SF_PROGRESSIVE,
            74250, 30, 88, 148, 44, 4, 36, 5},
            TI81xx_MODE_HDMI
        },

        {"1920x1080@30", FVID2_STD_1080P_30,
            {FVID2_STD_CUSTOM, 1920, 1080, FVID2_SF_PROGRESSIVE,
            74250, 30, 88, 148, 44, 4, 36, 5},
            TI81xx_MODE_HDMI
        },

    Check in the linux-2.6.37-psp04.04.00.01 folder.

    BR

    Margarita

  • Hi Margarita,

    Which file is that from?

    So how do I change the timings settings using the sysfs entries without it setting the mode to 1920x1080@30?

    Steven

  • Hello,

    Steven Harris said:
    Which file is that from?

    /ti-ezsdk_dm814x-evm_5_05_02_00/board-support/linux-2.6.37-psp04.04.00.01/drivers/video/ti81xx/vpss

    sysfs.h

    Regarding this file you also could find information in the document which I posted you and the path to it.

    BR

    Margarita

  • Hi,

    Ok. I see that entry in the file sysfs.h. If there is an entry for it then why is re-enabling the display failing?

    Is there a patch that fixes this?

    I want to be able to change the timings in userspace without having to change the code and rebuild the kernel every time.

    Steven

  • Any further support from TI?

  • Still waiting on a response from TI!

  • Can someone at TI please respond to this or at least let me know if its in the support queue!

  • This is clearly a bug in the VPSS! When do TI intend to fix this?

  • Hi Steven,

    I do not have access to an EVM at present to reproduce however can you confirm whether a mode change is possible at all for example switching between named modes:

     :
     :
    pushd .
    cd /sys/devices/platform/vpss/display1
    echo 0 > enabled
    echo 1920x1080@30 > mode
    echo 1 > enabled
    popd


    Garry

  • Hi,

    Setting the mode to 1920x1080@30 works because it is translated into 1080p-30, which I can check by reading back the setting for the mode.

    Ordinarily that would be ok but if I want to change the display timings it then automatically changes the mode to one that wont be accepted so this becomes an issue that we need fixed.

    Steven

  • Hi,

    Why do you need to change the timings? Drivers follows CEA861 defined timings for 1080p30 for HDMI output, If you use different timing, it may not be detected by HDMI display device..

    Rgds,

    brijesh

  • Brijesh,

    You have already asked this further up. It is not for the HDMI output. It is for display1, which we have connected to an FPGA.

    We need control of the timings because we are trying to figure out how to add in additional metadata. TI are not being very helpful with this and it is costing us a lot of time and money.

    Steven

  • Hi Steven,

    Can you try not inserting HDMI module? This is because, if i remember correctly, if hdmi module is inserted, it will try to output CEA timings. I guess this is what you are getting.

    Btw, i am assuming you have taken care of programming pinmux correctly for the display1 output..

    Rgds,

    Brijesh Jadav

  • Brijesh,

    Do you mean DO NOT load the HDMI module? I can try that but on our board HDMI is on display0 and we are using display1 so I dont think it will make any difference.

    The pin mux is correct. We are able to get video data across to our FPGA but we need to change the timing information to allow us to add metadata into the frame. Unless you know of a better way to do that?

    Steven

  • Hi Steven,

    I thought you are trying it out on display0 (I'm trying to change the timings for display0 front porch and back porch).

    There is a name sysfs entry under each display, could you please print it and share it?

    Regards,

    Brijesh Jadav

  • Hi,

    # cat display0/name
    hdmi
    # cat display1/name
    dvo2
    # cat display2/name
    sd

    Steven

  • Hello Steven

    You should be able to change the timings on Display1/DVO2, timings are directly set in the DVO2 register, as far as i know, there is no middle layer. Can you dump 25 words of memory from 0x4810A000 before and after changing the timings?

    Rgds,

    brijesh

  • Hi,

    Here is the output with a dump of the memory at 0x4810A000.

    # ./memdump 0x4810A000 25
    Target = 0x4810a000
    Count = 25
    /dev/mem opened.
    Memory mapped at address 0x4029d000.
    0x4810a000 == 0x53
    0x4810a004 == 0x75
    0x4810a008 == 0xbb
    0x4810a00c == 0xc2
    0x4810a010 == 0x67
    0x4810a014 == 0xc2
    0x4810a018 == 0x0
    0x4810a01c == 0x77
    0x4810a020 == 0x30
    0x4810a024 == 0x30
    0x4810a028 == 0x98
    0x4810a02c == 0x2b
    0x4810a030 == 0xbd
    0x4810a034 == 0x64
    0x4810a038 == 0x38
    0x4810a03c == 0x18
    0x4810a040 == 0x0
    0x4810a044 == 0x0
    0x4810a048 == 0x0
    0x4810a04c == 0x1
    0x4810a050 == 0x4d
    0x4810a054 == 0x10
    0x4810a058 == 0x1
    0x4810a05c == 0x76
    0x4810a060 == 0x0
    #
    #
    #
    #
    #
    #
    # echo 0 > /sys/devices/platform/vpss/display1/enabled
    # echo 74250,1920/88/148/44,1080/4/36/5,1 > /sys/devices/platform/vpss/display1/timings
    # cat /sys/devices/platform/vpss/display1/mode
    1920x1080@30
    # echo 1 > /sys/devices/platform/vpss/display1/enabled
    VPSS_DCTRL: failed to set venc mdoe.
    VPSS_DCTRL: failed to enable venc dvo2
    -bash: echo: write error: Invalid argument
    #
    #
    #
    #
    # ./memdump 0x4810A000 25
    Target = 0x4810a000
    Count = 25
    /dev/mem opened.
    Memory mapped at address 0x400ca000.
    0x4810a000 == 0x53
    0x4810a004 == 0x75
    0x4810a008 == 0xbb
    0x4810a00c == 0xc2
    0x4810a010 == 0x67
    0x4810a014 == 0xc2
    0x4810a018 == 0x0
    0x4810a01c == 0x77
    0x4810a020 == 0x30
    0x4810a024 == 0x30
    0x4810a028 == 0x98
    0x4810a02c == 0x2b
    0x4810a030 == 0xbd
    0x4810a034 == 0x64
    0x4810a038 == 0x38
    0x4810a03c == 0x18
    0x4810a040 == 0x0
    0x4810a044 == 0x0
    0x4810a048 == 0x0
    0x4810a04c == 0x1
    0x4810a050 == 0x4d
    0x4810a054 == 0x10
    0x4810a058 == 0x1
    0x4810a05c == 0x76
    0x4810a060 == 0x0
    #
    #
    #
    # echo 1920x1080@30 > /sys/devices/platform/vpss/display1/mode
    # cat /sys/devices/platform/vpss/display1/mode
    1080p-30
    # echo 1 > /sys/devices/platform/vpss/display1/enabled
    # ./memdump 0x4810A000 25
    Target = 0x4810a000
    Count = 25
    /dev/mem opened.
    Memory mapped at address 0x40320000.
    0x4810a000 == 0x53
    0x4810a004 == 0x75
    0x4810a008 == 0xbb
    0x4810a00c == 0xc2
    0x4810a010 == 0x67
    0x4810a014 == 0xc2
    0x4810a018 == 0x0
    0x4810a01c == 0x77
    0x4810a020 == 0x30
    0x4810a024 == 0x30
    0x4810a028 == 0x98
    0x4810a02c == 0x2b
    0x4810a030 == 0xbd
    0x4810a034 == 0x64
    0x4810a038 == 0x38
    0x4810a03c == 0x18
    0x4810a040 == 0x0
    0x4810a044 == 0x0
    0x4810a048 == 0x0
    0x4810a04c == 0x1
    0x4810a050 == 0x4d
    0x4810a054 == 0x10
    0x4810a058 == 0x1
    0x4810a05c == 0x76
    0x4810a060 == 0x0

    Steven

  • Steven,

    Have you solved this problem. I have faced exact same issue some time back. Finally I ended up modifying the default values given in the kernel driver. You can try search for the timings in an array inside the file dctrl.c (If I remember correctly). The path is drivers/video/ti81xx

  • Hi Renjith,

    No I didnt solve it. We had to work around it. This took a long time.

    Steven