public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Mika Kahola <mika.kahola@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Generalize transcoder looping
Date: Thu, 09 Nov 2017 09:37:56 +0200	[thread overview]
Message-ID: <1510213076.3274.211.camel@intel.com> (raw)
In-Reply-To: <20171108195401.GH10981@intel.com>

On Wed, 2017-11-08 at 21:54 +0200, Ville Syrjälä wrote:
> On Mon, Nov 06, 2017 at 03:29:45PM +0200, Mika Kahola wrote:
> > 
> > To make looping through transcoders in intel_ddi.c more generic,
> > let's switch
> > to use 'for_each_pipe()' macro to do this.
> > 
> > v2: Add a notion that we are dealing with transcoders instead of
> > pipes (Jani)
> > 
> > Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_ddi.c | 11 +++++++----
> >  1 file changed, 7 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_ddi.c
> > b/drivers/gpu/drm/i915/intel_ddi.c
> > index ace674c..5e83785 100644
> > --- a/drivers/gpu/drm/i915/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/intel_ddi.c
> > @@ -1681,8 +1681,9 @@ bool intel_ddi_get_hw_state(struct
> > intel_encoder *encoder,
> >  	struct drm_device *dev = encoder->base.dev;
> >  	struct drm_i915_private *dev_priv = to_i915(dev);
> >  	enum port port = encoder->port;
> > +	enum pipe p;
> > +	enum transcoder cpu_transcoder;
> cpu_transcoder isn't needed outside the loop. So we can tighten the
> scope a bit.
Thanks for the review! I'll make the change and respin it for CI.
 
> 
> With that
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> > 
> >  	u32 tmp;
> > -	int i;
> >  	bool ret;
> >  
> >  	if (!intel_display_power_get_if_enabled(dev_priv,
> > @@ -1717,15 +1718,17 @@ bool intel_ddi_get_hw_state(struct
> > intel_encoder *encoder,
> >  		goto out;
> >  	}
> >  
> > -	for (i = TRANSCODER_A; i <= TRANSCODER_C; i++) {
> > -		tmp = I915_READ(TRANS_DDI_FUNC_CTL(i));
> > +	for_each_pipe(dev_priv, p) {
> > +		cpu_transcoder = (enum transcoder) p;
> > +
> > +		tmp =
> > I915_READ(TRANS_DDI_FUNC_CTL(cpu_transcoder));
> >  
> >  		if ((tmp & TRANS_DDI_PORT_MASK) ==
> > TRANS_DDI_SELECT_PORT(port)) {
> >  			if ((tmp & TRANS_DDI_MODE_SELECT_MASK) ==
> >  			    TRANS_DDI_MODE_SELECT_DP_MST)
> >  				goto out;
> >  
> > -			*pipe = i;
> > +			*pipe = p;
> >  			ret = true;
> >  
> >  			goto out;
> > -- 
> > 2.7.4
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
-- 
Mika Kahola - Intel OTC

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

      reply	other threads:[~2017-11-09  7:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-06 13:29 [PATCH v2] drm/i915: Generalize transcoder looping Mika Kahola
2017-11-06 14:07 ` ✗ Fi.CI.BAT: failure for drm/i915: Generalize transcoder looping (rev2) Patchwork
2017-11-08 12:30 ` ✓ Fi.CI.BAT: success " Patchwork
2017-11-08 19:54 ` [PATCH v2] drm/i915: Generalize transcoder looping Ville Syrjälä
2017-11-09  7:37   ` Mika Kahola [this message]

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=1510213076.3274.211.camel@intel.com \
    --to=mika.kahola@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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