From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rodrigo Vivi Subject: Re: [PATCH 21/89] drm/i915/skl: Implement the get_aux_clock_divider() DP vfunc Date: Mon, 22 Sep 2014 12:33:48 -0700 Message-ID: References: <1409830075-11139-1-git-send-email-damien.lespiau@intel.com> <1409830075-11139-22-git-send-email-damien.lespiau@intel.com> <20140922132116.GE10951@strange.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0479789553==" Return-path: Received: from mail-we0-f171.google.com (mail-we0-f171.google.com [74.125.82.171]) by gabe.freedesktop.org (Postfix) with ESMTP id 20F7C6E4AC for ; Mon, 22 Sep 2014 12:33:49 -0700 (PDT) Received: by mail-we0-f171.google.com with SMTP id k48so3475791wev.2 for ; Mon, 22 Sep 2014 12:33:49 -0700 (PDT) In-Reply-To: <20140922132116.GE10951@strange.ger.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Damien Lespiau Cc: intel-gfx List-Id: intel-gfx@lists.freedesktop.org --===============0479789553== Content-Type: multipart/alternative; boundary=047d7ba97a80abcc2f0503ac8739 --047d7ba97a80abcc2f0503ac8739 Content-Type: text/plain; charset=UTF-8 Thanks, so feel free to use: Reviewed-by: Rodrigo Vivi On Mon, Sep 22, 2014 at 6:21 AM, Damien Lespiau wrote: > On Tue, Sep 16, 2014 at 06:12:04PM -0700, Rodrigo Vivi wrote: > > I believe this patch should remove the gen9 part of > > ilk_get_aux_clock_divider. > > The previous patch changing ilk_get_aux_clock_divider() got removed > entirely. > > > Also there it just returns 0, but here it returns 0 or 1 depending on > the > > index. > > This also is incoherent with the commit description. > > Yes, when the index is 0, we need to return a non 0 value (chose 1) to > have the code using this vfunc loop once. Then, when the index is > incremented, we return 0 to stop the loop. > > -- > Damien > > > On Thu, Sep 4, 2014 at 4:26 AM, Damien Lespiau < > damien.lespiau@intel.com> > > wrote: > > > > We need to provide a vfunc that will make the code in > intel_dp_aux_ch() > > loop once to start the AUX transaction. The return value (clock > divider) > > is unused on SKL, so just return 1. > > > > Signed-off-by: Damien Lespiau > > --- > > drivers/gpu/drm/i915/intel_dp.c | 14 +++++++++++++- > > 1 file changed, 13 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/i915/intel_dp.c > > b/drivers/gpu/drm/i915/intel_dp.c > > index a95fb47..4560ced 100644 > > --- a/drivers/gpu/drm/i915/intel_dp.c > > +++ b/drivers/gpu/drm/i915/intel_dp.c > > @@ -489,6 +489,16 @@ static uint32_t > vlv_get_aux_clock_divider(struct > > intel_dp *intel_dp, int index) > > return index ? 0 : 100; > > } > > > > +static uint32_t skl_get_aux_clock_divider(struct intel_dp > *intel_dp, > > int index) > > +{ > > + /* > > + * SKL doesn't need us to program the AUX clock divider > > (Hardware will > > + * derive the clock from CDCLK automatically). We still > > implement the > > + * get_aux_clock_divider vfunc to plug-in into the existing > > code. > > + */ > > + return index ? 0 : 1; > > +} > > + > > static uint32_t i9xx_get_aux_send_ctl(struct intel_dp *intel_dp, > > bool has_aux_irq, > > int send_bytes, > > @@ -4726,7 +4736,9 @@ intel_dp_init_connector(struct > intel_digital_port > > *intel_dig_port, > > int type; > > > > /* intel_dp vfuncs */ > > - if (IS_VALLEYVIEW(dev)) > > + if (INTEL_INFO(dev)->gen >= 9) > > + intel_dp->get_aux_clock_divider = > > skl_get_aux_clock_divider; > > + else if (IS_VALLEYVIEW(dev)) > > intel_dp->get_aux_clock_divider = > > vlv_get_aux_clock_divider; > > else if (IS_HASWELL(dev) || IS_BROADWELL(dev)) > > intel_dp->get_aux_clock_divider = > > hsw_get_aux_clock_divider; > > -- > > 1.8.3.1 > > > > _______________________________________________ > > Intel-gfx mailing list > > Intel-gfx@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx > > > > -- > > Rodrigo Vivi > > Blog: http://blog.vivi.eng.br > > > -- Rodrigo Vivi Blog: http://blog.vivi.eng.br --047d7ba97a80abcc2f0503ac8739 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks, so feel free to use:

Reviewed-b= y: Rodrigo Vivi <rodrigo.vivi@= intel.com>

On Mon, Sep 22, 2014 at 6:21 AM, Damien Lespiau <damien= .lespiau@intel.com> wrote:
= On Tue, Sep 16, 2014 at 06:12:04PM -0700, Rodrigo Vivi wro= te:
>=C2=A0 =C2=A0 I believe this patch should remove the gen9 part of
>=C2=A0 =C2=A0 ilk_get_aux_clock_divider.

The previous patch changing ilk_get_aux_clock_divider() got removed<= br> entirely.

>=C2=A0 =C2=A0 Also there it just returns 0, but here it returns 0 or 1 = depending on the
>=C2=A0 =C2=A0 index.
>=C2=A0 =C2=A0 This also is incoherent with the commit description.

Yes, when the index is 0, we need to return a non 0 value (chose 1) = to
have the code using this vfunc loop once. Then, when the index is
incremented, we return 0 to stop the loop.

--
Damien

>=C2=A0 =C2=A0 On Thu, Sep 4, 2014 at 4:26 AM, Damien Lespiau <damien.lespiau@intel.com>
>=C2=A0 =C2=A0 wrote:
>
>=C2=A0 =C2=A0 =C2=A0 We need to provide a vfunc that will make the code= in intel_dp_aux_ch()
>=C2=A0 =C2=A0 =C2=A0 loop once to start the AUX transaction. The return= value (clock divider)
>=C2=A0 =C2=A0 =C2=A0 is unused on SKL, so just return 1.
>
>=C2=A0 =C2=A0 =C2=A0 Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
>=C2=A0 =C2=A0 =C2=A0 ---
>=C2=A0 =C2=A0 =C2=A0 =C2=A0drivers/gpu/drm/i915/intel_dp.c | 14 +++++++= ++++++-
>=C2=A0 =C2=A0 =C2=A0 =C2=A01 file changed, 13 insertions(+), 1 deletion= (-)
>
>=C2=A0 =C2=A0 =C2=A0 diff --git a/drivers/gpu/drm/i915/intel_dp.c
>=C2=A0 =C2=A0 =C2=A0 b/drivers/gpu/drm/i915/intel_dp.c
>=C2=A0 =C2=A0 =C2=A0 index a95fb47..4560ced 100644
>=C2=A0 =C2=A0 =C2=A0 --- a/drivers/gpu/drm/i915/intel_dp.c
>=C2=A0 =C2=A0 =C2=A0 +++ b/drivers/gpu/drm/i915/intel_dp.c
>=C2=A0 =C2=A0 =C2=A0 @@ -489,6 +489,16 @@ static uint32_t vlv_get_aux_c= lock_divider(struct
>=C2=A0 =C2=A0 =C2=A0 intel_dp *intel_dp, int index)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return index ? 0 : 100= ;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
>=C2=A0 =C2=A0 =C2=A0 +static uint32_t skl_get_aux_clock_divider(struct = intel_dp *intel_dp,
>=C2=A0 =C2=A0 =C2=A0 int index)
>=C2=A0 =C2=A0 =C2=A0 +{
>=C2=A0 =C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0/*
>=C2=A0 =C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0 * SKL doesn't nee= d us to program the AUX clock divider
>=C2=A0 =C2=A0 =C2=A0 (Hardware will
>=C2=A0 =C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0 * derive the clock fr= om CDCLK automatically). We still
>=C2=A0 =C2=A0 =C2=A0 implement the
>=C2=A0 =C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0 * get_aux_clock_divid= er vfunc to plug-in into the existing
>=C2=A0 =C2=A0 =C2=A0 code.
>=C2=A0 =C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0 */
>=C2=A0 =C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0return index ? 0 : 1;<= br> >=C2=A0 =C2=A0 =C2=A0 +}
>=C2=A0 =C2=A0 =C2=A0 +
>=C2=A0 =C2=A0 =C2=A0 =C2=A0static uint32_t i9xx_get_aux_send_ctl(struct= intel_dp *intel_dp,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 bool has_aux_irq,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 int send_bytes,
>=C2=A0 =C2=A0 =C2=A0 @@ -4726,7 +4736,9 @@ intel_dp_init_connector(stru= ct intel_digital_port
>=C2=A0 =C2=A0 =C2=A0 *intel_dig_port,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int type;
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* intel_dp vfuncs */<= br> >=C2=A0 =C2=A0 =C2=A0 -=C2=A0 =C2=A0 =C2=A0 =C2=A0if (IS_VALLEYVIEW(dev)= )
>=C2=A0 =C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0if (INTEL_INFO(dev)-&g= t;gen >=3D 9)
>=C2=A0 =C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0intel_dp->get_aux_clock_divider =3D
>=C2=A0 =C2=A0 =C2=A0 skl_get_aux_clock_divider;
>=C2=A0 =C2=A0 =C2=A0 +=C2=A0 =C2=A0 =C2=A0 =C2=A0else if (IS_VALLEYVIEW= (dev))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 intel_dp->get_aux_clock_divider =3D
>=C2=A0 =C2=A0 =C2=A0 vlv_get_aux_clock_divider;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else if (IS_HASWELL(de= v) || IS_BROADWELL(dev))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 intel_dp->get_aux_clock_divider =3D
>=C2=A0 =C2=A0 =C2=A0 hsw_get_aux_clock_divider;
>=C2=A0 =C2=A0 =C2=A0 --
>=C2=A0 =C2=A0 =C2=A0 1.8.3.1
>
>=C2=A0 =C2=A0 =C2=A0 _______________________________________________ >=C2=A0 =C2=A0 =C2=A0 Intel-gfx mailing list
>=C2=A0 =C2=A0 =C2=A0 Intel-gfx@lists.freedesktop.org
>=C2=A0 =C2=A0 =C2=A0 http://lists.freedesktop.org/mailman/li= stinfo/intel-gfx
>
>=C2=A0 =C2=A0 --
>=C2=A0 =C2=A0 Rodrigo Vivi
>=C2=A0 =C2=A0 Blog: http://blog.vivi.eng.br
>



--
=
Rodrigo Vivi
=C2=A0
--047d7ba97a80abcc2f0503ac8739-- --===============0479789553== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0479789553==--