STRUCT VKMS_CRTC_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 matches num_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 by vkms_output.composer_lock, and it's true when 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 by vkms_output.composer_lock, and it's true when a writeback frame is requested. πŸ’«
  • frame_start β€” protected by vkms_output.composer_lock; it saves the frame number before the composition process starts. like a lil timestamp of "we began here".
  • frame_end β€” protected by vkms_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_start and frame_end are all under vkms_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:


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