From: Thierry Reding <thierry.reding@gmail.com>
To: Lyude Paul <lyude@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 08/15] drm/dp: Use drm_dp_aux_rd_interval()
Date: Mon, 21 Oct 2019 10:08:08 +0200 [thread overview]
Message-ID: <20191021080808.GC1118266@ulmo> (raw)
In-Reply-To: <46be9f324facaa8afb8dae4bd5fdb16227ff8c67.camel@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 3155 bytes --]
On Fri, Oct 18, 2019 at 05:33:12PM -0400, Lyude Paul wrote:
> This also seems like maybe it should just go into the previous patch?
I suppose they could both be merged, but I think it's better to keep
them separate. In fact, I'm having second thoughts about the new helper
because it doesn't really take into account all the special cases. For
example, the patch below will use the value returned from the helper
independent of context, whereas according to the specification the value
is different if used for clock recovery (100 us) or if it is used for
channel equalization (400 us).
Perhaps a better order would be for the "do not busy loop" patch to go
first and then introduce the new helper and finally use the new helper
(along with the signed -> unsigned change) in a third patch while taking
care of using the right values all the time.
I'll respin these patches and send out the fixes in a v2.
Thierry
> On Tue, 2019-10-15 at 16:35 +0200, Thierry Reding wrote:
> > From: Thierry Reding <treding@nvidia.com>
> >
> > Make use of the newly added drm_dp_aux_rd_interval() helper in existing
> > DP link training helpers.
> >
> > v2: drop stale sentence from commit message (Philipp Zabel)
> >
> > Signed-off-by: Thierry Reding <treding@nvidia.com>
> > ---
> > drivers/gpu/drm/drm_dp_helper.c | 26 +++-----------------------
> > 1 file changed, 3 insertions(+), 23 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_dp_helper.c
> > b/drivers/gpu/drm/drm_dp_helper.c
> > index ad2671d2ee8f..4b66010771fa 100644
> > --- a/drivers/gpu/drm/drm_dp_helper.c
> > +++ b/drivers/gpu/drm/drm_dp_helper.c
> > @@ -122,17 +122,7 @@ EXPORT_SYMBOL(drm_dp_get_adjust_request_pre_emphasis);
> >
> > void drm_dp_link_train_clock_recovery_delay(const u8
> > dpcd[DP_RECEIVER_CAP_SIZE])
> > {
> > - unsigned int rd_interval = dpcd[DP_TRAINING_AUX_RD_INTERVAL] &
> > - DP_TRAINING_AUX_RD_MASK;
> > -
> > - if (rd_interval > 4)
> > - DRM_DEBUG_KMS("AUX interval %u, out of range (max 4)\n",
> > - rd_interval);
> > -
> > - if (rd_interval == 0 || dpcd[DP_DPCD_REV] >= DP_DPCD_REV_14)
> > - rd_interval = 100;
> > - else
> > - rd_interval *= 4 * USEC_PER_MSEC;
> > + unsigned int rd_interval = drm_dp_aux_rd_interval(dpcd);
> >
> > usleep_range(rd_interval, rd_interval * 2);
> > }
> > @@ -140,19 +130,9 @@ EXPORT_SYMBOL(drm_dp_link_train_clock_recovery_delay);
> >
> > void drm_dp_link_train_channel_eq_delay(const u8
> > dpcd[DP_RECEIVER_CAP_SIZE])
> > {
> > - unsigned int rd_interval = dpcd[DP_TRAINING_AUX_RD_INTERVAL] &
> > - DP_TRAINING_AUX_RD_MASK;
> > -
> > - if (rd_interval > 4)
> > - DRM_DEBUG_KMS("AUX interval %u, out of range (max 4)\n",
> > - rd_interval);
> > + unsigned int min = drm_dp_aux_rd_interval(dpcd);
> >
> > - if (rd_interval == 0)
> > - rd_interval = 400;
> > - else
> > - rd_interval *= 4 * USEC_PER_MSEC;
> > -
> > - usleep_range(rd_interval, rd_interval * 2);
> > + usleep_range(min, min * 2);
> > }
> > EXPORT_SYMBOL(drm_dp_link_train_channel_eq_delay);
> >
> --
> Cheers,
> Lyude Paul
>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-10-21 8:08 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-15 14:34 [PATCH 00/15] drm/dp: Move drm_dp_link helpers to Tegra DRM Thierry Reding
2019-10-15 14:34 ` [PATCH 01/15] drm/dp: Sort includes alphabetically Thierry Reding
2019-10-18 21:20 ` Lyude Paul
2019-10-15 14:34 ` [PATCH 02/15] drm/dp: Remove a gratuituous blank line Thierry Reding
2019-10-18 21:20 ` Lyude Paul
2019-10-15 14:34 ` [PATCH 03/15] drm/dp: Add drm_dp_fast_training_cap() helper Thierry Reding
2019-10-18 21:22 ` Lyude Paul
2019-10-15 14:34 ` [PATCH 04/15] drm/dp: Add drm_dp_channel_coding_supported() helper Thierry Reding
2019-10-18 21:22 ` Lyude Paul
2019-10-15 14:34 ` [PATCH 05/15] drm/dp: Add drm_dp_alternate_scrambler_reset_cap() helper Thierry Reding
2019-10-18 21:23 ` Lyude Paul
2019-10-15 14:35 ` [PATCH 06/15] drm/dp: Read AUX read interval from DPCD Thierry Reding
2019-10-18 21:27 ` Lyude Paul
2019-10-21 7:55 ` Thierry Reding
2019-10-15 14:35 ` [PATCH 07/15] drm/dp: Do not busy-loop during link training Thierry Reding
2019-10-18 21:31 ` Lyude Paul
2019-10-21 8:04 ` Thierry Reding
2019-10-15 14:35 ` [PATCH 08/15] drm/dp: Use drm_dp_aux_rd_interval() Thierry Reding
2019-10-18 21:33 ` Lyude Paul
2019-10-21 8:08 ` Thierry Reding [this message]
2019-10-15 14:35 ` [PATCH 09/15] drm/dp: Add helper to get post-cursor adjustments Thierry Reding
2019-10-18 21:34 ` Lyude Paul
2019-10-15 14:35 ` [PATCH 10/15] drm/bridge: analogix-anx78xx: Avoid drm_dp_link helpers Thierry Reding
2019-10-15 14:35 ` [PATCH 11/15] drm/bridge: tc358767: " Thierry Reding
2019-10-15 14:35 ` [PATCH 12/15] drm/bridge: tc358767: Use DP nomenclature Thierry Reding
2019-10-15 14:35 ` [PATCH 13/15] drm/msm: edp: Avoid drm_dp_link helpers Thierry Reding
2019-10-15 14:35 ` [PATCH 14/15] drm/rockchip: " Thierry Reding
2019-10-15 14:35 ` [PATCH 15/15] drm/tegra: Move drm_dp_link helpers to Tegra DRM Thierry Reding
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=20191021080808.GC1118266@ulmo \
--to=thierry.reding@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=lyude@redhat.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.