public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Move the context descriptor to an inline helper
@ 2017-09-12 21:49 Chris Wilson
  2017-09-12 22:14 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Chris Wilson @ 2017-09-12 21:49 UTC (permalink / raw)
  To: intel-gfx

The context descriptor is stored inside the per-engine context state, as
we only need to compute it once and access it frequently. However,
currently only intel_lrc.c has easy access, but i915_guc_submission.c
would like to frequently read it as well, and more so only ever needs
the lower 32bits. Make it an inline as the compiler should be able to
retrieve the value in less instructions than it takes to do the function
call:

add/remove: 0/1 grow/shrink: 1/0 up/down: 8/-45 (-37)
function                                     old     new   delta
i915_guc_submit                              621     629      +8
intel_lr_context_descriptor                   45       -     -45

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_lrc.c |  6 ------
 drivers/gpu/drm/i915/intel_lrc.h | 11 +++++++++--
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 5837b33f9705..7457783ed182 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -286,12 +286,6 @@ intel_lr_context_descriptor_update(struct i915_gem_context *ctx,
 	ce->lrc_desc = desc;
 }
 
-uint64_t intel_lr_context_descriptor(struct i915_gem_context *ctx,
-				     struct intel_engine_cs *engine)
-{
-	return ctx->engine[engine->id].lrc_desc;
-}
-
 static inline void
 execlists_context_status_change(struct drm_i915_gem_request *rq,
 				unsigned long status)
diff --git a/drivers/gpu/drm/i915/intel_lrc.h b/drivers/gpu/drm/i915/intel_lrc.h
index 57ef5833c427..3b1de327e504 100644
--- a/drivers/gpu/drm/i915/intel_lrc.h
+++ b/drivers/gpu/drm/i915/intel_lrc.h
@@ -25,6 +25,7 @@
 #define _INTEL_LRC_H_
 
 #include "intel_ringbuffer.h"
+#include "i915_gem_context.h"
 
 #define GEN8_LR_CONTEXT_ALIGN I915_GTT_MIN_ALIGNMENT
 
@@ -78,8 +79,14 @@ struct drm_i915_private;
 struct i915_gem_context;
 
 void intel_lr_context_resume(struct drm_i915_private *dev_priv);
-uint64_t intel_lr_context_descriptor(struct i915_gem_context *ctx,
-				     struct intel_engine_cs *engine);
+
+static inline uint64_t
+intel_lr_context_descriptor(struct i915_gem_context *ctx,
+			    struct intel_engine_cs *engine)
+{
+	return ctx->engine[engine->id].lrc_desc;
+}
+
 
 /* Execlists */
 int intel_sanitize_enable_execlists(struct drm_i915_private *dev_priv,
-- 
2.14.1

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Move the context descriptor to an inline helper
  2017-09-12 21:49 [PATCH] drm/i915: Move the context descriptor to an inline helper Chris Wilson
@ 2017-09-12 22:14 ` Patchwork
  2017-09-12 22:50 ` [PATCH] " Oscar Mateo
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2017-09-12 22:14 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Move the context descriptor to an inline helper
URL   : https://patchwork.freedesktop.org/series/30242/
State : success

== Summary ==

Series 30242v1 drm/i915: Move the context descriptor to an inline helper
https://patchwork.freedesktop.org/api/1.0/series/30242/revisions/1/mbox/

Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-legacy:
                pass       -> FAIL       (fi-snb-2600) fdo#100215
Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                skip       -> PASS       (fi-skl-x1585l) fdo#101781

fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fdo#101781 https://bugs.freedesktop.org/show_bug.cgi?id=101781

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:449s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:454s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:380s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:528s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:268s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:501s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:502s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:490s
fi-cfl-s         total:289  pass:250  dwarn:4   dfail:0   fail:0   skip:35  time:454s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:445s
fi-glk-2a        total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:593s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:432s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:407s
fi-ilk-650       total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:435s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:489s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:464s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:497s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:576s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:587s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:553s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:462s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:524s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:500s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:464s
fi-skl-x1585l    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:493s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:579s
fi-snb-2600      total:289  pass:248  dwarn:0   dfail:0   fail:2   skip:39  time:430s

c9e787e0e616ba39a2ef195cb24d2e79b628bb9a drm-tip: 2017y-09m-12d-20h-02m-24s UTC integration manifest
60c73b6ba291 drm/i915: Move the context descriptor to an inline helper

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5669/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915: Move the context descriptor to an inline helper
  2017-09-12 21:49 [PATCH] drm/i915: Move the context descriptor to an inline helper Chris Wilson
  2017-09-12 22:14 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-09-12 22:50 ` Oscar Mateo
  2017-09-13  9:39   ` Chris Wilson
  2017-09-13  6:22 ` ✓ Fi.CI.IGT: success for " Patchwork
  2017-09-18 14:40 ` [PATCH] " Joonas Lahtinen
  3 siblings, 1 reply; 6+ messages in thread
From: Oscar Mateo @ 2017-09-12 22:50 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx



On 09/12/2017 02:49 PM, Chris Wilson wrote:
> The context descriptor is stored inside the per-engine context state, as
> we only need to compute it once and access it frequently. However,
> currently only intel_lrc.c has easy access, but i915_guc_submission.c
> would like to frequently read it as well, and more so only ever needs
> the lower 32bits. Make it an inline as the compiler should be able to
> retrieve the value in less instructions than it takes to do the function
> call:
>
> add/remove: 0/1 grow/shrink: 1/0 up/down: 8/-45 (-37)
> function                                     old     new   delta
> i915_guc_submit                              621     629      +8
> intel_lr_context_descriptor                   45       -     -45
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/intel_lrc.c |  6 ------
>   drivers/gpu/drm/i915/intel_lrc.h | 11 +++++++++--
>   2 files changed, 9 insertions(+), 8 deletions(-)

Reviewed-by: Oscar Mateo <oscar.mateo@intel.com>

> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 5837b33f9705..7457783ed182 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -286,12 +286,6 @@ intel_lr_context_descriptor_update(struct i915_gem_context *ctx,
>   	ce->lrc_desc = desc;
>   }
>   
> -uint64_t intel_lr_context_descriptor(struct i915_gem_context *ctx,
> -				     struct intel_engine_cs *engine)
> -{
> -	return ctx->engine[engine->id].lrc_desc;
> -}
> -
>   static inline void
>   execlists_context_status_change(struct drm_i915_gem_request *rq,
>   				unsigned long status)
> diff --git a/drivers/gpu/drm/i915/intel_lrc.h b/drivers/gpu/drm/i915/intel_lrc.h
> index 57ef5833c427..3b1de327e504 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.h
> +++ b/drivers/gpu/drm/i915/intel_lrc.h
> @@ -25,6 +25,7 @@
>   #define _INTEL_LRC_H_
>   
>   #include "intel_ringbuffer.h"
> +#include "i915_gem_context.h"
>   
>   #define GEN8_LR_CONTEXT_ALIGN I915_GTT_MIN_ALIGNMENT
>   
> @@ -78,8 +79,14 @@ struct drm_i915_private;
>   struct i915_gem_context;
>   
>   void intel_lr_context_resume(struct drm_i915_private *dev_priv);
> -uint64_t intel_lr_context_descriptor(struct i915_gem_context *ctx,
> -				     struct intel_engine_cs *engine);
> +
> +static inline uint64_t
> +intel_lr_context_descriptor(struct i915_gem_context *ctx,
> +			    struct intel_engine_cs *engine)
> +{
> +	return ctx->engine[engine->id].lrc_desc;
> +}
> +
>   
>   /* Execlists */
>   int intel_sanitize_enable_execlists(struct drm_i915_private *dev_priv,

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* ✓ Fi.CI.IGT: success for drm/i915: Move the context descriptor to an inline helper
  2017-09-12 21:49 [PATCH] drm/i915: Move the context descriptor to an inline helper Chris Wilson
  2017-09-12 22:14 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-09-12 22:50 ` [PATCH] " Oscar Mateo
@ 2017-09-13  6:22 ` Patchwork
  2017-09-18 14:40 ` [PATCH] " Joonas Lahtinen
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2017-09-13  6:22 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Move the context descriptor to an inline helper
URL   : https://patchwork.freedesktop.org/series/30242/
State : success

== Summary ==

Test perf:
        Subgroup blocking:
                fail       -> PASS       (shard-hsw) fdo#102252
Test prime_self_import:
        Subgroup reimport-vs-gem_close-race:
                fail       -> PASS       (shard-hsw)

fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252

shard-hsw        total:2419 pass:1324 dwarn:1   dfail:0   fail:13  skip:1081 time:9692s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5669/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915: Move the context descriptor to an inline helper
  2017-09-12 22:50 ` [PATCH] " Oscar Mateo
@ 2017-09-13  9:39   ` Chris Wilson
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2017-09-13  9:39 UTC (permalink / raw)
  To: Oscar Mateo, intel-gfx

Quoting Oscar Mateo (2017-09-12 23:50:08)
> 
> 
> On 09/12/2017 02:49 PM, Chris Wilson wrote:
> > The context descriptor is stored inside the per-engine context state, as
> > we only need to compute it once and access it frequently. However,
> > currently only intel_lrc.c has easy access, but i915_guc_submission.c
> > would like to frequently read it as well, and more so only ever needs
> > the lower 32bits. Make it an inline as the compiler should be able to
> > retrieve the value in less instructions than it takes to do the function
> > call:
> >
> > add/remove: 0/1 grow/shrink: 1/0 up/down: 8/-45 (-37)
> > function                                     old     new   delta
> > i915_guc_submit                              621     629      +8
> > intel_lr_context_descriptor                   45       -     -45
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >   drivers/gpu/drm/i915/intel_lrc.c |  6 ------
> >   drivers/gpu/drm/i915/intel_lrc.h | 11 +++++++++--
> >   2 files changed, 9 insertions(+), 8 deletions(-)
> 
> Reviewed-by: Oscar Mateo <oscar.mateo@intel.com>

Thanks for the review, pushed along with your series.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915: Move the context descriptor to an inline helper
  2017-09-12 21:49 [PATCH] drm/i915: Move the context descriptor to an inline helper Chris Wilson
                   ` (2 preceding siblings ...)
  2017-09-13  6:22 ` ✓ Fi.CI.IGT: success for " Patchwork
@ 2017-09-18 14:40 ` Joonas Lahtinen
  3 siblings, 0 replies; 6+ messages in thread
From: Joonas Lahtinen @ 2017-09-18 14:40 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

On Tue, 2017-09-12 at 22:49 +0100, Chris Wilson wrote:
> The context descriptor is stored inside the per-engine context state, as
> we only need to compute it once and access it frequently. However,
> currently only intel_lrc.c has easy access, but i915_guc_submission.c
> would like to frequently read it as well, and more so only ever needs
> the lower 32bits. Make it an inline as the compiler should be able to
> retrieve the value in less instructions than it takes to do the function
> call:
> 
> add/remove: 0/1 grow/shrink: 1/0 up/down: 8/-45 (-37)
> function                                     old     new   delta
> i915_guc_submit                              621     629      +8
> intel_lr_context_descriptor                   45       -     -45
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

<SNIP>

> @@ -78,8 +79,14 @@ struct drm_i915_private;
>  struct i915_gem_context;
>  
>  void intel_lr_context_resume(struct drm_i915_private *dev_priv);
> -uint64_t intel_lr_context_descriptor(struct i915_gem_context *ctx,
> -				     struct intel_engine_cs *engine);
> +
> +static inline uint64_t

There was a perfect opportunity for s/uint64_t/u64/ here.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-09-18 14:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-12 21:49 [PATCH] drm/i915: Move the context descriptor to an inline helper Chris Wilson
2017-09-12 22:14 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-09-12 22:50 ` [PATCH] " Oscar Mateo
2017-09-13  9:39   ` Chris Wilson
2017-09-13  6:22 ` ✓ Fi.CI.IGT: success for " Patchwork
2017-09-18 14:40 ` [PATCH] " Joonas Lahtinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox