STRUCT VKMS_CRTC_STATE(9)
π struct vkms_crtc_state(9) π
okay bestie, welcome to the Kernel API Manual β this one's about struct vkms_crtc_state, and no cap, it's lowkey the main character of the VKMS driver. let's get into it β¨
πΈ NAME πΈ
struct vkms_crtc_state β the driver-specific CRTC state. that's it, that's the vibe. π
π¦ SYNOPSIS π¦
struct vkms_crtc_state {
struct drm_crtc_state base;
struct work_struct composer_work;
int num_active_planes;
struct vkms_plane_state **active_planes;
struct vkms_writeback_job *active_writeback;
struct vkms_color_lut gamma_lut;
bool crc_pending;
bool wb_pending;
u64 frame_start;
u64 frame_end;
};
like, look at her. she's got range. π
β¨ Members β¨
baseβ the base CRTC state, literally the foundation everything else sits on. π«Άcomposer_workβ a work struct whose whole job is to compose stuff and add CRC entries. she's booked and busy.num_active_planesβ how many planes are active rn, just a count. simple. iconic.active_planesβ the list holding all the active planes (and yeah, the count matchesnum_active_planes). π¨ important detail: they should be stored in z-order. don't skip that part, iykyk.active_writebackβ the current active writeback job. the one on duty rn.gamma_lutβ the look up table for gamma used in this CRTC. a whole little table of vibes. πcrc_pendingβ protected byvkms_output.composer_lock, and it'struewhen the frame CRC isn't computed yet. vblank peeks at this to detect if the composer is being too slow π (yes, it's a snitch).wb_pendingβ also protected byvkms_output.composer_lock, and it'struewhen a writeback frame is requested. π«frame_startβ protected byvkms_output.composer_lock; it saves the frame number before the composition process starts. like a lil timestamp of "we began here".frame_endβ protected byvkms_output.composer_lock; it saves the last requested frame number. this one's the MVP for generating enough CRC entries when the composition worker is too slow π₯
heads up bestie:crc_pending,wb_pending,frame_startandframe_endare all undervkms_output.composer_lock. that's not a coincidence, that's a lock. π
β SEE ALSO β
kernel file ./drivers/gpu/drm/vkms/vkms_drv.h, plus the whole friend group:
struct vkms_frame_info(9)struct pixel_argb_u16(9)pixel_write_t(9)enum pixel_read_direction(9)pixel_read_line_t(9)struct conversion_matrix(9)struct vkms_plane_state(9)struct vkms_output(9)struct vkms_device(9)vkms_create(9)vkms_destroy(9)vkms_crtc_init(9)vkms_output_init(9)vkms_plane_init(9)
that's the whole page, periodt π this drop came from ./drivers/gpu/drm/vkms, dated October 2026, and it's literally titled struct vkms_crtc_state(9). go forth and slay your CRTC state, bestie ππ¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms