STRUCT DRM_CONNECTOR_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct drm_connector_state(9) ✨

okay bestie, welcome to the Kernel API Manual πŸ’… this one's about struct drm_connector_state, which is literally mutable connector state β€” yes that's the whole NAME, she's concise, she's iconic, she's giving main character energy πŸ‘‘


🌸 SYNOPSIS 🌸

like, here's the whole struct, every single field, no cap:

struct drm_connector_state {
    struct drm_connector *connector;
    struct drm_crtc *crtc;
    struct drm_encoder *best_encoder;
    enum drm_link_status link_status;
    struct drm_atomic_commit *state;
    struct drm_crtc_commit *commit;
    struct drm_tv_connector_state tv;
    bool self_refresh_aware;
    enum hdmi_picture_aspect picture_aspect_ratio;
    unsigned int content_type;
    unsigned int hdcp_content_type;
    unsigned int scaling_mode;
    unsigned int content_protection;
    enum drm_colorspace colorspace;
    enum drm_connector_color_format color_format;
    struct drm_writeback_job *writeback_job;
    u8 max_requested_bpc;
    u8 max_bpc;
    enum drm_privacy_screen_status privacy_screen_sw_state;
    struct drm_property_blob *hdr_output_metadata;
    struct drm_connector_hdmi_state hdmi;
};

πŸŽ€ Members πŸŽ€

okay so let's go through every single one, grab a snack πŸ“

  • connector β€” backpointer to the connector. that's it, that's the whole vibe 🫢
  • crtc β€” the CRTC to connect the connector to, or NULL if it's disabled.
🚨 bestie do NOT change this directly, use drm_atomic_set_crtc_for_connector instead. i'm serious. put it down.
  • best_encoder β€” used by the atomic helpers to select the encoder, through the drm_connector_helper_funcs.atomic_best_encoder or drm_connector_helper_funcs.best_encoder callbacks.

this is also used in the atomic helpers to map encoders to their current and previous connectors, see drm_atomic_get_old_connector_for_encoder and drm_atomic_get_new_connector_for_encoder.

⚠️ NOTE: atomic drivers must fill this out (either themselves or through helpers), for otherwise the GETCONNECTOR and GETENCODER IOCTLs will not return correct data to userspace. like, that's not a suggestion, that's the assignment πŸ’€
  • link_status β€” connector link_status to keep track of whether the link is GOOD or BAD, so we can notify userspace if retraining is necessary πŸ”₯
  • state β€” backpointer to the global drm_atomic_commit
  • commit β€” tracks the pending commit to prevent use-after-free conditions 😭

is only set when crtc is NULL.

  • tv β€” TV connector state πŸ“Ί
  • self_refresh_aware β€” this tracks whether a connector is aware of the self refresh state. it should be set to true for those connector implementations which understand the self refresh state. this is needed since the crtc registers the self refresh helpers and it doesn't know if the connectors downstream have implemented self refresh entry/exit.

drivers should set this to true in atomic_check if they know how to handle self_refresh requests 🧚

  • picture_aspect_ratio β€” connector property to control the HDMI infoframe aspect ratio setting.

the DRM_MODE_PICTURE_ASPECT_values much match the values for enum hdmi_picture_aspect ✨

  • content_type β€” connector property to control the HDMI infoframe content type setting. the DRM_MODE_CONTENT_TYPE_values much match the values.
  • hdcp_content_type β€” connector property to pass the type of protected content. this is most commonly used for HDCP πŸ”’
  • scaling_mode β€” connector property to control the upscaling, mostly used for built-in panels.
  • content_protection β€” connector property to request content protection. this is most commonly used for HDCP.
  • colorspace β€” state variable for the connector property to request colorspace change on the Sink. this is most commonly used to switch to wider color gamuts like BT2020 🌈
  • color_format β€” state variable for the connector property to request color format change on the Sink. this is most commonly used to switch between RGB to YUV and vice-versa.
  • writeback_job β€” writeback job for writeback connectors.

holds the framebuffer and out-fence for a writeback connector. as the writeback completion may be asynchronous to the normal commit cycle, the writeback job lifetime is managed separately from the normal atomic state by this object.

see also: drm_writeback_queue_job and drm_writeback_signal_completion πŸ¦‹

  • max_requested_bpc β€” connector property to limit the maximum bit depth of the pixels.
  • max_bpc β€” connector max_bpc based on the requested max_bpc property and the connector bpc limitations obtained from edid.
  • privacy_screen_sw_state β€” see :ref:Standard Connector Properties<standard_connector_properties> πŸ™ˆ
  • hdr_output_metadata β€” DRM blob property for HDR output metadata ⭐
  • hdmi β€” HDMI-related variable and properties. filled by drm_atomic_helper_connector_hdmi_check.

πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./include/drm/drm_connector.h, plus the whole friend group, in order, no skips:

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_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_for_each_connector_iter(9), drm_connector_for_each_possible_encoder(9)


that's the whole page bestie, go forth and read the connector state πŸ’–

mwah πŸ’‹ β€” this one came at you from ./include/drm, dated October 2026, and yes it's still called struct drm_connector_state(9) in case you forgot already πŸŽ€

πŸ“¦ where this page comes from