intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: mika.kahola@intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Generalize transcoder looping
Date: Thu, 02 Nov 2017 13:18:09 +0200	[thread overview]
Message-ID: <87wp39c4jy.fsf@intel.com> (raw)
In-Reply-To: <1509620730.3274.209.camel@intel.com>

On Thu, 02 Nov 2017, Mika Kahola <mika.kahola@intel.com> wrote:
> On Wed, 2017-11-01 at 17:26 +0200, Jani Nikula wrote:
>> On Wed, 01 Nov 2017, Mika Kahola <mika.kahola@intel.com> wrote:
>> > 
>> > To make looping through transcoders in intel_ddi.c more generic,
>> > let's switch
>> > to use 'for_each_pipe()' macro to do this.
>> > 
>> > Signed-off-by: Mika Kahola <mika.kahola@intel.com>
>> > ---
>> >  drivers/gpu/drm/i915/intel_ddi.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> > 
>> > diff --git a/drivers/gpu/drm/i915/intel_ddi.c
>> > b/drivers/gpu/drm/i915/intel_ddi.c
>> > index ace674c..3df991b 100644
>> > --- a/drivers/gpu/drm/i915/intel_ddi.c
>> > +++ b/drivers/gpu/drm/i915/intel_ddi.c
>> > @@ -1717,7 +1717,7 @@ bool intel_ddi_get_hw_state(struct
>> > intel_encoder *encoder,
>> >  		goto out;
>> >  	}
>> >  
>> > -	for (i = TRANSCODER_A; i <= TRANSCODER_C; i++) {
>> > +	for_each_pipe(dev_priv, i) {
>> It gives me an uneasy feeling to conflate pipes and transcoders like
>> this. I think we've tried to be more clear about the distinction
>> elsewhere.
> I had a same kind of feeling myself. First, I was thinking of creating
> a new macro like for_each_transcoder() which would indicate that now we
> are dealing with transcoders instead of pipes. Maybe going to that
> direction here?

That gets ugly fast too... just look at enum transcoder, and realize you
don't want to iterate them all. And there's special casing for
TRANSCODER_EDP above already.

Perhaps the easiest for now would be to use for_each_pipe() (and please
make the variable enum pipe p or something instead of int i) and then do
an explicit

	enum transcoder cpu_transcoder = (enum transcoder) p;

BR,
Jani.

>
>> 
>> BR,
>> Jani.
>> 
>> > 
>> >  		tmp = I915_READ(TRANS_DDI_FUNC_CTL(i));
>> >  
>> >  		if ((tmp & TRANS_DDI_PORT_MASK) ==
>> > TRANS_DDI_SELECT_PORT(port)) {

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2017-11-02 11:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 11:50 [PATCH] drm/i915: Generalize transcoder looping Mika Kahola
2017-11-01 13:09 ` ✗ Fi.CI.BAT: failure for " Patchwork
2017-11-01 15:26 ` [PATCH] " Jani Nikula
2017-11-02 11:05   ` Mika Kahola
2017-11-02 11:18     ` Jani Nikula [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=87wp39c4jy.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kahola@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;
as well as URLs for NNTP newsgroup(s).