drm_kunit_he..._create_crtc(9)
π 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 π
- Kernel file
./drivers/gpu/drm/tests/drm_kunit_helpers.c drm_kunit_helper_alloc_device(9)drm_kunit_helper_free_device(9)drm_kunit_helper_atomic_state_alloc(9)drm_kunit_helper_create_primary_plane(9)drm_kunit_helper_enable_crtc_connector(9)drm_kunit_add_mode_destroy_action(9)drm_kunit_display_mode_from_cea_vic(9)
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
- 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