include/drm/drm_fourcc.h
Source file repositories/reference/linux-study-clean/include/drm/drm_fourcc.h
File Facts
- System
- Linux kernel
- Corpus path
include/drm/drm_fourcc.h- Extension
.h- Size
- 10200 bytes
- Lines
- 325
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/math.hlinux/types.huapi/drm/drm_fourcc.h
Detected Declarations
struct drm_devicestruct drm_format_infofunction drm_format_info_is_yuv_packedfunction planesfunction planesfunction drm_format_info_is_yuv_sampling_410function drm_format_info_is_yuv_sampling_411function drm_format_info_is_yuv_sampling_420function drm_format_info_is_yuv_sampling_422function drm_format_info_is_yuv_sampling_444function drm_format_info_plane_widthfunction drm_format_info_plane_height
Annotated Snippet
struct drm_format_info {
/** @format: 4CC format identifier (DRM_FORMAT_*) */
u32 format;
/**
* @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.
*/
u8 depth;
/** @num_planes: Number of color planes (1 to 3) */
u8 num_planes;
union {
/**
* @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 cpp[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 char_per_block[DRM_FORMAT_MAX_PLANES];
};
/**
* @block_w:
*
* Block width in pixels, this is intended to be accessed through
* drm_format_info_block_width()
*/
u8 block_w[DRM_FORMAT_MAX_PLANES];
/**
* @block_h:
*
* Block height in pixels, this is intended to be accessed through
* drm_format_info_block_height()
*/
u8 block_h[DRM_FORMAT_MAX_PLANES];
/** @hsub: Horizontal chroma subsampling factor */
u8 hsub;
/** @vsub: Vertical chroma subsampling factor */
u8 vsub;
/** @has_alpha: Does the format embeds an alpha component? */
bool has_alpha;
/** @is_yuv: Is it a YUV format? */
bool is_yuv;
/** @is_color_indexed: Is it a color-indexed format? */
bool is_color_indexed;
};
/**
* drm_format_info_is_yuv_packed - check that the format info matches a YUV
* format with data laid in a single plane
* @info: format info
*
Annotation
- Immediate include surface: `linux/math.h`, `linux/types.h`, `uapi/drm/drm_fourcc.h`.
- Detected declarations: `struct drm_device`, `struct drm_format_info`, `function drm_format_info_is_yuv_packed`, `function planes`, `function planes`, `function drm_format_info_is_yuv_sampling_410`, `function drm_format_info_is_yuv_sampling_411`, `function drm_format_info_is_yuv_sampling_420`, `function drm_format_info_is_yuv_sampling_422`, `function drm_format_info_is_yuv_sampling_444`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.