Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Souza, Jose" <jose.souza@intel.com>
To: "Deak, Imre" <imre.deak@intel.com>
Cc: "De Marchi, Lucas" <lucas.demarchi@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915/icl: Fix MG_DP_MODE() register programming
Date: Fri, 19 Apr 2019 16:29:05 +0000	[thread overview]
Message-ID: <e5f990ed2258f69bd2b3ed77a86750ed83677d58.camel@intel.com> (raw)
In-Reply-To: <20190419160444.GB972@ideak-desk.fi.intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 3854 bytes --]

On Fri, 2019-04-19 at 19:04 +0300, Imre Deak wrote:
> On Fri, Apr 19, 2019 at 07:02:10PM +0300, Souza, Jose wrote:
> > On Fri, 2019-04-19 at 10:10 +0300, Imre Deak wrote:
> > > Fix the order of lane, port parameters passed to the register
> > > macro.
> > > 
> > > Note that this was already partly fixed by commit
> > > 37fc7845df7b6 ("drm/i915: Call MG_DP_MODE() macro with the right
> > > parameters order")
> > > 
> > > Fixes: 58106b7d816e1 ("drm/i915: Make MG PHY macros semantically
> > > consistent")
> > > Cc: José Roberto de Souza <jose.souza@intel.com>
> > > Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> > > Cc: Aditya Swarup <aditya.swarup@intel.com>
> > > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/intel_ddi.c | 18 ++++++++----------
> > >  1 file changed, 8 insertions(+), 10 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/intel_ddi.c
> > > b/drivers/gpu/drm/i915/intel_ddi.c
> > > index 24f9106efcc6..f181c26f62fd 100644
> > > --- a/drivers/gpu/drm/i915/intel_ddi.c
> > > +++ b/drivers/gpu/drm/i915/intel_ddi.c
> > > @@ -2905,21 +2905,20 @@ static void
> > > icl_enable_phy_clock_gating(struct intel_digital_port *dig_port)
> > >  	struct drm_i915_private *dev_priv = to_i915(dig_port-
> > > > base.base.dev);
> > >  	enum port port = dig_port->base.port;
> > >  	enum tc_port tc_port = intel_port_to_tc(dev_priv, port);
> > > -	i915_reg_t mg_regs[2] = { MG_DP_MODE(0, port), MG_DP_MODE(1,
> > > port) };
> > >  	u32 val;
> > > -	int i;
> > > +	int ln;
> > >  
> > >  	if (tc_port == PORT_TC_NONE)
> > >  		return;
> > >  
> > > -	for (i = 0; i < ARRAY_SIZE(mg_regs); i++) {
> > > -		val = I915_READ(mg_regs[i]);
> > > +	for (ln = 0; ln < 2; ln++) {
> > > +		val = I915_READ(MG_DP_MODE(ln, port));
> > >  		val |= MG_DP_MODE_CFG_TR2PWR_GATING |
> > >  		       MG_DP_MODE_CFG_TRPWR_GATING |
> > >  		       MG_DP_MODE_CFG_CLNPWR_GATING |
> > >  		       MG_DP_MODE_CFG_DIGPWR_GATING |
> > >  		       MG_DP_MODE_CFG_GAONPWR_GATING;
> > > -		I915_WRITE(mg_regs[i], val);
> > > +		I915_WRITE(MG_DP_MODE(ln, port), val);
> > >  	}
> > >  
> > >  	val = I915_READ(MG_MISC_SUS0(tc_port));
> > > @@ -2938,21 +2937,20 @@ static void
> > > icl_disable_phy_clock_gating(struct intel_digital_port *dig_port)
> > >  	struct drm_i915_private *dev_priv = to_i915(dig_port-
> > > > base.base.dev);
> > >  	enum port port = dig_port->base.port;
> > >  	enum tc_port tc_port = intel_port_to_tc(dev_priv, port);
> > > -	i915_reg_t mg_regs[2] = { MG_DP_MODE(port, 0), MG_DP_MODE(port,
> > > 1) };
> > 
> > I would split this fix from the change dropping mg_regs or at least
> > tell that while you were fixing it you changed the way it reads
> > each MG_DP_MODE line.
> 
> I don't think it's worth a separate patch, since it's a small change
> and quite obvious what and how changed. I can add a note to the
> commit
> message about making things simpler.

I suggested split because this will probably be backported so would be
nice to be as clean as possible but I'm also okay if you add it to the
commit description.

> 
> > 
> > >  	u32 val;
> > > -	int i;
> > > +	int ln;
> > >  
> > >  	if (tc_port == PORT_TC_NONE)
> > >  		return;
> > >  
> > > -	for (i = 0; i < ARRAY_SIZE(mg_regs); i++) {
> > > -		val = I915_READ(mg_regs[i]);
> > > +	for (ln = 0; ln < 2; ln++) {
> > > +		val = I915_READ(MG_DP_MODE(ln, port));
> > >  		val &= ~(MG_DP_MODE_CFG_TR2PWR_GATING |
> > >  			 MG_DP_MODE_CFG_TRPWR_GATING |
> > >  			 MG_DP_MODE_CFG_CLNPWR_GATING |
> > >  			 MG_DP_MODE_CFG_DIGPWR_GATING |
> > >  			 MG_DP_MODE_CFG_GAONPWR_GATING);
> > > -		I915_WRITE(mg_regs[i], val);
> > > +		I915_WRITE(MG_DP_MODE(ln, port), val);
> > >  	}
> > >  
> > >  	val = I915_READ(MG_MISC_SUS0(tc_port));
> 
> 

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-04-19 16:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-19  7:10 [PATCH] drm/i915/icl: Fix MG_DP_MODE() register programming Imre Deak
2019-04-19  7:27 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-04-19  7:46 ` ✓ Fi.CI.BAT: success " Patchwork
2019-04-19  8:55 ` ✓ Fi.CI.IGT: " Patchwork
2019-04-23  8:13   ` Imre Deak
2019-04-19 16:02 ` [PATCH] " Souza, Jose
2019-04-19 16:04   ` Imre Deak
2019-04-19 16:29     ` Souza, Jose [this message]
2019-04-19 17:01       ` Imre Deak
2019-04-22 16:15 ` Lucas De Marchi

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=e5f990ed2258f69bd2b3ed77a86750ed83677d58.camel@intel.com \
    --to=jose.souza@intel.com \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@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