Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

DRM / KMS Rendering architecture and thread safety.

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
vinnie
Posts: 5
Joined: 2017-10-26 06:12

DRM / KMS Rendering architecture and thread safety.

#1 Post by vinnie »

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

User avatar
dotlj
Posts: 646
Joined: 2009-12-25 17:21

Re: DRM / KMS Rendering architecture and thread safety.

#2 Post by dotlj »

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?

Post Reply