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.

AM57x: How does the DSS write-back pipeline work in the Processor Linux SDK?

I used the Processor SDK examples to figure out how to use V4L2 to control the AM57XX VPE And VIP. Those devices correspond to /dev/video0 and /dev/video1 in Linux. There is a /dev/video10 that is the 'omapwb-m2m' device. When I run v4l2-ctl on it, I can see more information about it as shown below.

The TRM shows that I can choose the output of any DRM plane or DSS Compositor as an input to the WB pipeline. However, I cannot find any examples of how to use it in the Processor SDK. 

  1. How do I use it?
  2. I've noticed that the /dev/video10 device becomes busy as soon as I call drmModeSetPlane() in my code. Why is this?
  3. Where is the example in the Processor SDK? - Thank you.
root@am57xx-evm:~# v4l2-ctl -d /dev/video10 --all
Driver Info (not using libv4l2):
        Driver name   : omapwb-m2m
        Card type     : omapwb-m2m
        Bus info      : platform:omapwb-m2m
        Driver version: 4.1.18
        Capabilities  : 0x84204000
                Video Memory-to-Memory Multiplanar
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps   : 0x04204000
                Video Memory-to-Memory Multiplanar
                Streaming
                Extended Pix Format
Priority: 2
Format Video Capture Multiplanar:
        Width/Height      : 1920/1080
        Pixel Format      : 'YUYV'
        Field             : None
        Number of planes  : 1
        Flags             :
        Colorspace        : HDTV and modern devices (ITU709)
        Plane 0           :
           Bytes per Line : 3840
           Size Image     : 4147200
Format Video Output Multiplanar:
        Width/Height      : 1920/1080
        Pixel Format      : 'YUYV'
        Field             : None
        Number of planes  : 1
        Flags             :
        Colorspace        : HDTV and modern devices (ITU709)
        Plane 0           :
           Bytes per Line : 3840
           Size Image     : 4147200
Selection: compose, Left 0, Top 0, Width 1920, Height 1080
Selection: compose_default, Left 0, Top 0, Width 1920, Height 1080
Selection: compose_bounds, Left 0, Top 0, Width 1920, Height 1080
Selection: crop, Left 0, Top 0, Width 1920, Height 1080
Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080
Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080
...
root@am57xx-evm:~# v4l2-ctl -d /dev/video10 --all
Failed to open /dev/video10: Device or resource busy

  • I will ask the software team to look at this.
  • Hi Phillip,

    phillip class said:
    However, I cannot find any examples of how to use it in the Processor SDK.

    1. How do I use it?

    3. Where is the example in the Processor SDK?

    I am afraid there is no example on how to use v4l2. 

    phillip class said:
    I've noticed that the /dev/video10 device becomes busy as soon as I call drmModeSetPlane() in my code. Why is this?

    You CAN'T use omapdrm with v4l2 APIs, see answer from Manisha here: 
    https://e2e.ti.com/support/arm/sitara_arm/f/791/t/494329

    When creating your api, have in mind errata i829: http://www.ti.com/lit/er/sprz429h/sprz429h.pdf 

    The following information may be of use: http://elinux.org/images/8/83/Elc2011_semwal.pdf

    Best Regards, 
    Yordan

  • Hi Yordan,

    Thank you for the information.

    I am reviewing the slideshow you linked in your answer. On slide 20, it seems to show how to setup a 'link' between a DRM plane and the WB.

    struct media_link_desc link;
    
    /* Writeback path */
    link.source.entity = OMAP_DSS_ENTITY_MGR_LCD1; link.source.index = 5;
    link.sink.entity = OMAP_DSS_ENTITY_WRITEBACK; link.sink.index = 0;
    link.flags = MEDIA_LNK_FL_ENABLED;
    ioctl(fd, MEDIA_IOC_SETUP_LINK, &link);

    However, it does not show how to configure the pipeline for colorspace conversion or how to capture frames from the device. 

    If we cannot use V4L2 to configure or capture from /dev/video10, what method(s) does DRM give us to configure and capture from the WB device? Thank you.

    UPDATE: I found a commit log from back in 2011 referencing the DSS2 write back pipeline here: http://permalink.gmane.org/gmane.linux.ports.arm.omap/68993

    It references the need for a V4L2 driver but says the current implentation of the DSS2 WB pipeline is tested by configuring it with the sysfs entries. Is this the recommended way of using the WB? If so, where on the filesystem are these sysfs files? Thank you.


    In order to use writeback, we need a capture device driver of some sort, a v4l2 capture device is currently in the works. The patches are currently tested by extending writeback panel's sysfs attributes to allow us to configure the destination addresses and other parameters via sysfs.

  • phillip class said:
    How do I use it?

    You can find example here -

    https://github.com/tomba/kmsxx/blob/wb/tests/wbtest.cpp

     It is not cleaned up and not a release quality code but may suffice your purpose. Note that only single plane m2m WB mode is supported at this moment.

    phillip class said:
    I've noticed that the /dev/video10 device becomes busy as soon as I call drmModeSetPlane() in my code. Why is this?

    WB mem2mem mode requires one free plane available to operate. You may be consuming all the available planes ( 4 plane on Am57x device) in your application.

    phillip class said:
    Where is the example in the Processor SDK? - Thank you.

     

    There is no example in the proc SDK for same. We will plan for it in future release. For now, please refer to the link that I mentioned above.

  • The MC entity mentioned in the slide is no more applicable to existing DSS driver. The slide is old and shouldn't be refer for the current driver.