All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Move intel_engine_context_in/out into intel_lrc.c
Date: Fri, 25 Oct 2019 13:43:51 +0100	[thread overview]
Message-ID: <962e355e-fe48-1654-6312-ecf08423b6d0@linux.intel.com> (raw)
In-Reply-To: <157199481607.2725.16072281219556398612@skylake-alporthouse-com>


On 25/10/2019 10:13, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-10-25 10:09:52)
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Intel_lrc.c is the only caller and so to avoid some header file ordering
>> issues in future patches move these two over there.
> 
> How much pain would you feel if we did intel_lrc.c +
> intel_execlists_submission.c earlier rather than later?

Par for course as you like to say. :)

>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> ---
>>   drivers/gpu/drm/i915/gt/intel_engine.h | 55 --------------------------
>>   drivers/gpu/drm/i915/gt/intel_lrc.c    | 55 ++++++++++++++++++++++++++
>>   2 files changed, 55 insertions(+), 55 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/intel_engine.h b/drivers/gpu/drm/i915/gt/intel_engine.h
>> index 97bbdd9773c9..c6895938b626 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_engine.h
>> +++ b/drivers/gpu/drm/i915/gt/intel_engine.h
>> @@ -290,61 +290,6 @@ void intel_engine_dump(struct intel_engine_cs *engine,
>>                         struct drm_printer *m,
>>                         const char *header, ...);
>>   
>> -static inline void intel_engine_context_in(struct intel_engine_cs *engine)
>> -{
>> -       unsigned long flags;
>> -
>> -       if (READ_ONCE(engine->stats.enabled) == 0)
>> -               return;
>> -
>> -       write_seqlock_irqsave(&engine->stats.lock, flags);
>> -
>> -       if (engine->stats.enabled > 0) {
>> -               if (engine->stats.active++ == 0)
>> -                       engine->stats.start = ktime_get();
>> -               GEM_BUG_ON(engine->stats.active == 0);
>> -       }
>> -
>> -       write_sequnlock_irqrestore(&engine->stats.lock, flags);
>> -}
>> -
>> -static inline void intel_engine_context_out(struct intel_engine_cs *engine)
>> -{
>> -       unsigned long flags;
>> -
>> -       if (READ_ONCE(engine->stats.enabled) == 0)
>> -               return;
>> -
>> -       write_seqlock_irqsave(&engine->stats.lock, flags);
>> -
>> -       if (engine->stats.enabled > 0) {
>> -               ktime_t last;
>> -
>> -               if (engine->stats.active && --engine->stats.active == 0) {
>> -                       /*
>> -                        * Decrement the active context count and in case GPU
>> -                        * is now idle add up to the running total.
>> -                        */
>> -                       last = ktime_sub(ktime_get(), engine->stats.start);
>> -
>> -                       engine->stats.total = ktime_add(engine->stats.total,
>> -                                                       last);
>> -               } else if (engine->stats.active == 0) {
>> -                       /*
>> -                        * After turning on engine stats, context out might be
>> -                        * the first event in which case we account from the
>> -                        * time stats gathering was turned on.
>> -                        */
>> -                       last = ktime_sub(ktime_get(), engine->stats.enabled_at);
>> -
>> -                       engine->stats.total = ktime_add(engine->stats.total,
>> -                                                       last);
>> -               }
>> -       }
>> -
>> -       write_sequnlock_irqrestore(&engine->stats.lock, flags);
>> -}
>> -
>>   int intel_enable_engine_stats(struct intel_engine_cs *engine);
>>   void intel_disable_engine_stats(struct intel_engine_cs *engine);
>>   
>> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
>> index 73eae85a2cc9..523de1fd4452 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
>> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
>> @@ -944,6 +944,61 @@ execlists_context_status_change(struct i915_request *rq, unsigned long status)
>>                                     status, rq);
>>   }
>>   
>> +static void intel_engine_context_in(struct intel_engine_cs *engine)
> 
> stats_in() / stats_out() ?
> 
> Now that's it entirely local and we may end up doing other per-context
> in/out ops?

Yeah, could make sense. I did rename it to intel_context_in/out in a 
local patch which adds per ce stats. Lets see when I un-bit-rot that 
work how it will look.

> Purely mechanical, so
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

In the meantime I have pushed this so at least header file is smaller. 
Thanks.

Regards,

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

WARNING: multiple messages have this Message-ID (diff)
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, Intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Move intel_engine_context_in/out into intel_lrc.c
Date: Fri, 25 Oct 2019 13:43:51 +0100	[thread overview]
Message-ID: <962e355e-fe48-1654-6312-ecf08423b6d0@linux.intel.com> (raw)
Message-ID: <20191025124351.S1qdOu_4OC66l6KJC0a8c9kkaaGiH6vGnNgRmfPbgIE@z> (raw)
In-Reply-To: <157199481607.2725.16072281219556398612@skylake-alporthouse-com>


On 25/10/2019 10:13, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-10-25 10:09:52)
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Intel_lrc.c is the only caller and so to avoid some header file ordering
>> issues in future patches move these two over there.
> 
> How much pain would you feel if we did intel_lrc.c +
> intel_execlists_submission.c earlier rather than later?

Par for course as you like to say. :)

>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> ---
>>   drivers/gpu/drm/i915/gt/intel_engine.h | 55 --------------------------
>>   drivers/gpu/drm/i915/gt/intel_lrc.c    | 55 ++++++++++++++++++++++++++
>>   2 files changed, 55 insertions(+), 55 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/intel_engine.h b/drivers/gpu/drm/i915/gt/intel_engine.h
>> index 97bbdd9773c9..c6895938b626 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_engine.h
>> +++ b/drivers/gpu/drm/i915/gt/intel_engine.h
>> @@ -290,61 +290,6 @@ void intel_engine_dump(struct intel_engine_cs *engine,
>>                         struct drm_printer *m,
>>                         const char *header, ...);
>>   
>> -static inline void intel_engine_context_in(struct intel_engine_cs *engine)
>> -{
>> -       unsigned long flags;
>> -
>> -       if (READ_ONCE(engine->stats.enabled) == 0)
>> -               return;
>> -
>> -       write_seqlock_irqsave(&engine->stats.lock, flags);
>> -
>> -       if (engine->stats.enabled > 0) {
>> -               if (engine->stats.active++ == 0)
>> -                       engine->stats.start = ktime_get();
>> -               GEM_BUG_ON(engine->stats.active == 0);
>> -       }
>> -
>> -       write_sequnlock_irqrestore(&engine->stats.lock, flags);
>> -}
>> -
>> -static inline void intel_engine_context_out(struct intel_engine_cs *engine)
>> -{
>> -       unsigned long flags;
>> -
>> -       if (READ_ONCE(engine->stats.enabled) == 0)
>> -               return;
>> -
>> -       write_seqlock_irqsave(&engine->stats.lock, flags);
>> -
>> -       if (engine->stats.enabled > 0) {
>> -               ktime_t last;
>> -
>> -               if (engine->stats.active && --engine->stats.active == 0) {
>> -                       /*
>> -                        * Decrement the active context count and in case GPU
>> -                        * is now idle add up to the running total.
>> -                        */
>> -                       last = ktime_sub(ktime_get(), engine->stats.start);
>> -
>> -                       engine->stats.total = ktime_add(engine->stats.total,
>> -                                                       last);
>> -               } else if (engine->stats.active == 0) {
>> -                       /*
>> -                        * After turning on engine stats, context out might be
>> -                        * the first event in which case we account from the
>> -                        * time stats gathering was turned on.
>> -                        */
>> -                       last = ktime_sub(ktime_get(), engine->stats.enabled_at);
>> -
>> -                       engine->stats.total = ktime_add(engine->stats.total,
>> -                                                       last);
>> -               }
>> -       }
>> -
>> -       write_sequnlock_irqrestore(&engine->stats.lock, flags);
>> -}
>> -
>>   int intel_enable_engine_stats(struct intel_engine_cs *engine);
>>   void intel_disable_engine_stats(struct intel_engine_cs *engine);
>>   
>> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
>> index 73eae85a2cc9..523de1fd4452 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
>> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
>> @@ -944,6 +944,61 @@ execlists_context_status_change(struct i915_request *rq, unsigned long status)
>>                                     status, rq);
>>   }
>>   
>> +static void intel_engine_context_in(struct intel_engine_cs *engine)
> 
> stats_in() / stats_out() ?
> 
> Now that's it entirely local and we may end up doing other per-context
> in/out ops?

Yeah, could make sense. I did rename it to intel_context_in/out in a 
local patch which adds per ce stats. Lets see when I un-bit-rot that 
work how it will look.

> Purely mechanical, so
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

In the meantime I have pushed this so at least header file is smaller. 
Thanks.

Regards,

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

  reply	other threads:[~2019-10-25 12:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25  9:09 [PATCH] drm/i915: Move intel_engine_context_in/out into intel_lrc.c Tvrtko Ursulin
2019-10-25  9:09 ` [Intel-gfx] " Tvrtko Ursulin
2019-10-25  9:13 ` Chris Wilson
2019-10-25  9:13   ` [Intel-gfx] " Chris Wilson
2019-10-25 12:43   ` Tvrtko Ursulin [this message]
2019-10-25 12:43     ` Tvrtko Ursulin
2019-10-25 10:08 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-10-25 10:08   ` [Intel-gfx] " Patchwork
2019-10-26 19:07 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-10-26 19:07   ` [Intel-gfx] " 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=962e355e-fe48-1654-6312-ecf08423b6d0@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=chris@chris-wilson.co.uk \
    /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.