Loading...
Searching...
No Matches
KmsOutputNode.hpp File Reference

Direct KMS scanout: the graph renders into the buffer the display engine reads, with nothing in between. More...

Detailed Description

Direct KMS scanout: the graph renders into the buffer the display engine reads, with nothing in between.

Every other output in this tree ends with a copy. ScreenNode renders the graph into an offscreen target and then blits it into the swapchain image (ScaledRenderer::finishFrame) – on GLES that pass does not even flip Y, so it is a literal full-frame copy, and at capture resolution it costs about as much as the rest of the passthrough put together. This has no swapchain, so that copy does not exist to be removed.

How: once N scanout buffers, each GBM bo -> dma-buf -> EGLImage -> GL texture -> QRhiTexture::createFrom -> QRhiTextureRenderTarget, and the same dma-buf -> drmModeAddFB2WithModifiers -> a KMS framebuffer id. frame pick a slot whose last flip has completed, hand its render target to the graph, render, then atomically flip to its framebuffer id.

The modifier is the part that decides whether this is actually zero-copy. KmsDevice reports what each plane advertises (PlaneInfo::formats[].modifiers); that list is intersected with what GBM will allocate. Allocate a modifier the plane does not advertise and either the kernel refuses the framebuffer, or – worse – something inserts a detiling copy where nobody is looking for it.

The objection recorded against doing this for the PipeWire output (PipewireOutputDevice.cpp: "would need a QRhiTextureRenderTarget rebuild per pipewire-buffer dequeue, which fights QRhi's render-target caching") does not apply here. That is a problem when the consumer hands you a different buffer every frame; we own a fixed set, so the N render targets are built once and rotated. All of them share one render-pass descriptor, so pipelines built against one are valid for the others.

Requires DRM master, which a running compositor holds. On an appliance that is fine. Taking one output while a desktop session keeps another needs a DRM lease, which KmsDevice does not implement yet.

Go to the source code of this file.

Classes

struct  score::gfx::KmsOutputSettings
 
class  score::gfx::KmsOutputNode
 OutputNode scanning out directly through DRM/KMS. More...
 

Namespaces

namespace  score
 Base toolkit upon which the software is built.
 
namespace  score::gfx
 Graphics rendering pipeline for ossia score.