/** * \mainpage The Generic Buffer Manager * * This module provides an abstraction that the caller can use to request a * buffer from the underlying memory management system for the platform. * * This allows the creation of portable code whilst still allowing access to * the underlying memory manager.
*/
/** * Abstraction representing the handle to a buffer allocated by the * manager
*/ union gbm_bo_handle { void *ptr;
int32_t s32;
uint32_t u32;
int64_t s64;
uint64_t u64;
};
/** Format of the allocated buffer */ enum gbm_bo_format { /** RGB with 8 bits per channel in a 32 bit value */
GBM_BO_FORMAT_XRGB8888, /** ARGB with 8 bits per channel in a 32 bit value */
GBM_BO_FORMAT_ARGB8888
};
/** * The FourCC format codes are taken from the drm_fourcc.h definition, and * re-namespaced. New GBM formats must not be added, unless they are * identical ports from drm_fourcc.
*/ #define __gbm_fourcc_code(a,b,c,d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | \
((uint32_t)(c) << 16) | ((uint32_t)(d) << 24))
#define GBM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */
/* color index */ #define GBM_FORMAT_C8 __gbm_fourcc_code('C', '8', ' ', ' ') /* [7:0] C */
/* 8 bpp Red */ #define GBM_FORMAT_R8 __gbm_fourcc_code('R', '8', ' ', ' ') /* [7:0] R */
/* 16 bpp Red */ #define GBM_FORMAT_R16 __gbm_fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */
/** * Flags to indicate the intended use for the buffer - these are passed into * gbm_bo_create(). The caller must set the union of all the flags that are * appropriate * * \sa Use gbm_device_is_format_supported() to check if the combination of format * and use flags are supported
*/ enum gbm_bo_flags { /** * Buffer is going to be presented to the screen using an API such as KMS
*/
GBM_BO_USE_SCANOUT = (1 << 0), /** * Buffer is going to be used as cursor
*/
GBM_BO_USE_CURSOR = (1 << 1), /** * Deprecated
*/
GBM_BO_USE_CURSOR_64X64 = GBM_BO_USE_CURSOR, /** * Buffer is to be used for rendering - for example it is going to be used * as the storage for a color buffer
*/
GBM_BO_USE_RENDERING = (1 << 2), /** * Buffer can be used for gbm_bo_write. This is guaranteed to work * with GBM_BO_USE_CURSOR, but may not work for other combinations.
*/
GBM_BO_USE_WRITE = (1 << 3), /** * Buffer is linear, i.e. not tiled.
*/
GBM_BO_USE_LINEAR = (1 << 4), /** * Buffer is protected, i.e. encrypted and not readable by CPU or any * other non-secure / non-trusted components nor by non-trusted OpenGL, * OpenCL, and Vulkan applications.
*/
GBM_BO_USE_PROTECTED = (1 << 5),
/** * The buffer will be used for front buffer rendering. On some * platforms this may (for example) disable framebuffer compression * to avoid problems with compression flags data being out of sync * with pixel data.
*/
GBM_BO_USE_FRONT_RENDERING = (1 << 6),
/** * Allow the driver to select fixed-rate compression parameters.
*/
GBM_BO_FIXED_COMPRESSION_DEFAULT = (1 << 7),
/** * Fixed-rate compression: at least 1bpc, less than 2bpc
*/
GBM_BO_FIXED_COMPRESSION_1BPC = (2 << 7),
/** * Fixed-rate compression: at least 2bpc, less than 3bpc
*/
GBM_BO_FIXED_COMPRESSION_2BPC = (3 << 7),
/** * Fixed-rate compression: at least 3bpc, less than 4bpc
*/
GBM_BO_FIXED_COMPRESSION_3BPC = (4 << 7),
/** * Fixed-rate compression: at least 4bpc, less than 5bpc
*/
GBM_BO_FIXED_COMPRESSION_4BPC = (5 << 7),
/** * Fixed-rate compression: at least 5bpc, less than 6bpc
*/
GBM_BO_FIXED_COMPRESSION_5BPC = (6 << 7),
/** * Fixed-rate compression: at least 6bpc, less than 7bpc
*/
GBM_BO_FIXED_COMPRESSION_6BPC = (7 << 7),
/** * Fixed-rate compression: at least 7bpc, less than 8bpc
*/
GBM_BO_FIXED_COMPRESSION_7BPC = (8 << 7),
/** * Fixed-rate compression: at least 8bpc, less than 9bpc
*/
GBM_BO_FIXED_COMPRESSION_8BPC = (9 << 7),
/** * Fixed-rate compression: at least 9bpc, less than 10bpc
*/
GBM_BO_FIXED_COMPRESSION_9BPC = (10 << 7),
/** * Fixed-rate compression: at least 10bpc, less than 11bpc
*/
GBM_BO_FIXED_COMPRESSION_10BPC = (11 << 7),
/** * Fixed-rate compression: at least 11bpc, less than 12bpc
*/
GBM_BO_FIXED_COMPRESSION_11BPC = (12 << 7),
/** * Fixed-rate compression: at least 12bpc, no maximum rate
*/
GBM_BO_FIXED_COMPRESSION_12BPC = (13 << 7),
/** * Flags to indicate the type of mapping for the buffer - these are * passed into gbm_bo_map(). The caller must set the union of all the * flags that are appropriate. * * These flags are independent of the GBM_BO_USE_* creation flags. However, * mapping the buffer may require copying to/from a staging buffer. * * See also: pipe_map_flags
*/ enum gbm_bo_transfer_flags { /** * Buffer contents read back (or accessed directly) at transfer * create time.
*/
GBM_BO_TRANSFER_READ = (1 << 0), /** * Buffer contents will be written back at unmap time * (or modified as a result of being accessed directly).
*/
GBM_BO_TRANSFER_WRITE = (1 << 1), /** * Read/modify/write
*/
GBM_BO_TRANSFER_READ_WRITE = (GBM_BO_TRANSFER_READ | GBM_BO_TRANSFER_WRITE),
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.