drivers/gpu/drm/vkms/vkms_drv.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/vkms/vkms_drv.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/vkms/vkms_drv.h- Extension
.h- Size
- 10585 bytes
- Lines
- 330
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/hrtimer.hdrm/drm.hdrm/drm_framebuffer.hdrm/drm_gem.hdrm/drm_gem_atomic_helper.hdrm/drm_encoder.hdrm/drm_writeback.h
Detected Declarations
struct vkms_frame_infostruct pixel_argb_s32struct pixel_argb_u16struct line_bufferstruct vkms_writeback_jobstruct vkms_plane_statestruct conversion_matrixstruct vkms_plane_statestruct vkms_planestruct vkms_color_lutstruct vkms_crtc_statestruct vkms_outputstruct vkms_configstruct vkms_config_planestruct vkms_deviceenum pixel_read_direction
Annotated Snippet
struct vkms_frame_info {
struct drm_framebuffer *fb;
struct drm_rect src, dst;
struct iosys_map map[DRM_FORMAT_MAX_PLANES];
unsigned int rotation;
};
struct pixel_argb_s32 {
s32 a, r, g, b;
};
/**
* struct pixel_argb_u16 - Internal representation of a pixel color.
* @a: Alpha component value, stored in 16 bits, without padding, using
* machine endianness
* @r: Red component value, stored in 16 bits, without padding, using
* machine endianness
* @g: Green component value, stored in 16 bits, without padding, using
* machine endianness
* @b: Blue component value, stored in 16 bits, without padding, using
* machine endianness
*
* The goal of this structure is to keep enough precision to ensure
* correct composition results in VKMS and simplifying color
* manipulation by splitting each component into its own field.
* Caution: the byte ordering of this structure is machine-dependent,
* you can't cast it directly to AR48 or xR48.
*/
struct pixel_argb_u16 {
u16 a, r, g, b;
};
struct line_buffer {
size_t n_pixels;
struct pixel_argb_u16 *pixels;
};
/**
* typedef pixel_write_t - These functions are used to read a pixel from a
* &struct pixel_argb_u16, convert it in a specific format and write it in the @out_pixel
* buffer.
*
* @out_pixel: destination address to write the pixel
* @in_pixel: pixel to write
*/
typedef void (*pixel_write_t)(u8 *out_pixel, const struct pixel_argb_u16 *in_pixel);
struct vkms_writeback_job {
struct iosys_map data[DRM_FORMAT_MAX_PLANES];
struct vkms_frame_info wb_frame_info;
pixel_write_t pixel_write;
};
/**
* enum pixel_read_direction - Enum used internally by VKMS to represent a reading direction in a
* plane.
*/
enum pixel_read_direction {
READ_BOTTOM_TO_TOP,
READ_TOP_TO_BOTTOM,
READ_RIGHT_TO_LEFT,
READ_LEFT_TO_RIGHT
};
struct vkms_plane_state;
/**
* typedef pixel_read_line_t - These functions are used to read a pixel line in the source frame,
* convert it to `struct pixel_argb_u16` and write it to @out_pixel.
*
* @plane: plane used as source for the pixel value
* @x_start: X (width) coordinate of the first pixel to copy. The caller must ensure that x_start
* is non-negative and smaller than @plane->frame_info->fb->width.
* @y_start: Y (height) coordinate of the first pixel to copy. The caller must ensure that y_start
* is non-negative and smaller than @plane->frame_info->fb->height.
* @direction: direction to use for the copy, starting at @x_start/@y_start
* @count: number of pixels to copy
* @out_pixel: pointer where to write the pixel values. They will be written from @out_pixel[0]
* (included) to @out_pixel[@count] (excluded). The caller must ensure that out_pixel have a
* length of at least @count.
*/
typedef void (*pixel_read_line_t)(const struct vkms_plane_state *plane, int x_start,
int y_start, enum pixel_read_direction direction, int count,
struct pixel_argb_u16 out_pixel[]);
/**
* struct conversion_matrix - Matrix to use for a specific encoding and range
*
* @matrix: Conversion matrix from yuv to rgb. The matrix is stored in a row-major manner and is
* used to compute rgb values from yuv values:
Annotation
- Immediate include surface: `linux/hrtimer.h`, `drm/drm.h`, `drm/drm_framebuffer.h`, `drm/drm_gem.h`, `drm/drm_gem_atomic_helper.h`, `drm/drm_encoder.h`, `drm/drm_writeback.h`.
- Detected declarations: `struct vkms_frame_info`, `struct pixel_argb_s32`, `struct pixel_argb_u16`, `struct line_buffer`, `struct vkms_writeback_job`, `struct vkms_plane_state`, `struct conversion_matrix`, `struct vkms_plane_state`, `struct vkms_plane`, `struct vkms_color_lut`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.