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.

Linux/AM5728: How to display video on HDMI port

Part Number: AM5728


Tool/software: Linux

On the AM5728evm board, once the Wayland/weston is stopped, the second crtc and encoder is not initialized. And though we can not use HDMI connector any more.

Is there any example code to initialize them by calling drm APIs? Thanks.

root@am57xx-evm:/dev# /etc/init.d/weston stop
Stopping Weston
root@am57xx-evm:/dev# modetest
trying to open device 'i915'...failed
trying to open device 'amdgpu'...failed
trying to open device 'radeon'...failed
trying to open device 'nouveau'...failed
trying to open device 'vmwgfx'...failed
trying to open device 'omapdrm'...done
Encoders:
id      crtc    type    possible crtcs  possible clones
34      39      TMDS    0x00000001      0x00000000
40      0       TMDS    0x00000002      0x00000000

Connectors:
id      encoder status          name            size (mm)       modes   encoders
35      34      connected       DPI-1           0x0             1       34
  modes:
        name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  800x480 60 800 1010 1040 1056 480 502 515 525 33000 flags: nhsync, nvsync; type: preferred, driver
  props:
        1 EDID:
                flags: immutable blob
                blobs:

                value:
        2 DPMS:
                flags: enum
                enums: On=0 Standby=1 Suspend=2 Off=3
                value: 0
        5 link-status:
                flags: enum
                enums: Good=0 Bad=1
                value: 0
41      0       connected       HDMI-A-1        530x300         30      40
  modes:
        name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  1920x1080 60 1920 2008 2052 2200 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: preferred, driver
  1920x1080 60 1920 2008 2052 2200 1080 1084 1089 1125 148352 flags: phsync, pvsync; type: driver
  1920x1080 50 1920 2448 2492 2640 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: driver
  1680x1050 60 1680 1728 1760 1840 1050 1053 1059 1080 119000 flags: phsync, nvsync; type: driver
  1600x900 60 1600 1624 1704 1800 900 901 904 1000 108000 flags: phsync, pvsync; type: driver
  1280x1024 75 1280 1296 1440 1688 1024 1025 1028 1066 135000 flags: phsync, pvsync; type: driver
  1280x1024 60 1280 1328 1440 1688 1024 1025 1028 1066 108000 flags: phsync, pvsync; type: driver
  1440x900 60 1440 1488 1520 1600 900 903 909 926 88750 flags: phsync, nvsync; type: driver
  1280x800 60 1280 1328 1360 1440 800 803 809 823 71000 flags: phsync, nvsync; type: driver
  1152x864 75 1152 1216 1344 1600 864 865 868 900 108000 flags: phsync, pvsync; type: driver
  1280x720 60 1280 1390 1430 1650 720 725 730 750 74250 flags: phsync, pvsync; type: driver
  1280x720 60 1280 1390 1430 1650 720 725 730 750 74176 flags: phsync, pvsync; type: driver
  1280x720 50 1280 1720 1760 1980 720 725 730 750 74250 flags: phsync, pvsync; type: driver
  1024x768 75 1024 1040 1136 1312 768 769 772 800 78750 flags: phsync, pvsync; type: driver
  1024x768 70 1024 1048 1184 1328 768 771 777 806 75000 flags: nhsync, nvsync; type: driver
  1024x768 60 1024 1048 1184 1344 768 771 777 806 65000 flags: nhsync, nvsync; type: driver
  832x624 75 832 864 928 1152 624 625 628 667 57284 flags: nhsync, nvsync; type: driver
  800x600 75 800 816 896 1056 600 601 604 625 49500 flags: phsync, pvsync; type: driver
  800x600 72 800 856 976 1040 600 637 643 666 50000 flags: phsync, pvsync; type: driver
  800x600 60 800 840 968 1056 600 601 605 628 40000 flags: phsync, pvsync; type: driver
  800x600 56 800 824 896 1024 600 601 603 625 36000 flags: phsync, pvsync; type: driver
  720x576 50 720 732 796 864 576 581 586 625 27000 flags: nhsync, nvsync; type: driver
  720x480 60 720 736 798 858 480 489 495 525 27027 flags: nhsync, nvsync; type: driver
  720x480 60 720 736 798 858 480 489 495 525 27000 flags: nhsync, nvsync; type: driver
  640x480 75 640 656 720 840 480 481 484 500 31500 flags: nhsync, nvsync; type: driver
  640x480 73 640 664 704 832 480 489 492 520 31500 flags: nhsync, nvsync; type: driver
  640x480 67 640 704 768 864 480 483 486 525 30240 flags: nhsync, nvsync; type: driver
  640x480 60 640 656 752 800 480 490 492 525 25200 flags: nhsync, nvsync; type: driver
  640x480 60 640 656 752 800 480 490 492 525 25175 flags: nhsync, nvsync; type: driver
  720x400 70 720 738 846 900 400 412 414 449 28320 flags: nhsync, pvsync; type: driver
  props:
        1 EDID:
                flags: immutable blob
                blobs:

                value:
                        00ffffffffffff004c2d820c57485a5a
                        1e1b010380351e782a4ba1a359559b26
                        0e5054bfef80714f81c0810081809500
                        a9c0b3000101023a801871382d40582c
                        4500132b2100001e000000fd00384b1e
                        5111000a202020202020000000fc0053
                        3234453435300a2020202020000000ff
                        0048345a4a3730303736380a20200109
                        02010400023a80d072382d40102c4580
                        132b2100001e011d007251d01e206e28
                        5500132b2100001e011d00bc52d01e20
                        b8285540132b2100001e8c0ad0902040
                        31200c405500132b210000188c0ad08a
                        20e02d10103e9600132b210000180000
                        00000000000000000000000000000000
                        0000000000000000000000000000000e
        2 DPMS:
                flags: enum
                enums: On=0 Standby=1 Suspend=2 Off=3
                value: 3
        5 link-status:
                flags: enum
                enums: Good=0 Bad=1
                value: 0

CRTCs:
id      fb      pos     size
39      60      (0,0)   (800x480)
  800x480 60 800 1010 1040 1056 480 502 515 525 33000 flags: nhsync, nvsync; type: preferred, driver
  props:
        23 CTM:
                flags: blob
                blobs:

                value:
        24 GAMMA_LUT:
                flags: blob
                blobs:

                value:
        25 GAMMA_LUT_SIZE:
                flags: immutable range
                values: 0 4294967295
                value: 256
        30 background:
                flags: range
                values: 0 16777215
                value: 0
        31 trans-key-mode:
                flags: enum
                enums: disable=0 gfx-dst=1 vid-src=2
                value: 0
        32 trans-key:
                flags: range
                values: 0 16777215
                value: 0
        33 alpha_blender:
                flags: range
                values: 0 1
                value: 0
        37 rotation:
                flags: bitmask
                values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20
                value: 1
        27 zorder:
                flags: range
                values: 0 3
                value: 0
47      0       (0,0)   (0x0)
   0 0 0 0 0 0 0 0 0 0 flags: ; type: 
  props:
        23 CTM:
                flags: blob
                blobs:

                value:
        24 GAMMA_LUT:
                flags: blob
                blobs:

                value:
        25 GAMMA_LUT_SIZE:
                flags: immutable range
                values: 0 4294967295
                value: 256
        30 background:
                flags: range
                values: 0 16777215
                value: 0
        31 trans-key-mode:
                flags: enum
                enums: disable=0 gfx-dst=1 vid-src=2
                value: 0
        32 trans-key:
                flags: range
                values: 0 16777215
                value: 0
        33 alpha_blender:
                flags: range
                values: 0 1
                value: 0
        43 rotation:
                flags: bitmask
                values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20
                value: 1
        27 zorder:
                flags: range
                values: 0 3
                value: 0

Planes:
id      crtc    fb      CRTC x,y        x,y     gamma size      possible crtcs
36      39      60      0,0             0,0     0               0x00000003
  formats: RX12 AR12 RG16 XR24 RG24 AR24 RA24 RX24 AR15 XR12 RA12 XR15
  props:
        6 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 1
        37 rotation:
                flags: bitmask
                values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20
                value: 1
        27 zorder:
                flags: range
                values: 0 3
                value: 0
        38 zpos:
                flags: range
                values: 0 3
                value: 0
        28 global_alpha:
                flags: range
                values: 0 255
                value: 255
        29 pre_mult_alpha:
                flags: range
                values: 0 1
                value: 0
42      0       0       0,0             0,0     0               0x00000003
  formats: RG16 RX12 YUYV AR15 RA24 NV12 RA12 XR24 RG24 UYVY AR12 XR15 AR24 XR12 RX24
  props:
        6 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 1
        43 rotation:
                flags: bitmask
                values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20
                value: 1
        27 zorder:
                flags: range
                values: 0 3
                value: 0
        44 zpos:
                flags: range
                values: 0 3
                value: 0
        28 global_alpha:
                flags: range
                values: 0 255
                value: 255
        29 pre_mult_alpha:
                flags: range
                values: 0 1
                value: 0
48      0       0       0,0             0,0     0               0x00000003
  formats: RG16 RX12 YUYV AR15 RA24 NV12 RA12 XR24 RG24 UYVY AR12 XR15 AR24 XR12 RX24
  props:
        6 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 0
        49 rotation:
                flags: bitmask
                values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20
                value: 1
        27 zorder:
                flags: range
                values: 0 3
                value: 2
        50 zpos:
                flags: range
                values: 0 3
                value: 2
        28 global_alpha:
                flags: range
                values: 0 255
                value: 255
        29 pre_mult_alpha:
                flags: range
                values: 0 1
                value: 0
53      0       0       0,0             0,0     0               0x00000003
  formats: RG16 RX12 YUYV AR15 RA24 NV12 RA12 XR24 RG24 UYVY AR12 XR15 AR24 XR12 RX24
  props:
        6 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 0
        54 rotation:
                flags: bitmask
                values: rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20
                value: 1
        27 zorder:
                flags: range
                values: 0 3
                value: 3
        55 zpos:
                flags: range
                values: 0 3
                value: 3
        28 global_alpha:
                flags: range
                values: 0 255
                value: 255
        29 pre_mult_alpha:
                flags: range
                values: 0 1
                value: 0

Frame buffers:
id      size    pitch

root@am57xx-evm: