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
Subject: Re: [PATCH 3/3] drm/i915/dp: limit sink rates based on rate
Date: Tue, 10 Oct 2017 11:38:40 -0700	[thread overview]
Message-ID: <20171010183839.GD30055@intel.com> (raw)
In-Reply-To: <20171009092959.29021-3-jani.nikula@intel.com>

On Mon, Oct 09, 2017 at 12:29:59PM +0300, Jani Nikula wrote:
> Get rid of redundant intel_dp_num_rates(). We can simply look at the
> rate and limit based on that.
> 
> Cc: Manasi Navare <manasi.d.navare@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

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

Manasi

> ---
>  drivers/gpu/drm/i915/intel_dp.c | 26 +++++++-------------------
>  1 file changed, 7 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 09d75df497c0..b0f446b68f42 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -137,32 +137,20 @@ static void vlv_steal_power_sequencer(struct drm_device *dev,
>  				      enum pipe pipe);
>  static void intel_dp_unset_edid(struct intel_dp *intel_dp);
>  
> -static int intel_dp_num_rates(u8 link_bw_code)
> -{
> -	switch (link_bw_code) {
> -	default:
> -		WARN(1, "invalid max DP link bw val %x, using 1.62Gbps\n",
> -		     link_bw_code);
> -	case DP_LINK_BW_1_62:
> -		return 1;
> -	case DP_LINK_BW_2_7:
> -		return 2;
> -	case DP_LINK_BW_5_4:
> -		return 3;
> -	}
> -}
> -
>  /* update sink rates from dpcd */
>  static void intel_dp_set_sink_rates(struct intel_dp *intel_dp)
>  {
> -	int i, num_rates;
> +	int i, max_rate;
>  
> -	num_rates = intel_dp_num_rates(intel_dp->dpcd[DP_MAX_LINK_RATE]);
> +	max_rate = drm_dp_bw_code_to_link_rate(intel_dp->dpcd[DP_MAX_LINK_RATE]);
>  
> -	for (i = 0; i < num_rates; i++)
> +	for (i = 0; i < ARRAY_SIZE(default_rates); i++) {
> +		if (default_rates[i] > max_rate)
> +			break;
>  		intel_dp->sink_rates[i] = default_rates[i];
> +	}
>  
> -	intel_dp->num_sink_rates = num_rates;
> +	intel_dp->num_sink_rates = i;
>  }
>  
>  /* Theoretical max between source and sink */
> -- 
> 2.11.0
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-10-10 18:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09  9:29 [PATCH 1/3] drm/dp: WARN about invalid/unknown link rates and bw codes Jani Nikula
2017-10-09  9:29 ` [PATCH 2/3] drm/i915/dp: centralize max source rate conditions more Jani Nikula
2017-10-10 18:35   ` Manasi Navare
2017-10-09  9:29 ` [PATCH 3/3] drm/i915/dp: limit sink rates based on rate Jani Nikula
2017-10-10 18:38   ` Manasi Navare [this message]
2017-10-09 10:03 ` ✗ Fi.CI.BAT: warning for series starting with [1/3] drm/dp: WARN about invalid/unknown link rates and bw codes Patchwork
2017-10-09 10:32 ` [PATCH 1/3] " Thierry Reding
2017-10-11 16:03   ` Jani Nikula
2017-10-09 11:40 ` ✓ Fi.CI.BAT: success for series starting with [1/3] " Patchwork
2017-10-09 13:41 ` ✗ Fi.CI.IGT: failure " Patchwork
2017-10-11 19:11   ` Jani Nikula
2017-10-09 18:10 ` [PATCH 1/3] " Deucher, Alexander
2017-10-10 18:19 ` Manasi Navare

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=20171010183839.GD30055@intel.com \
    --to=manasi.d.navare@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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.