|
Ream v0.1.0-1
C++ graphics library for Linux
|
A DRM framebuffer usable for KMS scanout. More...
#include <RDRMFramebuffer.h>
Inheritance diagram for RDRMFramebuffer:Public Member Functions | |
| bool | hasModifier () const noexcept |
| Whether the framebuffer was created with an explicit format modifier. | |
| RModifier | modifier () const noexcept |
| Returns the DRM format modifier of the framebuffer. | |
| RFormat | format () const noexcept |
| Returns the DRM pixel format of the framebuffer. | |
| UInt32 | id () const noexcept |
| Returns the DRM framebuffer id, as used by KMS APIs. | |
| RDevice * | device () const noexcept |
| Returns the DRM device that owns this framebuffer. | |
| std::shared_ptr< RCore > | core () const noexcept |
| Returns the internal shared reference to the core instance. | |
| ~RDRMFramebuffer () noexcept | |
| Destroys the framebuffer and closes any owned GEM handles. | |
Public Member Functions inherited from RObject | |
| RObject ()=default | |
| Constructs a default RObject. | |
Static Public Member Functions | |
| static std::shared_ptr< RDRMFramebuffer > | MakeFromGBMBo (std::shared_ptr< RGBMBo > bo) noexcept |
| Creates a framebuffer from a GBM buffer object (bo). | |
| static std::shared_ptr< RDRMFramebuffer > | MakeFromDMA (const RDMABufferInfo &dmaInfo, RDevice *importer=nullptr) noexcept |
| Creates a framebuffer from DMA-BUF file descriptors. | |
| static std::shared_ptr< RDRMFramebuffer > | WrapHandle (SkISize size, UInt32 stride, RFormat format, RModifier modifier, UInt32 handle, CZOwn ownership, RDevice *device) noexcept |
| Creates a single-plane framebuffer from an existing GEM buffer handle. | |
A DRM framebuffer usable for KMS scanout.
Wraps a DRM framebuffer object created via drmModeAddFB2 (with a fallback to drmModeAddFB2WithModifiers or the legacy drmModeAddFB when necessary). A framebuffer binds one or more GEM buffer handles, together with their strides, offsets, format and modifier, into a single object that can be presented on a CRTC/plane.
Instances are created through the static factory methods from an existing GBM buffer object (MakeFromGBMBo()), imported DMA-BUF file descriptors (MakeFromDMA()), or a raw GEM handle (WrapHandle()). The framebuffer is always tied to the DRM device that created it.
On destruction the underlying framebuffer is removed (drmModeCloseFB, falling back to drmModeRmFB), and any GEM handles owned by this object (CZOwn::Own) are closed.
|
noexcept |
Destroys the framebuffer and closes any owned GEM handles.
|
staticnoexcept |
Creates a framebuffer from a GBM buffer object (bo).
This creates a framebuffer that can be used by the DRM device which allocated the provided GBM buffer object.
| bo | A shared pointer to the GBM buffer object. |
|
staticnoexcept |
Creates a framebuffer from DMA-BUF file descriptors.
Does not take ownership of the provided file descriptors.
| dmaInfo | Information describing the DMA-BUF to import. |
| importer | The DRM device that will import the DMA-BUF fds and use the framebuffer. If nullptr, RCore::mainDevice() is used instead. |
|
staticnoexcept |
Creates a single-plane framebuffer from an existing GEM buffer handle.
| size | The width and height of the framebuffer in pixels. |
| stride | The stride (bytes per row) of the buffer. |
| format | The DRM pixel format. |
| modifier | The DRM format modifier of the buffer. |
| handle | The GEM handle of the buffer, valid on device. |
| ownership | CZOwn::Own to take ownership of the handle (closed when this object is destroyed, including on failure), or CZOwn::Borrow to leave it untouched. |
| device | The DRM device that owns the handle and will use the framebuffer. If nullptr, RCore::mainDevice() is used instead. |
|
inlinenoexcept |
Whether the framebuffer was created with an explicit format modifier.
|
inlinenoexcept |
Returns the DRM format modifier of the framebuffer.
|
inlinenoexcept |
Returns the DRM pixel format of the framebuffer.
|
inlinenoexcept |
Returns the DRM framebuffer id, as used by KMS APIs.
|
inlinenoexcept |
Returns the DRM device that owns this framebuffer.