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 04/12] drm/i915/execlists: Refactor CSB state machine
Date: Tue, 02 Jul 2019 11:36:34 +0300	[thread overview]
Message-ID: <8736jo4yul.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <156198901580.1583.7337880635854674465@skylake-alporthouse-com>

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

> Quoting Mika Kuoppala (2019-07-01 12:49:48)
>> Chris Wilson <chris@chris-wilson.co.uk> writes:
>> 
>> > Daniele pointed out that the CSB status information will change with
>> > Tigerlake and suggested that we could rearrange our state machine to
>> > hide the differences in generation. gcc also prefers the explicit state
>> > machine, so make it so:
>> >
>> > process_csb                                 1980    1967     -13
>> >
>> > Suggested-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> > Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>> > Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>> > Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>> > ---
>> >  drivers/gpu/drm/i915/gt/intel_lrc.c | 64 ++++++++++++++++++++---------
>> >  1 file changed, 44 insertions(+), 20 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
>> > index 471e134de186..953b3938a85f 100644
>> > --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
>> > +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
>> > @@ -1279,6 +1279,30 @@ reset_in_progress(const struct intel_engine_execlists *execlists)
>> >       return unlikely(!__tasklet_is_enabled(&execlists->tasklet));
>> >  }
>> >  
>> > +enum csb_step {
>> > +     CSB_NOP,
>> > +     CSB_PROMOTE,
>> > +     CSB_PREEMPT,
>> > +     CSB_COMPLETE,
>> > +};
>> > +
>> > +static inline enum csb_step
>> > +csb_parse(const struct intel_engine_execlists *execlists, const u32 *csb)
>> > +{
>> > +     unsigned int status = *csb;
>> 
>> Could be const u32 aswell (stylistic).
>
> No need to specify here, local register is fine, so left it as natural.
>

In this case the function is small and obvious so that is
why stylistic.

But for more complex one, it takes away reviewers
burden as you can read something as const and
then the complexity tree you need to manage between
your ears shrinks when you read further down.

I can also remember atleast few cases where
it has prevented an unwanted accidental write
into propagating past compiler.

>> Just makes me ponder why you want to read csb in here
>> and not in the callsite.
>
> Whatever gcc prefers when there is multiple csb_parsers. :)

It changes to a better produced code? Surely reason
enough.

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

  reply	other threads:[~2019-07-02  9:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-01 10:04 [PATCH 01/12] drm/i915/guc: Avoid reclaim locks during reset Chris Wilson
2019-07-01 10:04 ` [PATCH 02/12] drm/i915: Markup potential lock for i915_active Chris Wilson
2019-07-01 10:04 ` [PATCH 03/12] drm/i915: Mark up vma->active as safe for use inside shrinkers Chris Wilson
2019-07-01 10:04 ` [PATCH 04/12] drm/i915/execlists: Refactor CSB state machine Chris Wilson
2019-07-01 11:49   ` Mika Kuoppala
2019-07-01 13:50     ` Chris Wilson
2019-07-02  8:36       ` Mika Kuoppala [this message]
2019-07-01 18:28   ` Daniele Ceraolo Spurio
2019-07-01 10:04 ` [PATCH 05/12] drm/i915/execlists: Hesitate before slicing Chris Wilson
2019-07-01 10:04 ` [PATCH 06/12] drm/i915/selftests: Lock the drm_mm while modifying Chris Wilson
2019-07-01 10:04 ` [PATCH 07/12] drm/i915: Teach execbuffer to take the engine wakeref not GT Chris Wilson
2019-07-01 10:04 ` [PATCH 08/12] drm/i915/gt: Track timeline activeness in enter/exit Chris Wilson
2019-07-01 10:04 ` [PATCH 09/12] drm/i915/gt: Convert timeline tracking to spinlock Chris Wilson
2019-07-01 10:05 ` [PATCH 10/12] drm/i915/gt: Guard timeline pinning with its own mutex Chris Wilson
2019-07-01 10:05 ` [PATCH 11/12] drm/i915: Protect request retirement with timeline->mutex Chris Wilson
2019-07-01 10:05 ` [PATCH 12/12] drm/i915: Replace struct_mutex for batch pool serialisation Chris Wilson
2019-07-01 11:15 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/12] drm/i915/guc: Avoid reclaim locks during reset Patchwork
2019-07-01 11:20 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-07-01 11:44 ` ✓ Fi.CI.BAT: success " Patchwork
2019-07-01 12:36 ` [PATCH 01/12] " Michal Wajdeczko
2019-07-01 13:48   ` Chris Wilson
2019-07-01 18:12 ` Daniele Ceraolo Spurio
2019-07-02 14:06 ` ✓ Fi.CI.IGT: success for series starting with [01/12] " 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=8736jo4yul.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.