[MMAPI] libdrm Multi-threading Issues on 28.1

In the same process, called twice drmOpen(),the return fd is the same.
When A thread renders HDMI, the B thread renders DSI, same fd will cause conflict.

For example, HDMI output resolution changes, need to reset crtc width and height.
When I want the delete renderer, and then createDrmRenderer, and pass in the new width and height, an unknown error will occur, such as blocking in delete.

Could you give me an APP to know what issue you are facing?

Thank you waynezhu.
Ok, let me change the sample to show you the issue.

I simply changed samples/08_video_dec_drm.
It’s just called twice createDrmRenderer() with different parameters.

in the file NvDrmRenderer.cpp
Then I added the print after drmOpen().The file descriptor is the same.

./video_dec_drm …/…/data/Video/sample_outdoor_car_1080p_10fps.h264 H264 --disable-ui
Here is the print:

[conn=0,crtc=0] drmOpen fd = 14
[conn=1,crtc=1] drmOpen fd = 14

In my actual project code, I used two threads to call the NvDrmRenderer class function separately to send video buffer to my two display interfaces. Because I need my two display interfaces to output different video at the same time.
However, the two threads I create will cause conflicts because of the same file descriptors.

The areas of conflict include drmClose(drm_fd) or poll(&fds, 1, timeout), the arguments to these functions are only file descriptors.

drmMultiOpen.rar (13.8 KB)

Whether the new version SDK will improve ?

Sorry for miss your information.
We don’t have any improvement in rel28.2 about DRM.

BTW, I don’t think it is in the right way, why not use VIC to composite 2 videos into 1 video, then display?

Rel28.2 provide some new interface for composite video, you can check that.

Thank you for your reply.
We need HDMI and the DSi to display the video at the same time, because of this demand, video conferencing equipment generally support dual display.
Mosaic screen, we have used Vic to achieve a 9-way stitching, and design is a double display of different splicing screen.
I hope our future version can consider the double display of DRM, we are using the DRM module, think the direct configuration of CRTC is very good, and very save resources, because of the DRM module, we have abandoned the X11 solution

Good to share this info.

For display, I suggest to use gstreamer overlaysink, we can display two different video on hdmi and dsi separately.

Gstreamer and multimedia API can work together on rel28.2.