From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Ander Conselvan de Oliveira
<ander.conselvan.de.oliveira@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 10/12] drm/i915: Allow rate_to_index() to return non-exact matches
Date: Fri, 29 Jul 2016 14:43:23 +0300 [thread overview]
Message-ID: <20160729114323.GB4329@intel.com> (raw)
In-Reply-To: <20160729093527.GC6232@phenom.ffwll.local>
On Fri, Jul 29, 2016 at 11:35:27AM +0200, Daniel Vetter wrote:
> On Thu, Jul 28, 2016 at 05:50:46PM +0300, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Let's make rate_to_index() return the highest rate available that's
> > less than or equal to the rate requested by the caller. The function
> > can then be used to filter out rates higher than a certain maximum
> > rate.
> >
> > Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> > Cc: Jim Bride <jim.bride@linux.intel.com>
> > Cc: Manasi D Navare <manasi.d.navare@intel.com>
> > Cc: Durgadoss R <durgadoss.r@intel.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Not sure what this will be used for, couldn't figure it out looking at
> later patches?
Ah, forgot to mention that part. It seemed like there was a hunk in the
upfront link training patch that could use this, rather than hand
rolling yet another way of looking through the rate array.
> -Daneil
>
> > ---
> > drivers/gpu/drm/i915/intel_dp.c | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> > index 40cae6202160..08d95352ffd6 100644
> > --- a/drivers/gpu/drm/i915/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > @@ -1431,10 +1431,13 @@ static int rate_to_index(int find, const int *rates)
> > int i = 0;
> >
> > for (i = 0; i < DP_MAX_SUPPORTED_RATES; ++i)
> > - if (find == rates[i])
> > + if (find < rates[i])
> > break;
> >
> > - return i;
> > + if (WARN_ON(i == 0))
> > + return 0;
> > +
> > + return i - 1;
> > }
> >
> > int
> > --
> > 2.7.4
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-07-29 11:43 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-28 14:50 [PATCH 00/12] drm/i915: Move DP link retraining to hotplug work etc ville.syrjala
2016-07-28 14:50 ` [PATCH 01/12] drm/i915: Ignore initial lid state for eDP ville.syrjala
2016-07-28 15:47 ` Chris Wilson
2016-07-28 16:01 ` Ville Syrjälä
2016-07-28 16:36 ` Chris Wilson
2016-07-28 16:48 ` Ville Syrjälä
2016-07-28 14:50 ` [PATCH 02/12] drm/i915: Read PSR caps/intermediate freqs/etc. only once on eDP ville.syrjala
2016-07-28 17:30 ` Chris Wilson
2016-07-28 17:45 ` Ville Syrjälä
2016-07-29 13:52 ` [PATCH v3 " ville.syrjala
2016-07-28 14:50 ` [PATCH 03/12] drm/i915: Avoid mixing up SST and MST in DDI setup ville.syrjala
2016-07-29 9:16 ` Daniel Vetter
2016-07-29 9:55 ` Ville Syrjälä
2016-08-02 14:20 ` Daniel Vetter
2016-08-01 9:24 ` Maarten Lankhorst
2016-07-28 14:50 ` [PATCH 04/12] drm/i915: Reject mixing MST and SST/HDMI on the same digital port ville.syrjala
2016-07-29 9:19 ` Daniel Vetter
2016-07-29 11:28 ` Ville Syrjälä
2016-08-02 14:22 ` Daniel Vetter
2016-08-01 9:28 ` Maarten Lankhorst
2016-07-28 14:50 ` [PATCH 05/12] drm/i915: Track active streams also for DP SST ville.syrjala
2016-07-29 9:22 ` Daniel Vetter
2016-07-29 11:36 ` Ville Syrjälä
2016-07-29 18:36 ` Jim Bride
2016-08-02 14:28 ` Daniel Vetter
2016-07-28 14:50 ` [PATCH 06/12] drm/i915: Allow MST sinks to work even if drm_probe_ddc() fails ville.syrjala
2016-07-29 9:29 ` Daniel Vetter
2016-07-29 11:41 ` Ville Syrjälä
2016-07-29 13:51 ` [PATCH v2 " ville.syrjala
2016-07-28 14:50 ` [PATCH 07/12] drm/i915: Move DP link retraining into intel_dp_detect() ville.syrjala
2016-07-28 19:48 ` Manasi Navare
2016-07-28 20:15 ` Ville Syrjälä
2016-07-29 0:36 ` Manasi Navare
2016-07-29 9:52 ` Ville Syrjälä
2016-07-29 21:42 ` Manasi Navare
2016-07-29 21:45 ` Manasi Navare
2016-08-01 10:03 ` Ville Syrjälä
2016-07-29 20:37 ` Jim Bride
2016-07-28 14:50 ` [PATCH 08/12] drm/i915: Skip dpcd/edid read unless there was a long hpd ville.syrjala
2016-07-28 15:38 ` Chris Wilson
2016-07-28 15:44 ` Ville Syrjälä
2016-07-28 14:50 ` [PATCH 09/12] drm/i915: Remove useless rate_to_index() usage ville.syrjala
2016-07-29 9:33 ` Daniel Vetter
2016-07-28 14:50 ` [PATCH 10/12] drm/i915: Allow rate_to_index() to return non-exact matches ville.syrjala
2016-07-29 9:35 ` Daniel Vetter
2016-07-29 11:43 ` Ville Syrjälä [this message]
2016-07-28 14:50 ` [PATCH 11/12] drm/i915: Don't try to ack sink irqs when there are none ville.syrjala
2016-07-29 9:38 ` Daniel Vetter
2016-07-28 14:50 ` [RFC][PATCH 12/12] drm/i915: Add encoder .sync_state() hook ville.syrjala
2016-07-29 9:42 ` Daniel Vetter
2016-07-28 15:39 ` ✗ Ro.CI.BAT: failure for drm/i915: Move DP link retraining to hotplug work etc Patchwork
2016-07-29 14:27 ` ✗ Ro.CI.BAT: failure for drm/i915: Move DP link retraining to hotplug work etc. (rev3) Patchwork
2016-08-04 12:35 ` Ville Syrjälä
2016-08-04 13:08 ` [PATCH 00/12] drm/i915: Move DP link retraining to hotplug work etc 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=20160729114323.GB4329@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=ander.conselvan.de.oliveira@intel.com \
--cc=daniel@ffwll.ch \
--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