drm_for_each_connector_iter(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_for_each_connector_iter πŸ’…

okay bestie, welcome to the drm_for_each_connector_iter(9) page from the Kernel API Manual β€” yes it's a real kernel macro and yes it's lowkey iconic ✨


🌸 NAME 🌸

drm_for_each_connector_iter β€” the connector_list iterator macro, periodt πŸŽ€


✨ SYNOPSIS ✨

drm_for_each_connector_iter (connector , iter );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • connector β€” a struct drm_connector pointer, and it's your cursor, your main character, the thing you're looping over πŸ’«
  • iter β€” a struct drm_connector_list_iter, which is the iterator doing the actual walking, no cap πŸšΆβ€β™€οΈ

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea, and you need to hear this one: connector is only valid within the list body. like, inside the loop? slay, it's yours. but the second you call drm_connector_list_iter_end and then try to use connector afterwards? bestie, that's a no πŸ’€ it's gone, it's not your connector anymore.

so if you want to keep using connector after calling drm_connector_list_iter_end, you gotta grab your own reference first using drm_connector_get, fr fr 🫢 do that and you're golden ✨

not me warning you about dangling connectors… anyway, hold your own reference or hold your peace πŸ’…

πŸ”₯ SEE ALSO πŸ”₯

all the related lore lives in the kernel file ./include/drm/drm_connector.h πŸ‘‘ and here's the whole squad:

  • enum drm_connector_status(9)
  • enum drm_connector_registration_state(9)
  • enum drm_connector_tv_mode(9)
  • struct drm_scrambling(9)
  • struct drm_hdmi_dsc_cap(9)
  • struct drm_hdmi_info(9)
  • enum drm_link_status(9)
  • enum drm_panel_orientation(9)
  • enum drm_hdmi_broadcast_rgb(9)
  • struct drm_monitor_range_info(9)
  • struct drm_luminance_range_info(9)
  • enum drm_privacy_screen_status(9)
  • enum drm_colorspace(9)
  • enum drm_output_color_format(9)
  • enum drm_connector_color_format(9)
  • enum drm_bus_flags(9)
  • struct drm_amd_vsdb_info(9)
  • struct drm_display_info(9)
  • struct drm_connector_tv_margins(9)
  • struct drm_tv_connector_state(9)
  • struct drm_connector_hdmi_infoframe(9)
  • struct drm_connector_state(9)
  • struct drm_connector_cec_funcs(9)
  • struct drm_connector_infoframe_funcs(9)
  • struct drm_connector_hdmi_funcs(9)
  • struct drm_connector_funcs(9)
  • struct drm_cmdline_mode(9)
  • struct drm_connector_hdmi_audio(9)
  • struct drm_connector_cec(9)
  • struct drm_connector(9)
  • drm_connector_lookup(9)
  • drm_connector_get(9)
  • drm_connector_put(9)
  • drm_connector_is_unregistered(9)
  • struct drm_tile_group(9)
  • struct drm_connector_list_iter(9)
  • drm_connector_for_each_possible_encoder(9)

and that's the whole page, bestie πŸ’œ it's from ./include/drm, dated October 2026, and it says drm_for_each_connector_iter(9) right there in the corner like the little icon it is 🧚 happy iterating, go hold those references 🌈⭐

πŸ“¦ where this page comes from