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/TMDSEVM437X: How to use DRM for normal display and overlay display

Part Number: TMDSEVM437X


Tool/software: Linux

Hi,

I am able to get and access omapdrm using /dev/dri/card0 interface in AM437x EVM.

In normal mode below layer is graphics layer (AM437x TRM - Figure 13-44. Overlay Manager in Normal Mode ) and above that video layer comes as overlay. I am able to display image using attached DRM code. My question is how to display image on normal layer and overlay layer using DRM? If attached 2311.drm_sample_app.ccode can be used in normal layer display then how can I use DRM for overlay display?

Regards,

Nilesh Kadivar

  • Hi Nilesh,

    I've notified the video experts. Feedback will be posted directly here.

    Best Regards,
    Yordan
  • Please refer to loopback.c file of dual-camera-demo application to understand how to reserve a plane and allocate zorder to it. zorder property decides the order of various planes when overlayed. The application source code is part of PSDK, it can as well be found in below git repository.

    git.ti.com/.../loopback.c
  • nilesh kadivar said:
    My question is how to display image on normal layer and overlay layer using DRM?

    Can you clarify here what's meant by normal layer and overlay layer? Are you having two separate display or are you referring to background plane as normal layer and more video/graphics planes to be overlayed as overlay layer?

  • I have a single display. And as you guess I am referring background as normal layer and video/graphics planes to be overlayed as overlay. So basically I want one image on background and above that some text as overlayed so that I can see overlayed text as well as background image.
    Thanks for your support and hope I will get some more steps in this direction.
  • drm-tests examples may help you
    git://git.ti.com/glsdk/example-applications.git

    The targetfs should have prebuilt binaries for drmclone, drmextended and drm-z-order applications.
  • Hi,

    My modetest output is as below.

    root@am437x-evm:/home# modetest
    trying to open device 'i915'...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
    25 28 TMDS 0x00000001 0x00000000

    Connectors:
    id encoder status name size (mm) modes encoders
    26 25 connected unknown-1 0x0 1 25
    modes:
    name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
    800x480 60 800 1010 1040 1056 480 502 515 525 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

    CRTCs:
    id fb pos size
    28 36 (0,0) (800x480)
    800x480 60 800 1010 1040 1056 480 502 515 525 flags: nhsync, nvsync; type: preferred, driver
    props:
    21 trans-key-mode:
    flags: enum
    enums: disable=0 gfx-dst=1 vid-src=2
    value: 0
    22 trans-key:
    flags: range
    values: 0 16777215
    value: 0
    23 background:
    flags: range
    values: 0 16777215
    value: 0
    24 alpha_blender:
    flags: range
    values: 0 1
    value: 0
    18 zorder:
    flags: range
    values: 0 3
    value: 0

    Planes:
    id crtc fb CRTC x,y x,y gamma size possible crtcs
    27 28 36 0,0 0,0 0 0x00000001
    formats: RG16 RX12 AR12 RG24 RX24 XR24 RA24 AR24
    props:
    5 type:
    flags: immutable enum
    enums: Overlay=0 Primary=1 Cursor=2
    value: 1
    18 zorder:
    flags: range
    values: 0 3
    value: 0
    19 global_alpha:
    flags: range
    values: 0 255
    value: 255
    20 pre_mult_alpha:
    flags: range
    values: 0 1
    value: 0
    29 0 0 0,0 0,0 0 0x00000001
    formats: RG16 RX12 RG24 XR24 YUYV UYVY
    props:
    5 type:
    flags: immutable enum
    enums: Overlay=0 Primary=1 Cursor=2
    value: 0
    18 zorder:
    flags: range
    values: 0 3
    value: 1
    19 global_alpha:
    flags: range
    values: 0 255
    value: 255
    20 pre_mult_alpha:
    flags: range
    values: 0 1
    value: 0
    30 0 0 0,0 0,0 0 0x00000001
    formats: RG16 RX12 AR12 RG24 RX24 XR24 RA24 AR24 YUYV UYVY
    props:
    5 type:
    flags: immutable enum
    enums: Overlay=0 Primary=1 Cursor=2
    value: 0
    18 zorder:
    flags: range
    values: 0 3
    value: 2
    19 global_alpha:
    flags: range
    values: 0 255
    value: 255
    20 pre_mult_alpha:
    flags: range
    values: 0 1
    value: 0

    Frame buffers:
    id size pitch

    root@am437x-evm:/home#


    When I runs drm_z_alpha application it shows below error.
    root@am437x-evm:/home# ./drm_z_alpha -s 800x480 -w 27:1:255:1 -w 27:1:255:1
    /dev/dri/card0 open success!
    error:omapdrm:dss: failed to enable plane1
    root@am437x-evm:/home#

    How to solve this error.

    Thanks,
    Nilesh Kadivar
  • I am able to ran drm_z_alpha application. I have attached a output of this. Please find it.

  • Does this meet your requirement?

  • The example application available on git://git.ti.com/glsdk/example-applications.git is designed for AM57x. AM437x DSS IP is slightly different then AM57x. If you do not see the results as expected following the out of box drm_z_alpha example, run modetest application on your board, see the supported properties and it's values, and use them to configure the DRM properties in your application.

    Follow below links too -
    processors.wiki.ti.com/.../Linux_Core_DSS_User's_Guide
    processors.wiki.ti.com/.../Linux_Core_DSS_User's_Guide

    Regards,
    Manisha
  • Hi,


    My modetest output is as 6036.modetest.txt

    . Now when I run application with ./drm_app 800 480 27 1 255 0 30 2 255 0 it gives output


    and same application with  ./drm_app 800 480 30 1 255 0 27 2 255 0 gives different output as

    . What can be the reason for this? Also my transparency level not gets changed.


    Application usage is as ./drm_z_alpha <crtc_w> <crtc_h> <plane1_id> <z_val> <glo_alpha> <pre_mul_alpha> <plane2_id> <z_val> <glo_alpha> <pre_mul_alpha>

    Please do needful in this.

    Regards,

    Nilesh Kadivar

  • Hi Nilesh,

    I tried modifying the dual camera example application in PLSDK for alpha blending and it works. All you need to do for alpha blending is to set the global alpha value of the planes that you would like to blend. In addition, also need to know that global alpha blending works in alpha mode only and not in normal mode. One need to set trans-key-mode to 1 for alpha mode setting on AM437x device. This is different then AM57x. Planes can be both in RGB or YUYV format when doing global alpha blending.

    Attached patch that was tested to verify alpha blending on dual-camera-demo of AM437x PLSDK.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/354/5280.alpha_5F00_blending.patch

  • Just to clarify, the patch was generated using diff. It has to be applied on loopback.c file of dual-camera-demo.

  • Thanks Manisha for your update.

  • Nilesh,

    In summary, for global alpha blending to work on AM437x device, two things need to be taken care -

    1. trans-key-mode should be set to 1
    2. global_alpha value of each planes (primary and overlay both) need to be set to value between 0 to 255.