• Ankit Nautiyal's avatar
    drm: Expose modes with aspect ratio, only if requested · c3ff0cdb
    Ankit Nautiyal authored
    We parse the EDID and add all the modes in the connector's modelist.
    This adds CEA modes with aspect ratio information too, regardless of
    whether user space requested this information or not.
    
    This patch:
    -prunes the modes with aspect-ratio information, from the
     drm_mode_get_connector modelist supplied to the user, if the
     user-space has not set the aspect ratio DRM client cap. However if
     such a mode is unique in the list, it is kept in the list, with
     aspect-ratio flags reset.
    -prepares a list of exposed modes, which is used to find unique modes
     if aspect-ratio is not allowed.
    -adds a new list_head 'exposed_head' in drm_mode_display, to traverse
     the list of exposed modes.
    
    Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
    Cc: Shashank Sharma <shashank.sharma@intel.com>
    Cc: Jose Abreu <jose.abreu@synopsys.com>
    Signed-off-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
    
    V3: As suggested by Ville, modified the mechanism of pruning of modes
        with aspect-ratio, if the aspect-ratio is not supported. Instead
        of straight away pruning such a mode, the mode is retained with
        aspect ratio bits set to zero, provided it is unique.
    V4: rebase
    V5: Addressed review comments from Ville:
        -used a pointer to store last valid mode.
        -avoided, modifying of picture_aspect_ratio in kernel mode,
         instead only flags bits of user mode are reset (if aspect-ratio
         is not supported).
    V6: As suggested by Ville, corrected the mode pruning logic and
        elaborated the mode pruning logic and the assumptions taken.
    V7: rebase
    V8: rebase
    V9: rebase
    V10: rebase
    V11: Fixed the issue caused in kms_3d test, and enhanced the pruning
         logic to correctly identify and prune modes with aspect-ratio,
         if aspect-ratio cap is not set.
    V12: As suggested by Ville, added another list_head in
         drm_mode_display to traverse the list of exposed modes and
         avoided duplication of modes.
    V13: Minor modifications, as suggested by Ville.
    v14: As suggested by Daniel Vetter and Ville Syrjala, corrected the
         pruning logic to avoid any dependency in the order of mode with
         aspect-ratio.
    Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/1525777785-9740-9-git-send-email-ankit.k.nautiyal@intel.com
    c3ff0cdb
drm_modes.h 18.5 KB