Re: [Intel-gfx] [PATCH 1/2] drm/i915/dsc/mtl: Update the DSC minor version

Nautiyal, Ankit K
2022-08-22T09:52:58Z

LGTM.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

On 8/17/2022 6:15 PM, Jani Nikula wrote:
> From: Vandita Kulkarni <vandita.kulkarni@intel.com>
>
> From MTL onwards we support DSC1.2, since there is hardcoding
> to minor version 1, update it.
>
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_dp.c | 18 ++++++++++++++----
> 1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 32292c0be2bd..db5f536bde05 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1377,7 +1377,18 @@ static int intel_dp_dsc_compute_bpp(struct intel_dp *intel_dp, u8 max_req_bpc)
> return 0;
> }
>
> -#define DSC_SUPPORTED_VERSION_MIN 1
> +static int intel_dp_source_dsc_version_minor(struct intel_dp *intel_dp)
> +{
> + struct drm_i915_private *i915 = dp_to_i915(intel_dp);
> +
> + return DISPLAY_VER(i915) >= 14 ? 2 : 1;
> +}
> +
> +static int intel_dp_sink_dsc_version_minor(struct intel_dp *intel_dp)
> +{
> + return (intel_dp->dsc_dpcd[DP_DSC_REV - DP_DSC_SUPPORT] & DP_DSC_MINOR_MASK) >>
> + DP_DSC_MINOR_SHIFT;
> +}
>
> static int intel_dp_dsc_compute_params(struct intel_encoder *encoder,
> struct intel_crtc_state *crtc_state)
> @@ -1416,9 +1427,8 @@ static int intel_dp_dsc_compute_params(struct intel_encoder *encoder,
> (intel_dp->dsc_dpcd[DP_DSC_REV - DP_DSC_SUPPORT] &
> DP_DSC_MAJOR_MASK) >> DP_DSC_MAJOR_SHIFT;
> vdsc_cfg->dsc_version_minor =
> - min(DSC_SUPPORTED_VERSION_MIN,
> - (intel_dp->dsc_dpcd[DP_DSC_REV - DP_DSC_SUPPORT] &
> - DP_DSC_MINOR_MASK) >> DP_DSC_MINOR_SHIFT);
> + min(intel_dp_source_dsc_version_minor(intel_dp),
> + intel_dp_sink_dsc_version_minor(intel_dp));
>
> vdsc_cfg->convert_rgb = intel_dp->dsc_dpcd[DP_DSC_DEC_COLOR_FORMAT_CAP - DP_DSC_SUPPORT] &
> DP_DSC_RGB;