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.

[FAQ] AM62P: Display SubSystem (DSS): Basic Debugging and Forum Best Practices

Part Number: AM62P
Other Parts Discussed in Thread: AM62L

Tool/software:

This FAQ will talk about how one should perform basic debugging when facing Linux Display Related issues on AM62P / AM62x / AM62L / AM62A.
In case the debugging doesn't help resolve the issue, follow the Best Practices section to include necessary information while posting your queries on E2E forum.

The FAQ is regularly updated to provide the most current information. We recommend reviewing the FAQ periodically for the latest updates.

  • Please refer to Display Interfaces: A Comprehensive Guide to Sitara MPU Visualization Designs to know about which SoC supports which display interface(s).

    General Debugging

    If you are able to boot to linux, and your display application doesn't work:
    Go through following steps as first level debug:

    1. Expected output of the following command depends on the SoC and the DSS enabled.
      ls -l /dev/dri/card*

      If the SoC has a GPU, one card<x> device is registered for GPU.
      For every DSS enabled in dts, one card<x> per DSS should get enumerated.

    2. Stop any process using display before executing below commands:
      modetest -M tidss -D 302x0000.dss
      # The value of x in above is 0 for DSS0 and 2 for DSS1
      kmsprint
      kmstest

      By default, kmstest and kmsprint run from DSS0.
      If you also have enabled DSS1, you will need to specify through which device the kmsxx application needs to be run:
      modetest -M tidss
      kmsprint --device=/dev/dri/card<x>
      kmstest --device=/dev/dri/card<x>

      You will have try different values of <x> manually to find DSS1 enumerated card<x> since this is allocated on first-come-first-serve basis during boot.

    3. Notice what you see on panel after running kmstest.
      If kmstest works and your application doesn't, there most likely is an issue with the userspace application. 
      If kmstest doesn't work as expected, proceed with further debug.
    4. Note: If you are trying to enable simultaneous display interfaces, note down all connector IDs and CRTC IDs obtained from kmsprint per display.
      Then run:
      modetest -M tidss -s <hdmi connector id>@<hdmi crtc id>:resolution1 -s <oldi connector id>@<oldi crtc id>:resolution2

      For example:
      modetest -M tidss -s 50@48:1920x1080 -s 40@38:1920x1200

      and you should see some pattern generated on all the screen you configured in above command. If this doesn't work, proceed with further debug.


    Interface Specific Debugging:

    • OLDI / LVDS
      • When trying to configure Single-Link Display, it is often beneficial to take a look at DSS_VP1_DSS_OLDI_CFG register (3020 A160h) and verify the modes that you are setting.
        In case of AM62P, if driving from VP2, check DSS_VP2_DSS_OLDI_CFG and if using DSS1VP1, check this register too: 3022 A160h.
      • Cross-check the timing parameters for your panel from datasheet.
      • Verify output clock using probe is what you are trying to set in your panel timing parameters.


    • DPI / HDMI
      • Note that SoC only outputs DPI signals (not HDMI) and DPI needs to be converted to HDMI using external bridges. We use SiI9022ACNU bridge on our AM62x/P/A EVMs to convert DPI to HDMI.
      • Colorbar Test
        This test disconnects DSS from VP(Video Ports) and VPs start generating a test pattern.
        For DSS0VP2 DPI output checking, run the following commands:
        devmem2 0x30208000 w 0x2
        devmem2 0x3020B004 w 0x361 

        Register addresses will differ for different VP or DSS.
        Note: If you are not able to see colorbar test output, this may indicate issues with your timing parameters.
        If you are able to see colorbar output, but custom application doesn't work, most likely it is an issue with user-space application and/or your linux configuration of DSS.
      • Cross-check the timing parameters for your panel from datasheet.
      • Verify output clock using probe is what you are trying to set in your panel timing parameters.


    • DSI
      • If your display is not showing up anything, first try the TVG pattern test (This test will disconnect DSS from DSI controller and DSI controller itself will start generating test patterns). Use the below script (the script first gives a register dump, then runs TVG):
        #!/bin/bash
        #!/bin/bash
        
        # dump out existing settings
        echo "DSI_VID_VSIZE1"
        k3conf read 0x305000B4 | grep addr
        echo "DSI_VID_VSIZE2"
        k3conf read 0x305000B8 | grep addr
        echo "DSI_VID_HSIZE1"
        k3conf read 0x305000C0 | grep addr
        echo "DSI_VID_HSIZE2"
        k3conf read 0x305000C4 | grep addr
        echo "DSI_VID_BLKSIZE1"
        k3conf read 0x305000CC | grep addr
        echo "DSI_VID_BLKSIZE2"
        k3conf read 0x305000D0 | grep addr
        echo "DSI_VID_PCK_TIME"
        k3conf read 0x305000D8 | grep addr
        echo "DSI_VID_DPHY_TIME"
        k3conf read 0x305000DC | grep addr 
        echo "DSI_VID_MODE_STS"
        k3conf read 0x305000F0 | grep addr 
        echo "DSI_VID_VCA_SETTING1"
        k3conf read 0x305000F4 | grep addr 
        echo "DSI_VID_VCA_SETTING2"
        k3conf read 0x305000F8 | grep addr 
        echo "DSI_TVG_CTL"
        k3conf read 0x305000FC | grep addr 
        echo "DSI_TVG_IMG_SIZE"
        k3conf read 0x30500100 | grep addr 
        echo "DSI_TVG_COLOR1"
        k3conf read 0x30500104 | grep addr 
        echo "DSI_TVG_COLOR1_BIS"
        k3conf read 0x30500108 | grep addr 
        echo "DSI_TVG_COLOR2"
        k3conf read 0x3050010C | grep addr 
        echo "DSI_TVG_COLOR2_BIS"
        k3conf read 0x30500110 | grep addr 
        echo "DSI_TVG_STS"
        k3conf read 0x30500114 | grep addr
        echo "DSI_MAIN_DATA_CTL"
        k3conf read 0x30500004 | grep addr
        echo "DSI_MCTL_MAIN_EN"
        k3conf read 0x3050000C | grep addr
        
        echo "-------- Enabling test pattern"
        echo "DSI_TVG_CTL WRITE (disable TVG_RUN)"
        k3conf write 0x305000fc 0x000000B8 | grep addr
        sleep 1
        echo "DSI_MCTL_MAIN_EN WRITE (disable IF2_EN)"
        k3conf write 0x3050000C 0x000000F9 | grep addr 
        echo "DSI_MAIN_DATA_CTL WRITE (enable TVG, disable VID_EN)"
        k3conf write 0x30500004 0x00020047 | grep addr 
        sleep 1
        echo "DSI_MAIN_DATA_CTL WRITE (enable TVG, enable VID_EN)"
        k3conf write 0x30500004 0x00020067 | grep addr 
        echo "DSI_TVG_IMG_SIZE WRITE (setup lines / size 720x1280)"
        k3conf write 0x30500100 0x05000870 | grep addr 
        echo "TEST PATTERN COLOR 1"
        k3conf write 0x30500104 0x0FFF0000 | grep addr 
        k3conf write 0x30500108 0x00000000 | grep addr 
        echo "TEST PATTERN COLOR 2"
        k3conf write 0x3050010c 0x00000FFF | grep addr 
        k3conf write 0x30500110 0x00000000 | grep addr 
        echo "DSI_TVG_CTL WRITE (enable TVG_RUN)"
        k3conf write 0x305000fc 0x000000B9 | grep addr 
        
        echo "DSI_TVG_STS"
        k3conf read 0x30500114 | grep addr

        Note: the value you write to DSI_TVG_IMG_SIZE depends on you panel parameters. This is how to compute the value for this register:
        An example timing parameter:
        .clock = 74250 
        .hdisplay = 1280,
        .hsync_start = 1280 + 110,
        .hsync_end = 1280 + 110 + 40,
        .htotal = 1280 + 110 + 40 + 220,
        .vdisplay = 720,
        .vsync_start = 720 + 5,
        .vsync_end = 720 + 5 + 5,
        .vtotal = 720 + 5 + 5 + 20,

        Then, register value can be calculated as: DSI_TVG_IMG_SIZE Value: [vdisplay <<16 |  3*hdisplay]
        You should be able to see a test pattern on DSI display with this, else there may be an issue with your panel driver.
      • If TVG pattern generator works, but kmstest doesn't work, there are high possibilities that you may need to fine-tune your timing parameters around what is given in your panel datasheet. 
        .clock = 160000,  
        .hdisplay = 1200,                             -- HACT
        .hsync_start = 1200 + 80,                -- HFP
        .hsync_end = 1200 + 80 + 24,         -- HBP
        .htotal = 1200 + 80 + 24 + 60,          -- [HACT + HFP + HBP + HSYNC]
        .vdisplay = 1920,                              -- VACT
        .vsync_start = 1920 + 20,                 -- VFP
        .vsync_end = 1920 + 20 + 4,            -- VBP
        .vtotal = 1920 + 20 + 4 + 10,             -- [VACT + VFP + VBP + VSYNC]
        .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,

        When fine tuning, first suggestion would be to try to increase HFP and and hence increase clock accordingly. Only increasing HFP may not be sufficient, and may need to change other parameters too.

  • Forum Best Practices

    When the above debug steps do not help, please include the following information while creating new E2E queries:

    1. Describe your hardware setup: Which SoC, custom-board/TI EVM, which display interface(s) you are using?
    2. Describe your software setup: Which SDK version you are using, what are your patches on top of SDK. Please provide patches in git diff format.
    3. If using custom panels/drivers, please share if you have validated those against any other board/SoC. If feasible, share their datasheet as well.
    4. Share the output of following:    

    dmesg | grep -i dss
    lsmod
    k3conf dump clock | grep DSS
    # on AM62L k3conf is not yet enabled, hence use the following:
    # cat /sys/kernel/debug/clk/clk_summary | grep DSS

    5. Go through General Debugging and Interface Specific Debugging in above post and share all console outputs and observations w.r.t. what is seen on screen.


  • Commonly Asked Questions

    Q. How to disable splash in U-Boot?
    A. Check out this page in SDK: https://software-dl.ti.com/processor-sdk-linux/esd/AM62PX/latest/exports/docs/linux/Foundational_Components/U-Boot/UG-Splash-Screen.html#disabling-splash-screen 

    Q. How to enable multiple simultaneous displays?
    A. Please check out this Application Note: AM62P DSS Overview

    Q. How to enable BT656 mode in DPI?
    A. Please check out this FAQ: [FAQ] AM62P: Enabling BT.656 mode in DSS

    Q. How to change the clock polarity of the data output?
    A. You need to change bit 16 and 14 of VP1_FREQ register and Bit 9 and 8 of CFG0_CLK_CTRL register. For more details, take a look at: 
         TIDSS_How to change the clock polarity of the data output

    Q. How to set custom resolution mode in HDMI?
    A. Make sure that the resolution you are trying to set is supported by your display. Here are a few ways to do it:
             1. In U-Boot prompt, do the following:
                 => setenv optargs video=HDMI-A-1:1024x768
             2. For weston application, in /etc/xdg/weston/weston.ini, add the following:
                 [output]
                 name=HDMI-A-1
                 mode=1024x768
             3. Runtime change.
                 We do not support this, customer will have to change it dynamically using user-space level framework like Qt.

    Q. How to check if a panel resolution can be supported?
    A. Compute the required pixel clock for your panel using its timing parameters: pclk = h_total * v_total * fps.
         If this computed pclk is lower than the max. pixel clock mentioned for that specific interface for a SoC, the resolution can be supported.

    Q. DPI/HDMI support in U-Boot for splash.
    A. As of now, only Dual-Link OLDI drivers are supported in U-Boot. DPI/HDMI support is currently under development.

    Q. List of panels tested and supported by TI on AM62<x/A/P/L> EVMs.
    A. LVDS: SK-LCD1 Touch OLDI Display  [Use k3-am62p5-sk-microtips-mf101hie-panel.dtbo overlay provided in SDK]
         MIPI-DSI: RPi Touch DSI Display [Use k3-am62p5-sk-dsi-rpi-7inch-panel.dtbo overlay provided in SDK]