• Uma Shankar's avatar
    drm: Add HDMI colorspace property · d2c6a405
    Uma Shankar authored
    Create a new connector property to program colorspace to sink
    devices. Modern sink devices support more than 1 type of
    colorspace like 601, 709, BT2020 etc. This helps to switch
    based on content type which is to be displayed. The decision
    lies with compositors as to in which scenarios, a particular
    colorspace will be picked.
    
    This will be helpful mostly to switch to higher gamut colorspaces
    like BT2020 when the media content is encoded as BT2020. Thereby
    giving a good visual experience to users.
    
    The expectation from userspace is that it should parse the EDID
    and get supported colorspaces. Use this property and switch to the
    one supported. Sink supported colorspaces should be retrieved by
    userspace from EDID and driver will not explicitly expose them.
    
    Basically the expectation from userspace is:
     - Set up CRTC DEGAMMA/CTM/GAMMA to convert to some sink
       colorspace
     - Set this new property to let the sink know what it
       converted the CRTC output to.
    
    v2: Addressed Maarten and Ville's review comments. Enhanced
    the colorspace enum to incorporate both HDMI and DP supported
    colorspaces. Also, added a default option for colorspace.
    
    v3: Removed Adobe references from enum definitions as per
    Ville, Hans Verkuil and Jonas Karlman suggestions. Changed
    Default to an unset state where driver will assign the colorspace
    is not chosen by user, suggested by Ville and Maarten. Addressed
    other misc review comments from Maarten. Split the changes to
    have separate colorspace property for DP and HDMI.
    
    v4: Addressed Chris and Ville's review comments, and created a
    common colorspace property for DP and HDMI, filtered the list
    based on the colorspaces supported by the respective protocol
    standard.
    
    v5: Made the property creation helper accept enum list based on
    platform capabilties as suggested by Shashank. Consolidated HDMI
    and DP property creation in the common helper.
    
    v6: Addressed Shashank's review comments.
    
    v7: Added defines instead of enum in uapi as per Brian Starkey's
    suggestion in order to go with string matching at userspace. Updated
    the commit message to add more details as well kernel docs.
    
    v8: Addressed Maarten's review comments.
    
    v9: Removed macro defines from uapi as per Brian Starkey and Daniel
    Stone's comments and moved to drm include file. Moved back to older
    design with exposing all HDMI colorspaces to userspace since infoframe
    capability is there even on legacy platforms, as per Ville's review
    comments.
    
    v10: Fixed sparse warnings, updated the RB from Maarten and Jani's ack.
    
    v11: Addressed Ville's review comments. Updated the Macro naming and
    added DCI-P3 colorspace as well, defined in CTA 861.G spec.
    
    v12: Appended BT709 and SMPTE 170M with YCC information as per Ville's
    review comment to be clear and not to be confused with RGB.
    
    v13: Reorder the colorspace macros.
    
    v14: Removed DP as of now, will be added later once full support is
    enabled, as per Ville's suggestion. Added Ville's RB.
    Signed-off-by: default avatarUma Shankar <uma.shankar@intel.com>
    Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
    Reviewed-by: default avatarShashank Sharma <shashank.sharma@intel.com>
    Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/1550596381-993-2-git-send-email-uma.shankar@intel.com
    d2c6a405
drm_connector.h 45.5 KB