STRUCT DRM_CONNECTOR_FUNCS(9)
π NAME π
okay so bestie, you're in the Kernel API Manual and today's main character is struct drm_connector_funcs β it's literally for control connectors on a given device, and the way that's such a whole vibe ππ no cap, this struct is the plug for connector behavior, and we're gonna treat every field like the icon it is β¨
β¨ SYNOPSIS β¨
here's the full roster of function pointers, bestie β every single one, exactly as the manual serves it, no edits, no skips, no βoops I forgot oneβ energy ππ
struct drm_connector_funcs {
int (*dpms)(struct drm_connector *connector, int mode);
void (*reset)(struct drm_connector *connector);
enum drm_connector_status (*detect)(struct drm_connector *connector,
bool force);
void (*force)(struct drm_connector *connector);
int (*fill_modes)(struct drm_connector *connector, uint32_t
max_width, uint32_t max_height);
int (*set_property)(struct drm_connector *connector, struct
drm_property *property, uint64_t val);
int (*late_register)(struct drm_connector *connector);
void (*early_unregister)(struct drm_connector *connector);
void (*destroy)(struct drm_connector *connector);
struct drm_connector_state *(*atomic_create_state)(struct
drm_connector *connector);
struct drm_connector_state *(*atomic_duplicate_state)(struct
drm_connector *connector);
void (*atomic_destroy_state)(struct drm_connector *connector, struct
drm_connector_state *state);
int (*atomic_set_property)(struct drm_connector *connector, struct
drm_connector_state *state, struct drm_property *property, uint64_t
val);
int (*atomic_get_property)(struct drm_connector *connector, const
struct drm_connector_state *state, struct drm_property *property,
uint64_t *val);
void (*atomic_print_state)(struct drm_printer *p, const struct
drm_connector_state *state);
void (*oob_hotplug_event)(struct drm_connector *connector, enum
drm_connector_status status);
void (*debugfs_init)(struct drm_connector *connector, struct dentry
*root);
enum drm_connector_color_format (*color_format)( const struct
drm_connector_state *conn_state);
};
that's the whole synopsis for this part, and every field got its moment in the spotlight π«Άβ¨ part 1 of 3, and we are so not done yet π
π Members π
dpmsβ the legacy entry point for setting the per-connector DPMS state. Legacy DPMS is exposed as a standard property on the connector, but the DRM core diverts it to this callback. Heads up bestie: atomic drivers don't implement the 4 level DPMS support on the connector anymore β instead they only have an on/off"ACTIVE"property on the CRTC object.
This hook is not used by atomic drivers at all β the remapping of the legacy DPMS property is entirely handled in the DRM core.
RETURNS:
0 on success or a negative error code on failure.
resetβ reset connector hardware and software state to off. The core doesn't call this directly β it only ever happens throughdrm_mode_config_reset. And no, it's not a helper hook, it's just like that for historical reasons π
Atomic drivers can use drm_atomic_helper_connector_reset to reset atomic state using this hook.
detectβ check to see if anything is attached to the connector. The force parameter is set tofalsewhilst polling, andtruewhen checking the connector due to a user request. force can be used by the driver to avoid expensive, destructive operations during automated probing. π
This callback is optional β if it's not implemented, the connector is considered as always being attached.
FIXME:
Note that this hook is only called by the probe helper. It's not in the helper library vtable purely for historical reasons. The only DRM core entry point to probe connector state is fill_modes.
Also note that the helper library will already hold drm_mode_config.connection_mutex. Drivers that need to grab additional locks to avoid races with concurrent modeset changes need to use drm_connector_helper_funcs.detect_ctx instead.
And one more: this callback can be called no matter what state the connector is in. Drivers that need the underlying device to be powered just to perform the detection will first need to make sure it's been properly enabled. β‘
RETURNS:
drm_connector_status indicating the connector's status.
forceβ this function is called to update internal encoder state when the connector is forced to a certain state by userspace, either through thesysfsinterfaces or on the kernel cmdline. In that case thedetectcallback isn't called. π«Ά
FIXME:
Note that this hook is only called by the probe helper. It's not in the helper library vtable purely for historical reasons. The only DRM core entry point to probe connector state is fill_modes.
fill_modesβ the entry point for output detection and basic mode validation. The driver should reprobe the output if needed (e.g. when hotplug handling is unreliable), add all detected modes todrm_connector.modesand filter out any the device can't support in any configuration. It also needs to filter out any modes wider or higher than the parameters max_width and max_height indicate. π
The drivers must also prune any modes no longer valid from drm_connector.modes. Furthermore it must update drm_connector.status and drm_connector.edid. If no EDID has been received for this output, connector->edid must be NULL.
Drivers using the probe helpers should use drm_helper_probe_single_connector_modes to implement this function.
RETURNS:
The number of modes detected and filled into drm_connector.modes.
set_propertyβ this is the legacy entry point to update a property attached to the connector. π§
This callback is optional if the driver does not support any legacy driver-private properties. For atomic drivers it is not used, because property handling is done entirely in the DRM core.
RETURNS:
0 on success or a negative error code on failure.
late_registerβ this optional hook can be used to register additional userspace interfaces attached to the connector β light backlight control, i2c, DP aux or similar interfaces. It's called late in the driver load sequence fromdrm_connector_registerwhen registering all the core drm connector interfaces. Everything added from this callback should be unregistered in theearly_unregistercallback. π₯
This is called while holding drm_connector.mutex.
Returns:
0 on success, or a negative error code on failure.
early_unregisterβ this optional hook should be used to unregister the additional userspace interfaces attached to the connector fromlate_register. It's called fromdrm_connector_unregister, early in the driver unload sequence, to disable userspace access before data structures are torn down. π
This is called while holding drm_connector.mutex.
destroyβ clean up connector resources. This is called at driver unload time throughdrm_mode_config_cleanup. It can also be called at runtime when a connector is being hot-unplugged, for drivers that support connector hotplugging (e.g. DisplayPort MST). πatomic_create_stateβ allocate a pristine, initialized, state for the connector object and return it. This callback must have no side effects: in particular, the returned state must not be assigned to the object's state pointer and it must not affect the hardware state. β¨
RETURNS:
A new, pristine, connector state instance or an error pointer on failure.
atomic_duplicate_stateβ duplicate the current atomic state for this connector and return it. The core and helpers guarantee that any atomic state duplicated with this hook and still owned by the caller (i.e. not transferred to the driver by callingdrm_mode_config_funcs.atomic_commit) will be cleaned up by calling theatomic_destroy_statehook in this structure. π
This callback is mandatory for atomic drivers.
Atomic drivers which don't subclass struct drm_connector_state should use drm_atomic_helper_connector_duplicate_state. Drivers that subclass the state structure to extend it with driver-private state should use __drm_atomic_helper_connector_duplicate_state to make sure shared state is duplicated in a consistent fashion across drivers.
It is an error to call this hook before drm_connector.state has been initialized correctly.
NOTE:
If the duplicate state references refcounted resources, this hook must acquire a reference for each of them. The driver must release these references again in atomic_destroy_state.
RETURNS:
Duplicated atomic state or NULL when the allocation failed.
atomic_destroy_stateβ destroy a state duplicated withatomic_duplicate_stateand release or unreference all resources it references. π¦
This callback is mandatory for atomic drivers.
atomic_set_propertyβ decode a driver-private property value and store the decoded value into the passed-in state structure. Since the atomic core decodes all standardized properties (even for extensions beyond the core set of properties which might not be implemented by all drivers), this requires drivers to subclass the state structure.
Such driver-private properties should really only be implemented for truly hardware/vendor specific state. Instead it's preferred to standardize atomic extension and decode the properties used to expose such an extension in the core. π
Do not call this function directly β use drm_atomic_connector_set_property instead.
This callback is optional if the driver does not support any driver-private atomic properties.
NOTE:
This function is called in the state assembly phase of atomic modesets, which can be aborted for any reason (including on userspace's request to just check whether a configuration would be possible). Drivers MUST NOT touch any persistent state (hardware or software) or data structures except the passed in state parameter. π¨
Also, since userspace controls in which order properties are set, this function must not do any input validation (since the state update is incomplete and hence likely inconsistent). Instead, any such input validation must be done in the various atomic_check callbacks.
RETURNS:
0 if the property has been found, -EINVAL if the property isn't implemented by the driver (which shouldn't ever happen β the core only asks for properties attached to this connector). No other validation is allowed by the driver. The core already checks that the property value is within the range (integer, valid enum value, ...) the driver set when registering the property.
atomic_get_propertyβ reads out the decoded driver-private property. This is used to implement theGETCONNECTORIOCTL. π
Do not call this function directly β use drm_atomic_connector_get_property instead.
This callback is optional if the driver does not support any driver-private atomic properties.
RETURNS:
0 on success, -EINVAL if the property isn't implemented by the driver (which shouldn't ever happen β the core only asks for properties attached to this connector).
atomic_print_stateβ if the driver subclassesstruct drm_connector_state, it should implement this optional hook for printing additional driver specific state. π¨οΈ
Do not call this directly β use drm_atomic_connector_print_state instead.
oob_hotplug_eventβ this will get called when a hotplug-event for a drm-connector has been received from a source outside the display driver / device. πdebugfs_initβ allows connectors to create connector-specificdebugfsfiles. πcolor_formatβ allows connectors to return a connector color format other thanconn_state.color_format, for purposes of e.g. display protocol specific helper logic having already mapped it to an output format. π¨
β¨ Description β¨
Each CRTC may have one or more connectors attached to it. The functions below allow the core DRM code to control connectors, enumerate available modes, etc. Literally the whole vibe of this struct, no cap. π
π SEE ALSO β¨
okay bestie, this is the part where the manpage is like "here's everyone else at the function"βit's giving a whole group chat of related kernel docs, and you know we're gonna stan every single one π so let's go, no skips:
- the header they all live in: Kernel file
./include/drm/drm_connector.hπ enum drm_connector_status(9)β the vibe check enum for connector status β¨enum drm_connector_registration_state(9)β registration state enum, lowkey important π¦enum drm_connector_tv_mode(9)β TV mode enum, yes ma'am πΊstruct drm_scrambling(9)β scrambling struct, it's giving encrypted energy πstruct drm_hdmi_dsc_cap(9)β HDMI DSC capability struct π«struct drm_hdmi_info(9)β the HDMI info struct, main character of the port world πenum drm_link_status(9)β link status enum, keep an eye on it πΈenum drm_panel_orientation(9)β panel orientation enum, rotate slay πenum drm_hdmi_broadcast_rgb(9)β HDMI broadcast RGB enum πstruct drm_monitor_range_info(9)β monitor range info struct πstruct drm_luminance_range_info(9)β luminance range info struct, literally glowing β¨enum drm_privacy_screen_status(9)β privacy screen status enum, no peeking πenum drm_colorspace(9)β colorspace enum, rainbow moment πenum drm_output_color_format(9)β output color format enum π¨enum drm_connector_color_format(9)β connector color format enum ποΈenum drm_bus_flags(9)β bus flags enum, flags are iconic π©struct drm_amd_vsdb_info(9)β AMD VSDB info struct, AMD girlies rise π«Άstruct drm_display_info(9)β display info struct, the whole aesthetic πΌοΈstruct drm_connector_tv_margins(9)β TV margins struct, boundaries bestie πstruct drm_tv_connector_state(9)β TV connector state struct πΊstruct drm_connector_hdmi_infoframe(9)β HDMI infoframe struct, info but make it fancy πstruct drm_connector_state(9)β connector state struct, the moment π«Άstruct drm_connector_cec_funcs(9)β CEC funcs struct πstruct drm_connector_infoframe_funcs(9)β infoframe funcs struct β¨struct drm_connector_hdmi_funcs(9)β HDMI funcs struct, sibling energy πstruct drm_cmdline_mode(9)β command line mode struct, old school cool π«struct drm_connector_hdmi_audio(9)β HDMI audio struct, sound ON πstruct drm_connector_cec(9)β CEC struct ποΈstruct drm_connector(9)β the connector struct itself, the blueprint, the icon πdrm_connector_lookup(9)β go find your connector πdrm_connector_get(9)β grab a reference, hold it tight π«Άdrm_connector_put(9)β release it, let it go π¦drm_connector_is_unregistered(9)β is it unregistered? ask the function πstruct drm_tile_group(9)β tile group struct π§©struct drm_connector_list_iter(9)β connector list iterator, loop era πdrm_for_each_connector_iter(9)β the macro that walks every connector, ate πdrm_connector_for_each_possible_encoder(9)β and this one walks every possible encoder, periodt π₯
and that's the whole page bestie, we did it π no cap, every single reference made it out alive. this lil gem lives in ./include/drm, it's the struct drm_connector_funcs(9) page, and it's stamped October 2026 β so go forth, register your connectors, and remember: the vibe check is forever πβ¨ππ¦
π¦ 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