Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Anusha Srivatsa <anusha.srivatsa@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [v4 4/7] i915/dp/fec: Add fec_enable to the crtc state.
Date: Wed, 31 Oct 2018 23:03:25 +0200	[thread overview]
Message-ID: <20181031210325.GU9144@intel.com> (raw)
In-Reply-To: <20181031004517.17250-5-anusha.srivatsa@intel.com>

On Tue, Oct 30, 2018 at 05:45:14PM -0700, Anusha Srivatsa wrote:
> Add a crtc state for FEC. Currently, the state
> is determined by platform, DP and DSC being
> enabled. Moving forward we can use the state
> to have error correction on other scenarios too
> if needed.
> 
> v2:
> - Control compression_enable with the fec_enable
> parameter in crtc state and with intel_dp_supports_fec()
> (Ville)
> 
> - intel_dp_can_fec()/intel_dp_supports_fec()(manasi)
> 
> Suggested-by: Ville Syrjala <ville.syrjala@linux.intel.com>
> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Manasi Navare <manasi.d.navare@intel.com>
> Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c  | 25 ++++++++++++++++++++++++-
>  drivers/gpu/drm/i915/intel_drv.h |  3 +++
>  2 files changed, 27 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index a344be555dd6..5ae3855925f3 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -2045,6 +2045,21 @@ intel_dp_compute_link_config_fast(struct intel_dp *intel_dp,
>  	return false;
>  }
>  
> +static bool intel_dp_source_supports_fec(struct intel_dp *intel_dp)
> +{
> +	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
> +	struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
> +	enum port port = dig_port->base.port;
> +
> +	return INTEL_GEN(dev_priv) >= 11 && port != PORT_A;
> +}
> +
> +static bool intel_dp_supports_fec(struct intel_dp *intel_dp,
> +				  struct intel_crtc_state *pipe_config)
> +{
> +	return intel_dp_source_supports_fec(intel_dp) &&
> +		drm_dp_sink_supports_fec(intel_dp->fec_capable);
> +}
>  static bool intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
>  					struct intel_crtc_state *pipe_config,
>  					struct link_config_limits *limits)
> @@ -2056,6 +2071,8 @@ static bool intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
>  	u16 dsc_max_output_bpp = 0;
>  	u8 dsc_dp_slice_count = 0;
>  
> +	pipe_config->fec_enable = !intel_dp_is_edp(intel_dp);
> +
>  	if (INTEL_GEN(dev_priv) < 10 ||
>  	    !drm_dp_sink_supports_dsc(intel_dp->dsc_dpcd))
>  		return false;
> @@ -2122,7 +2139,13 @@ static bool intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
>  			  pipe_config->dsc_params.compressed_bpp);
>  		return false;
>  	}
> -	pipe_config->dsc_params.compression_enable = true;
> +
> +	if (pipe_config->fec_enable && !intel_dp_supports_fec(intel_dp, pipe_config)) {
> +		DRM_DEBUG_KMS("No FEC Support, disabling Compression");
> +		pipe_config->dsc_params.compression_enable = false;
> +	} else {
> +		pipe_config->dsc_params.compression_enable = true;
> +	}

Didn't the previous patch already reject the entire operation?

>  	DRM_DEBUG_KMS("DP DSC computed with Input Bpp = %d "
>  		      "Compressed Bpp = %d Slice Count = %d\n",
>  		      pipe_config->pipe_bpp,
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 9a94c6544bf5..9f701463219b 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -940,6 +940,9 @@ struct intel_crtc_state {
>  		u8 slice_count;
>  	} dsc_params;
>  	struct drm_dsc_config dp_dsc_cfg;
> +
> +	/* Forward Error correction State */
> +	bool fec_enable;
>  };
>  
>  struct intel_crtc {
> -- 
> 2.17.1

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-10-31 21:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31  0:45 [v3 0/7] Forward Error Correction Anusha Srivatsa
2018-10-31  0:45 ` [v4 1/7] i915/dp/fec: Cache the FEC_CAPABLE DPCD register Anusha Srivatsa
2018-11-01 22:31   ` Manasi Navare
2018-11-01 23:02     ` Srivatsa, Anusha
2018-11-01 23:15       ` Manasi Navare
2018-10-31  0:45 ` [v4 2/7] drm/dp/fec: DRM helper for Forward Error Correction Anusha Srivatsa
2018-10-31  0:45 ` [v4 3/7] i915/dp/fec: Check for FEC Support Anusha Srivatsa
2018-10-31 21:01   ` Ville Syrjälä
2018-10-31 23:51     ` Srivatsa, Anusha
2018-10-31  0:45 ` [v4 4/7] i915/dp/fec: Add fec_enable to the crtc state Anusha Srivatsa
2018-10-31 21:03   ` Ville Syrjälä [this message]
2018-10-31  0:45 ` [v4 5/7] drm/i915/fec: Set FEC_READY in FEC_CONFIGURATION Anusha Srivatsa
2018-11-01 22:24   ` Srivatsa, Anusha
2018-10-31  0:45 ` [v4 6/7] i915/dp/fec: Configure the Forward Error Correction bits Anusha Srivatsa
2018-10-31 21:08   ` Ville Syrjälä
2018-10-31 22:34     ` Srivatsa, Anusha
2018-11-02 11:16       ` Ville Syrjälä
2018-11-02 17:54         ` Srivatsa, Anusha
2018-10-31  0:45 ` [v4 7/7] drm/i915/fec: Disable FEC state Anusha Srivatsa
2018-10-31 21:12   ` Ville Syrjälä
2018-11-03  3:44   ` Manasi Navare
2018-10-31 11:00 ` ✗ Fi.CI.BAT: failure for Forward Error Correction (rev4) Patchwork
2018-10-31 21:13 ` [v3 0/7] Forward Error Correction Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181031210325.GU9144@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=anusha.srivatsa@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox