From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Subject: Re: [PATCH 1/3] drm/i915/dp: abstract rate array length limiting
Date: Thu, 1 Feb 2018 07:12:47 -0800 [thread overview]
Message-ID: <20180201151247.ejqrliosqehpncc7@intel.com> (raw)
In-Reply-To: <40f37f08cad33234cd86337d39e823ac6e55805f.1517482774.git.jani.nikula@intel.com>
On Thu, Feb 01, 2018 at 11:03:41AM +0000, Jani Nikula wrote:
> This will be useful later on. Also move the functions around to not need
> forward declarations in subsequent patches. No functional changes.
>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/intel_dp.c | 38 ++++++++++++++++++++++----------------
> 1 file changed, 22 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 03d86ff9b805..3c1c11c1cd30 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -157,6 +157,28 @@ static void intel_dp_set_sink_rates(struct intel_dp *intel_dp)
> intel_dp->num_sink_rates = i;
> }
>
> +/* Get length of rates array potentially limited by max_rate. */
> +static int intel_dp_rate_limit_len(const int *rates, int len, int max_rate)
> +{
> + int i;
> +
> + /* Limit results by potentially reduced max rate */
> + for (i = 0; i < len; i++) {
> + if (rates[len - i - 1] <= max_rate)
> + return len - i;
> + }
> +
> + return 0;
> +}
> +
> +/* Get length of common rates array potentially limited by max_rate. */
> +static int intel_dp_common_len_rate_limit(const struct intel_dp *intel_dp,
> + int max_rate)
> +{
> + return intel_dp_rate_limit_len(intel_dp->common_rates,
> + intel_dp->num_common_rates, max_rate);
> +}
> +
> /* Theoretical max between source and sink */
> static int intel_dp_max_common_rate(struct intel_dp *intel_dp)
> {
> @@ -328,22 +350,6 @@ static void intel_dp_set_common_rates(struct intel_dp *intel_dp)
> }
> }
>
> -/* get length of common rates potentially limited by max_rate */
> -static int intel_dp_common_len_rate_limit(struct intel_dp *intel_dp,
> - int max_rate)
> -{
> - const int *common_rates = intel_dp->common_rates;
> - int i, common_len = intel_dp->num_common_rates;
> -
> - /* Limit results by potentially reduced max rate */
> - for (i = 0; i < common_len; i++) {
> - if (common_rates[common_len - i - 1] <= max_rate)
> - return common_len - i;
> - }
> -
> - return 0;
> -}
> -
> static bool intel_dp_link_params_valid(struct intel_dp *intel_dp, int link_rate,
> uint8_t lane_count)
> {
> --
> 2.11.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-02-01 15:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-01 11:03 [PATCH 0/3] drm/i915/dp: refactoring + respect vbt max dp rate Jani Nikula
2018-02-01 11:03 ` [PATCH 1/3] drm/i915/dp: abstract rate array length limiting Jani Nikula
2018-02-01 15:12 ` Rodrigo Vivi [this message]
2018-02-01 11:03 ` [PATCH 2/3] drm/i915/dp: clean up source rate limiting for cnl Jani Nikula
2018-02-01 15:13 ` Rodrigo Vivi
2018-02-01 11:03 ` [PATCH 3/3] drm/i915/dp: limit DP link rate based on VBT on CNL+ Jani Nikula
2018-02-01 13:24 ` Ville Syrjälä
2018-02-02 8:25 ` Jani Nikula
2018-02-01 15:14 ` Rodrigo Vivi
2018-02-01 11:32 ` ✓ Fi.CI.BAT: success for drm/i915/dp: refactoring + respect vbt max dp rate Patchwork
2018-02-01 14:10 ` ✓ Fi.CI.IGT: " Patchwork
2018-02-01 15:15 ` [PATCH 0/3] " Rodrigo Vivi
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=20180201151247.ejqrliosqehpncc7@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=dhinakaran.pandiyan@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.