• Ville Syrjälä's avatar
    drm/sysfs: Register "ddc" symlink later · 21b6c281
    Ville Syrjälä authored
    Currently drm_sysfs_connector_add() attempts to register
    the "ddc" symlink (based one connector->ddc) before the
    driver's .early_register() hook has been called. That is
    too early for i915 which only fully registers the aux ch
    and associated i2c bus from said hook (to prevent half
    initialized stuff getting exposed to userspace). This
    causes my attempt at using drm_connector_init_with_ddc()
    to fail, and the entire connector disappears from sysfs
    on account of sysfs_create_link() failing.
    
    To fix that split the sysfs symlink stuff into separate
    functions (drm_sysfs_connector_add_late() and
    drm_sysfs_connector_remove_early()) which are called
    on the opposite side of the .later_register() and
    .early_unregister() hooks.
    
    Cc: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
    Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
    Cc: Andrzej Hajda <a.hajda@samsung.com>
    Cc: Emil Velikov <emil.velikov@collabora.com>
    Cc: Sam Ravnborg <sam@ravnborg.org>
    Cc: Neil Armstrong <narmstrong@baylibre.com>
    Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230829113920.13713-3-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
    Acked-by: Thomas Zimmermann <tzimmermann@suse.de> #irc
    21b6c281
drm_connector.c 105 KB