From: "Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>
To: "Navare, Manasi D" <manasi.d.navare@intel.com>
Cc: "Vetter, Daniel" <daniel.vetter@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 4/5] drm/i915; Add a function to return index of link rate
Date: Tue, 25 Oct 2016 06:33:03 +0000 [thread overview]
Message-ID: <1477378163.19344.5.camel@dk-H97M-D3H> (raw)
In-Reply-To: <1477093543-11622-5-git-send-email-manasi.d.navare@intel.com>
On Fri, 2016-10-21 at 16:45 -0700, Manasi Navare wrote:
> This is required to return the index of link rate into
> common_rates array. This gets used to retry the link
> training at lower link rate.
>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
> ---
> drivers/gpu/drm/i915/intel_dp.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index c499ec1..c192e18 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -288,6 +288,21 @@ static int intel_dp_common_rates(struct intel_dp *intel_dp,
> common_rates);
> }
>
> +static int intel_dp_link_rate_index(struct intel_dp *intel_dp,
> + int *common_rates, int link_rate)
> +{
> + int common_len;
> + int index;
> +
> + common_len = intel_dp_common_rates(intel_dp, common_rates);
> + for (index = 0; index < common_len; index++) {
Running the loop in the opposite direction will eliminate the
unnecessary array index computations.
> + if (link_rate == common_rates[common_len - index - 1])
> + return common_len - index - 1;
> + }
> +
> + return -1;
> +}
> +
> static enum drm_mode_status
> intel_dp_mode_valid(struct drm_connector *connector,
> struct drm_display_mode *mode)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-10-25 6:33 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-21 23:45 [PATCH 0/5] Handle link training failure for DDI platforms Manasi Navare
2016-10-21 23:45 ` [PATCH 1/5] drm: Add atomic helper to redo a modeset on current mode Manasi Navare
2016-10-22 8:47 ` Daniel Vetter
2016-10-22 14:01 ` [Intel-gfx] " Daniel Vetter
2016-10-22 14:46 ` Ville Syrjälä
2016-10-24 6:00 ` Daniel Vetter
2016-10-24 6:12 ` Manasi Navare
2016-10-24 6:33 ` Daniel Vetter
2016-10-24 7:00 ` Manasi Navare
2016-10-24 7:12 ` Daniel Vetter
2016-10-24 18:38 ` [Intel-gfx] " Sean Paul
2016-10-25 6:35 ` Daniel Vetter
2016-10-24 22:08 ` Manasi Navare
2016-10-25 6:40 ` [Intel-gfx] " Daniel Vetter
2016-10-25 12:09 ` Jani Nikula
2016-10-25 22:28 ` Manasi Navare
2016-10-25 22:38 ` Rodrigo Vivi
2016-10-21 23:45 ` [PATCH 2/5] drm: Define a work struct for scheduling a uevent for modeset retry Manasi Navare
2016-10-22 8:48 ` Daniel Vetter
2016-10-25 6:28 ` Manasi Navare
2016-10-25 6:30 ` Pandiyan, Dhinakaran
2016-10-25 6:45 ` [Intel-gfx] " Daniel Vetter
2016-10-21 23:45 ` [PATCH 3/5] drm/i915: Change the placement of some static functions in intel_dp.c Manasi Navare
2016-10-21 23:45 ` [PATCH 4/5] drm/i915; Add a function to return index of link rate Manasi Navare
2016-10-25 6:33 ` Pandiyan, Dhinakaran [this message]
2016-10-21 23:45 ` [PATCH 5/5] drm/i915: Link Rate fallback on Link training failure Manasi Navare
2016-10-24 17:53 ` Jim Bride
2016-10-25 6:23 ` Pandiyan, Dhinakaran
2016-10-25 18:32 ` Manasi Navare
2016-10-25 12:17 ` Jani Nikula
2016-10-25 18:00 ` Jim Bride
2016-10-25 18:37 ` Manasi Navare
2016-10-22 0:16 ` ✗ Fi.CI.BAT: warning for Handle link training failure for DDI platforms 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=1477378163.19344.5.camel@dk-H97M-D3H \
--to=dhinakaran.pandiyan@intel.com \
--cc=daniel.vetter@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=manasi.d.navare@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox