• Thomas Zimmermann's avatar
    drm/udl: Untangle .get_modes() and .detect_ctx() · 90e0fd1e
    Thomas Zimmermann authored
    Provide separate implementations of .get_modes() and .detect_ctx()
    from struct drm_connector. Switch to struct drm_edid.
    
    Udl's .detect() helper used to fetch the EDID from the adapter and the
    .get_modes() helper provided display modes from the data. But this
    relied on the DRM helpers to call the functions in the correct order.
    When no EDID could be retrieved, .detect() regularly printed a warning
    to the kernel log.
    
    Switching to the new helpers around struct drm_edid separates both from
    each other. The .get_modes() helper now fetches the EDID by itself and
    the .detect_ctx() helper only tests for its presence. The patch does a
    number of things to implement this.
    
    - Move udl_get_edid_block() to udl_edid.c and rename it to
    udl_read_edid_block(). Then use the helper to implement probing in
    udl_probe_edid() and reading in udl_edid_read(). The latter helper
    is build on top of DRM helpers.
    
    - Replace the existing code in .get_modes() and .detect() with udl's
    new EDID helpers. The new code behaves like DRM's similar DDC-based
    helpers. Instead of .detect(), udl now implements .detect_ctx().
    
    - Remove the edid data from struct udl_connector. The field cached
    the EDID data between calls to .detect() and .get_modes(), but is now
    unused.
    
    v3:
    - implement udl_probe_edid() with memchr_inv() (Jani)
    
    v2:
    - implement udl_probe_edid() within udl
    - reword commit description
    Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
    Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240510154841.11370-5-tzimmermann@suse.de
    90e0fd1e
udl_modeset.c 15.7 KB