|
|
| KmsDevice (const KmsDevice &)=delete |
| |
|
KmsDevice & | operator= (const KmsDevice &)=delete |
| |
| bool | open (const std::string &path) |
| |
|
void | close () |
| |
|
bool | isOpen () const noexcept |
| |
|
const DeviceInfo & | info () const noexcept |
| | Read-only; does not need DRM master.
|
| |
| bool | acquireMaster () |
| |
|
void | releaseMaster () |
| |
|
bool | createDumbBuffer (std::uint32_t width, std::uint32_t height, std::uint32_t bpp, DumbBuffer &out) |
| |
|
void | destroyDumbBuffer (DumbBuffer &b) |
| |
| std::uint32_t | addFramebuffer (const FramebufferDesc &desc) |
| |
|
void | removeFramebuffer (std::uint32_t fbId) |
| |
|
bool | setMode (std::uint32_t connectorId, const ModeInfo &mode, std::uint32_t fbId) |
| | Light up connectorId with one of its modes, scanning out fbId.
|
| |
| bool | pageFlip (std::uint32_t fbId, bool async=false) |
| |
| bool | atomicModeset (std::uint32_t connectorId, const ModeInfo &mode, std::uint32_t fbId) |
| |
| bool | atomicFlip (std::uint32_t fbId, bool async=false) |
| |
| bool | setOverlay (std::uint32_t planeId, std::uint32_t fbId, int x, int y, std::uint32_t width, std::uint32_t height) |
| |
| bool | writebackCapture (std::uint32_t writebackConnectorId, std::uint32_t fbId, bool includeCrtcState=true, bool allowModeset=true, bool testOnly=false) |
| |
| bool | atomicReady () const noexcept |
| |
| FlipEvent | waitFlip (int timeoutMs) |
| |
|
const std::string & | lastError () const noexcept |
| |
|
|
static std::vector< DeviceInfo > | enumerateDevices () |
| | Every card node on this system, enumerated read-only.
|
| |
◆ acquireMaster()
| bool score::gfx::drm::KmsDevice::acquireMaster |
( |
| ) |
|
Take DRM master. Fails while a compositor owns the node; that is the expected outcome on a desktop session and must degrade, not abort.
◆ addFramebuffer()
| std::uint32_t score::gfx::drm::KmsDevice::addFramebuffer |
( |
const FramebufferDesc & |
desc | ) |
|
Import a DMA-BUF as a scanout framebuffer. Returns 0 on failure. The modifier must be one the target plane advertises for that fourcc, or the kernel rejects it — which is the check we want, because the alternative is a silent detiling copy somewhere else.
◆ atomicFlip()
| bool score::gfx::drm::KmsDevice::atomicFlip |
( |
std::uint32_t |
fbId, |
|
|
bool |
async = false |
|
) |
| |
Atomic flip of the primary plane. async requests an immediate (tearing) flip where the driver supports it.
◆ atomicModeset()
| bool score::gfx::drm::KmsDevice::atomicModeset |
( |
std::uint32_t |
connectorId, |
|
|
const ModeInfo & |
mode, |
|
|
std::uint32_t |
fbId |
|
) |
| |
Atomic modeset. Unlike the legacy path this changes CRTC, connector and plane state in one commit, so the display never shows an intermediate configuration. Required before any writeback capture.
◆ atomicReady()
| bool score::gfx::drm::KmsDevice::atomicReady |
( |
| ) |
const |
|
noexcept |
True when the driver accepted atomic and the required properties were all resolved.
◆ open()
| bool score::gfx::drm::KmsDevice::open |
( |
const std::string & |
path | ) |
|
Opens a card node. Requests atomic + universal planes; both are recorded in DeviceInfo rather than being required, since the legacy path still works for plain flips.
◆ pageFlip()
| bool score::gfx::drm::KmsDevice::pageFlip |
( |
std::uint32_t |
fbId, |
|
|
bool |
async = false |
|
) |
| |
Queue a flip. With async, the kernel flips at the next scanline rather than the next vblank: lowest latency, at the cost of tearing.
◆ setOverlay()
| bool score::gfx::drm::KmsDevice::setOverlay |
( |
std::uint32_t |
planeId, |
|
|
std::uint32_t |
fbId, |
|
|
int |
x, |
|
|
int |
y, |
|
|
std::uint32_t |
width, |
|
|
std::uint32_t |
height |
|
) |
| |
Attach fbId to an overlay plane, positioned at (x,y) with the given size. This is composition done by the display engine rather than a shader pass – a static backdrop or a second source costs nothing on the GPU. Pass fbId == 0 to detach the plane.
◆ waitFlip()
| FlipEvent score::gfx::drm::KmsDevice::waitFlip |
( |
int |
timeoutMs | ) |
|
Block until the queued flip completes, returning the kernel's timestamp. timeoutMs < 0 waits indefinitely.
◆ writebackCapture()
| bool score::gfx::drm::KmsDevice::writebackCapture |
( |
std::uint32_t |
writebackConnectorId, |
|
|
std::uint32_t |
fbId, |
|
|
bool |
includeCrtcState = true, |
|
|
bool |
allowModeset = true, |
|
|
bool |
testOnly = false |
|
) |
| |
Capture what the display engine actually composited, through a writeback connector. This is the only way to verify scanout without pointing a camera at a screen: the kernel composites the current plane state into fbId exactly as it would scan it out. Only virtual and a few real drivers expose a writeback connector. includeCrtcState also puts the CRTC's ACTIVE/MODE_ID in the request; allowModeset permits the commit to modeset; testOnly validates without applying. The variants exist because a writeback commit that fails returns a bare EINVAL for several distinct reasons, and trying them is cheaper than a kernel debug build.
The documentation for this class was generated from the following file: