|
XenevaOS
|
#include <drm_fourcc.h>
Public Attributes | ||
| u32 | format | |
| u8 | depth | |
| u8 | num_planes | |
| union { | ||
| u8 cpp [DRM_FORMAT_MAX_PLANES] | ||
| u8 char_per_block [DRM_FORMAT_MAX_PLANES] | ||
| }; | ||
| u8 | block_w [DRM_FORMAT_MAX_PLANES] | |
| u8 | block_h [DRM_FORMAT_MAX_PLANES] | |
| u8 | hsub | |
| u8 | vsub | |
| bool | has_alpha | |
| bool | is_yuv | |
| bool | is_color_indexed | |
struct drm_format_info - information about a DRM format
| union { ... } drm_format_info |
| u8 drm_format_info::block_h[DRM_FORMAT_MAX_PLANES] |
@block_h:
Block height in pixels, this is intended to be accessed through drm_format_info_block_height()
| u8 drm_format_info::block_w[DRM_FORMAT_MAX_PLANES] |
@block_w:
Block width in pixels, this is intended to be accessed through drm_format_info_block_width()
| u8 drm_format_info::char_per_block[DRM_FORMAT_MAX_PLANES] |
@char_per_block:
Number of bytes per block (per plane), where blocks are defined as a rectangle of pixels which are stored next to each other in a byte aligned memory region. Together with @block_w and @block_h this is used to properly describe tiles in tiled formats or to describe groups of pixels in packed formats for which the memory needed for a single pixel is not byte aligned.
@cpp has been kept for historical reasons because there are a lot of places in drivers where it's used. In drm core for generic code paths the preferred way is to use @char_per_block, drm_format_info_block_width() and drm_format_info_block_height() which allows handling both block and non-block formats in the same way.
For formats that are intended to be used only with non-linear modifiers both @cpp and @char_per_block must be 0 in the generic format table. Drivers could supply accurate information from their drm_mode_config.get_format_info hook if they want the core to be validating the pitch.
| u8 drm_format_info::cpp[DRM_FORMAT_MAX_PLANES] |
@cpp:
Number of bytes per pixel (per plane), this is aliased with @char_per_block. It is deprecated in favour of using the triplet @char_per_block, @block_w, @block_h for better describing the pixel format.
| u8 drm_format_info::depth |
@depth:
Color depth (number of bits per pixel excluding padding bits), valid for a subset of RGB formats only. This is a legacy field, do not use in new code and set to 0 for new formats.
| u32 drm_format_info::format |
@format: 4CC format identifier (DRM_FORMAT_*)
| bool drm_format_info::has_alpha |
@has_alpha: Does the format embeds an alpha component?
| u8 drm_format_info::hsub |
@hsub: Horizontal chroma subsampling factor
| bool drm_format_info::is_color_indexed |
@is_color_indexed: Is it a color-indexed format?
| bool drm_format_info::is_yuv |
@is_yuv: Is it a YUV format?
| u8 drm_format_info::num_planes |
@num_planes: Number of color planes (1 to 3)
| u8 drm_format_info::vsub |
@vsub: Vertical chroma subsampling factor