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
vinnie
 
Posts: 5
Joined: 2017-10-26 06:12

Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable