DRM / KMS Rendering architecture and thread safety.

Need help with C, C++, perl, python, etc?

DRM / KMS Rendering architecture and thread safety.

Postby vinnie » 2017-11-05 11:23

Hi Guys, Long term deb user, first time poster, so .. Hello :)

I've played around a bit with UDEV, DRM, KMS etc the last couple of weeks and wrote a little test application. I got a setup with Triple Buffering and VSync and it works well for a single display. With multiple displays, it still renders (only color filling the screen at the moment, so perhaps a false positive) but has tearing as if vsync is not working. I ended up using threads to make the initial prototyping a bit easier and though it appears to be rendering like it should, my gut is telling me that libdrm is not thread safe. For example, in the current design I create a Display object for each attached display, that has it's own render thread that interacts with the shared file descriptor (between all displays attached to the same Video Card).

Before I change the design, does anyone have more insights on DRM (libdrm) and KMS regarding thread safety?

The code seemed a bit too long to post here, but it lives on github, the particular file of interest that shows the rendering thread (function called render() at line 391) lives here: https://github.com/wmarais/Luna/blob/ma ... isplay.cpp
Posts: 5
Joined: 2017-10-26 06:12

Re: DRM / KMS Rendering architecture and thread safety.

Postby dotlj » 2018-01-21 02:08

I wonder how much this is hardware dependent. Would you mind providing some details such as CPU, GPU and memory.
I also wonder why triple buffer? How big is each buffer? Wouldn't that slow the whole rendering process?
User avatar
Posts: 646
Joined: 2009-12-25 17:21

Return to Programming

Who is online

Users browsing this forum: No registered users and 5 guests