drm_crtc_cleanup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_crtc_cleanup(9) β€” the Kernel API Manual page you actually wanna read

okay so this is drm_crtc_cleanup(9) from the Kernel API Manual, and bestie, it's a short one but it's important, so let's get into it πŸŽ€


✨ NAME ✨

drm_crtc_cleanup β€” clean up the core crtc usage. that's it. that's the whole vibe. it's the "okay we're done here, pack it up" function 🧹


✨ SYNOPSIS ✨

void drm_crtc_cleanup (struct drm_crtc *crtc );

one function, one argument, zero return value. simple. iconic. no notes πŸ’…


✨ ARGUMENTS ✨

  • crtc β€” the CRTC you wanna cleanup, bestie. that's the one. hand it over and let the function do its thing 🫢

✨ DESCRIPTION ✨

so here's the tea β˜• β€” this function cleans up crtc and removes it from the DRM mode setting core. like, it takes your CRTC out of the group chat. it's no longer part of the mode setting core's business. periodt.

but β€” and this is the part people always get wrong, so listen up πŸ”₯ β€” the function does not free the crtc structure itself. the asterisks around not in the original are doing so much work rn. that memory is your problem, bestie. freeing the struct is the responsibility of the caller. so if you call drm_crtc_cleanup and then assume the struct is gone?? no ma'am. that's a leak and it's giving πŸ’€.

lowkey the whole function is "i broke up with the DRM mode setting core for you, but you still gotta deal with the apartment lease (the struct) yourself" 😭

✨ SEE ALSO ✨

all the friends and neighbors, fr fr 🌈

  • the Kernel file ./drivers/gpu/drm/drm_crtc.c overview(9)
  • drm_crtc_from_index(9)
  • standard CRTC properties(9)
  • drm_crtc_init_with_planes(9)
  • drmm_crtc_init_with_planes(9)
  • drm_mode_getcrtc(9)
  • drm_mode_set_config_internal(9)
  • drm_crtc_check_viewport(9)
  • drm_mode_setcrtc(9)
  • drm_crtc_create_scaling_filter_property(9)
  • drm_crtc_in_clone_mode(9)

okay that's the page!! go forth and clean up your CRTCs responsibly, and remember: cleanup β‰  free, and that's the whole lesson πŸ¦‹πŸ’–

source is ./drivers/gpu/drm, dated October 2026, and this little number lives at drm_crtc_cleanup(9) β€” mwah, bye bestie πŸŽ€βœ¨πŸ‘‘
πŸ“¦ where this page comes from