drm_kunit_he..._create_crtc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_kunit_he..._create_crtc(9)

okay so bestie, welcome to the Kernel API Manual β€” yes, the actual kernel docs, but make it a group chat 🫢. We're talking about drm_kunit_he..._create_crtc (the header truncates it, it's really drm_kunit_helper_create_crtc, iykyk). Buckle up, this one's a little mock-CRTC-making icon ✨.


✨ NAME ✨

drm_kunit_helper_create_crtc β€” literally creates a mock CRTC for a KUnit test πŸŽ€


🌸 SYNOPSIS 🌸

struct drm_crtc * drm_kunit_helper_create_crtc (struct kunit *test ,
       struct drm_device *drm , struct drm_plane *primary , struct drm_plane
       *cursor , const struct drm_crtc_funcs *funcs , const struct
       drm_crtc_helper_funcs *helper_funcs );

that's the whole signature, no cap. six arguments, all of them matter, we do not skip πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • test β€” the test context object. your KUnit bestie holding the whole thing together πŸ’–
  • drm β€” the device to alloc the plane for.
  • primary β€” primary plane for the CRTC. main character energy, fr.
  • cursor β€” cursor plane for the CRTC. Optional, so she can sit this one out πŸ™ˆ
  • funcs β€” callbacks for the new plane. Optional too πŸ‘‘
  • helper_funcs β€” helpers callbacks for the new plane. also Optional, she's chill like that 🌈
ngl there's a lot of "optional" energy up in here, but the ones that aren't optional? they're really not optional, so don't play with it πŸ’€

⭐ DESCRIPTION ⭐

This allocates and initializes a mock struct drm_crtc β€” like, a whole pretend CRTC β€” meant to be part of a mock device for a KUnit test 🧚

Resources will be cleaned up automatically. yes bestie, automatic, you don't have to lift a finger, obsessed 😭

funcs will default to the default helpers implementations. helper_funcs will default to an empty implementation. so if you're like "idk what to pass" β€” you can literally just not, and the defaults carry you 🫢


πŸ‘‘ RETURN πŸ‘‘

A pointer to the new CRTC, or an ERR_PTR otherwise. so like, check it before you go dereferencing, bestie, that's the vibe check πŸ”₯


πŸ’œ SEE ALSO πŸ’œ

the whole squad, all accounted for, no one left behind πŸ’–βœ¨


and that's the page!! source lives in ./drivers/gpu/drm/tests, dated October 2026, and we're all reading it through the drm_kunit_he..._create_crtc(9) lens πŸŽ€ slay, go write your tests, periodt πŸ’…

πŸ“¦ where this page comes from