buffer
Header: kmsroots/buffer.h
Table of contents (click to go)
Macros
Enums
Unions
Structs
Functions
Function Pointers
API Documentation
kmr_buffer_type
-
enum kmr_buffer_type
-
KMR_BUFFER_DUMP_BUFFER
-
KMR_BUFFER_GBM_BUFFER
-
KMR_BUFFER_GBM_BUFFER_WITH_MODIFIERS
-
KMR_BUFFER_MAX_TYPE
Buffer allocation options used by
kmr_buffer_create()KMR_BUFFER_DUMP_BUFFER- Value set to
0 KMR_BUFFER_GBM_BUFFER- Value set to
1 KMR_BUFFER_GBM_BUFFER_WITH_MODIFIERS- Value set to
2 KMR_BUFFER_MAX_TYPE- Value set to
3
-
KMR_BUFFER_DUMP_BUFFER
kmr_buffer_object
-
struct kmr_buffer_object
-
struct gbm_bo *bo;
-
unsigned fbid;
-
unsigned format;
-
uint64_t modifier;
-
unsigned planeCount;
-
unsigned pitches[4];
-
unsigned offsets[4];
-
int dmaBufferFds[4];
-
int kmsfd;
More information can be found at DrmMode
bo- Handle to some GEM allocated buffer. Used to get GEM handles, DMA buffer fds(fd associate with GEM buffer), pitches, and offsets for the buffer used byDRI device (GPU)
fbid- Framebuffer ID
format- The format of an image details how each pixel color channels is laid out inmemory: (i.e. RAM, VRAM, etc…). So, basically the width in bits, type, andordering of each pixels color channels.
modifier- The modifier details information on how pixels should be within a buffer for different typesoperations such as scan out or rendering. (i.e linear, tiled, compressed, etc…)
planeCount- retrieved per plane. More information can be found : Planar Formats
pitches- width in bytes for each plane
offsets- offset of each plane
dmaBufferFds- (PRIME fd) Stores file descriptors to buffers that can be shared across hardware
kmsfd- File descriptor to open DRI device
-
struct gbm_bo *bo;
kmr_buffer
-
struct kmr_buffer
-
struct gbm_device *gbmDevice;
-
unsigned int bufferCount;
-
struct kmr_buffer_object *bufferObjects;
gbmDevice- A handle used to allocate gbm buffers & surfaces
bufferCount- Array size of
bufferObjects bufferObjects- Stores an array of
struct gbm_bo’s and corresponding information aboutthe individual buffer.
-
struct gbm_device *gbmDevice;
kmr_buffer_create_info
-
struct kmr_buffer_create_info
-
enum kmr_buffer_type bufferType;
-
unsigned int kmsfd;
-
unsigned int bufferCount;
-
unsigned int width;
-
unsigned int height;
-
unsigned int bitDepth;
-
unsigned int bitsPerPixel;
-
unsigned int gbmBoFlags;
-
unsigned int pixelFormat;
-
unsigned int modifierCount;
-
uint64_t *modifiers;
bufferType- Determines what type of buffer to allocate (i.e Dump Buffer, GBM buffer)
kmsfd- Used by
gbm_create_device(). Must be a valid file descriptorto a DRI device (GPU character device file) bufferCount- The amount of buffers to allocate.2 for double buffering3 for triple buffering
width- Amount of pixels going width wise on screen. Need to allocate buffer of similar size.
height- Amount of pixels going height wise on screen. Need to allocate buffer of similar size.
bitDepthbitsPerPixel- Pass the amount of bits per pixel
gbmBoFlags- Flags to indicate gbm_bo usage. More info here: gbm.h
pixelFormat- The format of an image details how each pixel color channels is laid out inmemory: (i.e. RAM, VRAM, etc…). So basically the width in bits, type, andordering of each pixels color channels.
modifierCount- Number of drm format modifiers passed
modifiers- List of drm format modifiers
-
enum kmr_buffer_type bufferType;
kmr_buffer_create
-
struct kmr_buffer *kmr_buffer_create(struct kmr_buffer_create_info *bufferInfo);
Function creates multiple GPU buffers
- Parameters:
- bufferInfoPointer to a
structkmr_buffer_create_info - Returns:
- on success: Pointer to a
structkmr_bufferon failure:NULL
kmr_buffer_destroy
-
void kmr_buffer_destroy(struct kmr_buffer *buffer);
Frees any allocated memory and closes FD’s (if open) created after
kmr_buffer_create()call.- Parameters:
- buffer:Must pass a valid pointer to a
structkmr_buffer/* Free'd and file descriptors closed members */ struct kmr_buffer { struct gbm_device *gbmDevice; struct kmr_buffer_object *bufferObjects { struct gbm_bo *bo; unsigned dmaBufferFds[4]; unsigned fbid; } }