All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 5/8] drm/i915: Introduce iterators for execlist ports
Date: Tue, 12 Sep 2017 13:36:44 +0300	[thread overview]
Message-ID: <87efrc2og3.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <150521221810.22039.17685060458757226079@mail.alporthouse.com>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Quoting Mika Kuoppala (2017-09-12 09:36:15)
>> Switch to iterators for execlist_port access. This is
>> a preparation for indexing ports from arbitrary location. Which
>> in turn allows us to handle ports in ring like fashion.
>> 
>> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
>
> Something we want to keep an eye as we switch to these macros is code
> generation. As a quick guide, check object size, i.e. run
> scripts/bloat-o-meter.
>
>> -static inline unsigned int
>> -execlist_num_ports(const struct intel_engine_execlist * const el)
>> -{
>> -       return el->port_mask + 1;
>> -}
>> +/* Iterators over elsp ports */
>> +#define __port_idx(start, i, m) (((start) + (i)) & (m))
>> +
>> +#define for_each_execlist_port(el__, port__, n__) \
>> +       for ((n__) = 0; \
>> +            (port__) = &(el__)->port[__port_idx(0, (n__), (el__)->port_mask)], (n__) < (el__)->port_mask + 1; \
>> +            (n__)++)
>
> Using (n__) is misleading. It can't be anything other than a lhv (i.e.
> plain variable and not an expr). checkpatch can complain all it wants.
>
> Probably should keep execlist_num_ports() for another patch.
> That x < y + 1 just keeps on triggering me everytime I see it.

There is only a once callsite per macro if I recall right. We could
just drop these macros and live happier life as no-one really is a fan.

-Mika

>
>> +
>> +#define for_each_execlist_port_reverse(el__, port__, n__) \
>> +       for ((n__) = (el__)->port_mask + 1; \
>> +            (port__) = &(el__)->port[__port_idx((el__)->port_mask, (n__), (el__)->port_mask)], (n__)--;)
>>  
>>  static inline void
>>  execlist_port_complete(struct intel_engine_execlist * const el,
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-09-12 10:38 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-12  8:36 [PATCH 0/8] Support for more than two execlist ports Mika Kuoppala
2017-09-12  8:36 ` [PATCH 1/8] drm/i915: Make own struct for execlist items Mika Kuoppala
2017-09-12 10:14   ` Chris Wilson
2017-09-12  8:36 ` [PATCH 2/8] drm/i915: Wrap port cancellation into a function Mika Kuoppala
2017-09-12 10:15   ` Chris Wilson
2017-09-12  8:36 ` [PATCH 3/8] drm/i915: Add execlist_port_complete Mika Kuoppala
2017-09-12 10:19   ` Chris Wilson
2017-09-12  8:36 ` [PATCH 4/8] drm/i915: Make execlist port count variable Mika Kuoppala
2017-09-12  8:55   ` Chris Wilson
2017-09-12 10:24   ` Chris Wilson
2017-09-12  8:36 ` [PATCH 5/8] drm/i915: Introduce iterators for execlist ports Mika Kuoppala
2017-09-12 10:30   ` Chris Wilson
2017-09-12 10:36     ` Mika Kuoppala [this message]
2017-09-12  8:36 ` [PATCH 6/8] drm/i915: Introduce execlist_port_* accessors Mika Kuoppala
2017-09-12 10:37   ` Chris Wilson
2017-09-12  8:36 ` [PATCH 7/8] drm/i915: Move execlist initialization into intel_engine_cs.c Mika Kuoppala
2017-09-12 10:41   ` Chris Wilson
2017-09-12  8:36 ` [PATCH 8/8] drm/i915: Keep track of reserved execlist ports Mika Kuoppala
2017-09-12  9:15   ` Chris Wilson
2017-09-12 10:27     ` Mika Kuoppala
2017-09-12 10:51       ` Chris Wilson
2017-09-12  9:17   ` Chris Wilson
2017-09-12  9:19   ` Chris Wilson
2017-09-12  9:23   ` Chris Wilson
2017-09-12 10:29     ` Mika Kuoppala
2017-09-12 10:53       ` Chris Wilson
2017-09-12  9:35   ` Chris Wilson
2017-09-12 10:45   ` Chris Wilson
2017-09-12  8:59 ` ✓ Fi.CI.BAT: success for Support for more than two " Patchwork
2017-09-12 10:48 ` ✓ Fi.CI.IGT: " Patchwork

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=87efrc2og3.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.