drm_kunit_a...stroy_action(9)
π drm_kunit_add_mode_destroy_action(9) β from the Kernel API Manual, bestie β¨
okay so real talk, this one lives in the Kernel API Manual and it's lowkey one of those tiny helper functions that just works so you don't have to. it's giving "cleanup crew, but make it kunit." π§Ήπ
β¨ NAME β¨
drm_kunit_add_mode_destroy_action β adds a drm_destroy_mode kunit action. that's it, that's the whole vibe π
π¦ SYNOPSIS π¦
int drm_kunit_add_mode_destroy_action (struct kunit *test , struct
drm_display_mode *mode );
πΈ ARGUMENTS πΈ
testβ the test context object, aka the main character of your kunit test π«Άmodeβ thedrm_display_modethat's gonna get destroyed eventually. it's on its own little timer, no cap π
π DESCRIPTION π
so what it does: it registers a kunit action that will destroy the drm_display_mode at the end of the test. set it and forget it energy, honestly iconic π
and if an error occurs, the drm_display_mode will be destroyed. like, either way it's getting cleaned up β the mode does NOT survive the test, periodt π
β RETURN β
0 on success, an error code otherwise. slay when it's zero, π when it's not.
π₯ SEE ALSO π₯
- Kernel file
./drivers/gpu/drm/tests/drm_kunit_helpers.cβ the source, go read it, iykyk π 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_create_crtc(9)drm_kunit_helper_enable_crtc_connector(9)drm_kunit_display_mode_from_cea_vic(9)
bestie warning π¨: the destruction happens whether or not things go your way β that's the whole point, so don't go assuming you get to keep the mode around after the test. π
kisses, this page came to you from ./drivers/gpu/drm/tests and it's dated October 2026 β go forth and write tests that clean up after themselves, mwah ππ
π¦ 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