All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manasi Navare <manasi.d.navare@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, rodrigo.vivi@intel.com
Subject: Re: [PATCH 5/7] drm/i915/dp: group link config limits in a struct
Date: Wed, 25 Apr 2018 12:07:41 -0700	[thread overview]
Message-ID: <20180425190741.GI31618@intel.com> (raw)
In-Reply-To: <954d80e8a412c177fd25f56c2a7599f3dce00b5b.1522938790.git.jani.nikula@intel.com>

On Thu, Apr 05, 2018 at 05:39:03PM +0300, Jani Nikula wrote:
> Also use same min/max model for bpp, and adjust debug logging while at
> it.
> 

Reviewed-by: Manasi Navare <manasi.d.navare@intel.com>

> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 57 ++++++++++++++++++++++++-----------------
>  1 file changed, 33 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index dd42e0422af6..3c5fbdf42b9b 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -1647,6 +1647,12 @@ void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,
>  	}
>  }
>  
> +struct link_config_limits {
> +	int min_clock, max_clock;
> +	int min_lane_count, max_lane_count;
> +	int min_bpp, max_bpp;
> +};
> +
>  static int intel_dp_compute_bpp(struct intel_dp *intel_dp,
>  				struct intel_crtc_state *pipe_config)
>  {
> @@ -1704,21 +1710,25 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
>  {
>  	struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;
>  	struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
> -	int lane_count, clock;
> -	int min_lane_count = 1;
> -	int max_lane_count = intel_dp_max_lane_count(intel_dp);
> -	int min_clock = 0;
> -	int max_clock;
> -	int bpp, mode_rate;
> -	int link_avail, link_clock;
> +	struct link_config_limits limits;
> +	int bpp, clock, lane_count;
> +	int mode_rate, link_avail, link_clock;
>  	int common_len;
> +
>  	common_len = intel_dp_common_len_rate_limit(intel_dp,
>  						    intel_dp->max_link_rate);
>  
>  	/* No common link rates between source and sink */
>  	WARN_ON(common_len <= 0);
>  
> -	max_clock = common_len - 1;
> +	limits.min_clock = 0;
> +	limits.max_clock = common_len - 1;
> +
> +	limits.min_lane_count = 1;
> +	limits.max_lane_count = intel_dp_max_lane_count(intel_dp);
> +
> +	limits.min_bpp = 6 * 3;
> +	limits.max_bpp = intel_dp_compute_bpp(intel_dp, pipe_config);
>  
>  	/* Use values requested by Compliance Test Request */
>  	if (intel_dp->compliance.test_type == DP_TEST_LINK_TRAINING) {
> @@ -1733,18 +1743,11 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
>  						    intel_dp->num_common_rates,
>  						    intel_dp->compliance.test_link_rate);
>  			if (index >= 0)
> -				min_clock = max_clock = index;
> -			min_lane_count = max_lane_count = intel_dp->compliance.test_lane_count;
> +				limits.min_clock = limits.max_clock = index;
> +			limits.min_lane_count = limits.max_lane_count = intel_dp->compliance.test_lane_count;
>  		}
>  	}
> -	DRM_DEBUG_KMS("DP link computation with max lane count %i "
> -		      "max bw %d pixel clock %iKHz\n",
> -		      max_lane_count, intel_dp->common_rates[max_clock],
> -		      adjusted_mode->crtc_clock);
>  
> -	/* Walk through all bpp values. Luckily they're all nicely spaced with 2
> -	 * bpc in between. */
> -	bpp = intel_dp_compute_bpp(intel_dp, pipe_config);
>  	if (intel_dp_is_edp(intel_dp)) {
>  		/*
>  		 * Use the maximum clock and number of lanes the eDP panel
> @@ -1753,18 +1756,24 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
>  		 * configuration, and typically these values correspond to the
>  		 * native resolution of the panel.
>  		 */
> -		min_lane_count = max_lane_count;
> -		min_clock = max_clock;
> +		limits.min_lane_count = limits.max_lane_count;
> +		limits.min_clock = limits.max_clock;
>  	}
>  
> -	for (; bpp >= 6*3; bpp -= 2*3) {
> +	DRM_DEBUG_KMS("DP link computation with max lane count %i "
> +		      "max rate %d max bpp %d pixel clock %iKHz\n",
> +		      limits.max_lane_count,
> +		      intel_dp->common_rates[limits.max_clock],
> +		      limits.max_bpp, adjusted_mode->crtc_clock);
> +
> +	for (bpp = limits.max_bpp; bpp >= limits.min_bpp; bpp -= 2 * 3) {
>  		mode_rate = intel_dp_link_required(adjusted_mode->crtc_clock,
>  						   bpp);
>  
> -		for (clock = min_clock; clock <= max_clock; clock++) {
> -			for (lane_count = min_lane_count;
> -				lane_count <= max_lane_count;
> -				lane_count <<= 1) {
> +		for (clock = limits.min_clock; clock <= limits.max_clock; clock++) {
> +			for (lane_count = limits.min_lane_count;
> +			     lane_count <= limits.max_lane_count;
> +			     lane_count <<= 1) {
>  
>  				link_clock = intel_dp->common_rates[clock];
>  				link_avail = intel_dp_max_data_rate(link_clock,
> -- 
> 2.11.0
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-04-25 19:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05 14:38 [PATCH 0/7] drm/i915/dp: link config compute refactoring Jani Nikula
2018-04-05 14:38 ` [PATCH 1/7] drm/i915/dp: remove stale comment about bw constants Jani Nikula
2018-04-05 17:10   ` Rodrigo Vivi
2018-04-05 18:46   ` Manasi Navare
2018-04-05 14:39 ` [PATCH 2/7] drm/i915/dp: move link_bw and rate_select debugging where used Jani Nikula
2018-04-05 17:22   ` Rodrigo Vivi
2018-04-05 19:03     ` Manasi Navare
2018-04-05 14:39 ` [PATCH 3/7] drm/i915/dp: abstract dp link config computation from the rest Jani Nikula
2018-04-25 19:03   ` Manasi Navare
2018-04-05 14:39 ` [PATCH 4/7] drm/i915/dp: move eDP VBT bpp claming code to intel_dp_compute_bpp() Jani Nikula
2018-04-05 19:44   ` Manasi Navare
2018-04-05 14:39 ` [PATCH 5/7] drm/i915/dp: group link config limits in a struct Jani Nikula
2018-04-25 19:07   ` Manasi Navare [this message]
2018-04-05 14:39 ` [PATCH 6/7] drm/i915/dp: abstract link config selection Jani Nikula
2018-04-05 19:55   ` Manasi Navare
2018-04-09 14:12     ` Jani Nikula
2018-04-09 18:22       ` Manasi Navare
2018-04-26  1:43       ` Manasi Navare
2018-04-05 14:39 ` [PATCH 7/7] drm/i915/dp: fix compliance test adjustments Jani Nikula
2018-04-05 19:59   ` Manasi Navare
2018-04-05 14:49 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dp: link config compute refactoring Patchwork
2018-04-05 15:06 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-05 18:35 ` ✓ Fi.CI.IGT: " Patchwork

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=20180425190741.GI31618@intel.com \
    --to=manasi.d.navare@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=rodrigo.vivi@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.