• Shashank Sharma's avatar
    drm/i915: Add CRTC output format YCBCR 4:2:0 · 33b7f3ee
    Shashank Sharma authored
    Currently, we are using a bool in CRTC state (state->ycbcr420),
    to indicate modeset, that the output format is YCBCR 4:2:0. Now in
    order to support other YCBCR formats, we will need more such flags.
    
    This patch adds a new enum parameter for YCBCR 4:2:0 outputs, in the
    CRTC output formats and then plugs it during the modeset.
    
    V3: Added this patch in the series, to address review comments from
        second patchset.
    V4: Added r-b from Maarten (on v3)
        Addressed review comments from Ville:
            - Change the enum name to intel_output_format.
            - Start the enum value (INVALID) from 0 instaed of 1.
            - Set the crtc's output_format to RGB in encoder's compute_config.
    V5: Broke previous patch 1 into two parts,
        - first patch to add CRTC output format in general
        - second patch (this one) to add YCBCR 4:2:0 output
          format specifically.
        - Use ARRAY_SIZE(format_str) for output format validity check (Ville)
    V6: Added a separate function to calculate crtc_state->output_format, and
        calling it from various get_config function (Fix CI build warning)
    V7: Fixed checkpatch warnings for alignment
    V8: Rebase
    V9: Rebase
    V10: Rebase
    V11: Addressed review comments from Ville:
    	- Change check for CRTC output format from > ARRAY_SIZE to >= ARRAY_SIZE.
    	- Check for values < INTEL_OUTPUT_FORMAT_RGB is unnecessary.
    	- No need to get CRTC YCBCR config, for pre-BDW functions.
        Added Ville's r-b.
    
    Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
    Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Signed-off-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 avatarJani Nikula <jani.nikula@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/1539325394-20788-2-git-send-email-shashank.sharma@intel.com
    33b7f3ee
intel_panel.c 58.6 KB