From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] Revert "drm/i915: use a separate context for gpu relocs"
Date: Fri, 29 Nov 2019 15:07:22 +0200 [thread overview]
Message-ID: <87muce7rw5.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20191129124846.949100-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Since commit c45e788d95b4 ("drm/i915/tgl: Suspend pre-parser across GTT
> invalidations"), we now disable the advanced preparser on Tigerlake for the
> invalidation phase at the start of the batch, we no longer need to emit
> the GPU relocations from a second context as they are now flushed inlined.
>
> References: 8a9a982767b7 ("drm/i915: use a separate context for gpu relocs")
> References: c45e788d95b4 ("drm/i915/tgl: Suspend pre-parser across GTT invalidations")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Not a complete revert, taking care of preserving the valuable
comment about preparser before gen12_emit_preempt_busywait().
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
> .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 30 +------------------
> 1 file changed, 1 insertion(+), 29 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> index 7a87e8270460..459f4d40b69b 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> @@ -253,7 +253,6 @@ struct i915_execbuffer {
> bool has_fence : 1;
> bool needs_unfenced : 1;
>
> - struct intel_context *ce;
> struct i915_request *rq;
> u32 *rq_cmd;
> unsigned int rq_size;
> @@ -886,9 +885,6 @@ static void eb_destroy(const struct i915_execbuffer *eb)
> {
> GEM_BUG_ON(eb->reloc_cache.rq);
>
> - if (eb->reloc_cache.ce)
> - intel_context_put(eb->reloc_cache.ce);
> -
> if (eb->lut_size > 0)
> kfree(eb->buckets);
> }
> @@ -912,7 +908,6 @@ static void reloc_cache_init(struct reloc_cache *cache,
> cache->has_fence = cache->gen < 4;
> cache->needs_unfenced = INTEL_INFO(i915)->unfenced_needs_alignment;
> cache->node.flags = 0;
> - cache->ce = NULL;
> cache->rq = NULL;
> cache->rq_size = 0;
> }
> @@ -1182,7 +1177,7 @@ static int __reloc_gpu_alloc(struct i915_execbuffer *eb,
> if (err)
> goto err_unmap;
>
> - rq = intel_context_create_request(cache->ce);
> + rq = i915_request_create(eb->context);
> if (IS_ERR(rq)) {
> err = PTR_ERR(rq);
> goto err_unpin;
> @@ -1253,29 +1248,6 @@ static u32 *reloc_gpu(struct i915_execbuffer *eb,
> if (!intel_engine_can_store_dword(eb->engine))
> return ERR_PTR(-ENODEV);
>
> - if (!cache->ce) {
> - struct intel_context *ce;
> -
> - /*
> - * The CS pre-parser can pre-fetch commands across
> - * memory sync points and starting gen12 it is able to
> - * pre-fetch across BB_START and BB_END boundaries
> - * (within the same context). We therefore use a
> - * separate context gen12+ to guarantee that the reloc
> - * writes land before the parser gets to the target
> - * memory location.
> - */
> - if (cache->gen >= 12)
> - ce = intel_context_create(eb->context->gem_context,
> - eb->engine);
> - else
> - ce = intel_context_get(eb->context);
> - if (IS_ERR(ce))
> - return ERR_CAST(ce);
> -
> - cache->ce = ce;
> - }
> -
> err = __reloc_gpu_alloc(eb, vma, len);
> if (unlikely(err))
> return ERR_PTR(err);
> --
> 2.24.0
_______________________________________________
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: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] Revert "drm/i915: use a separate context for gpu relocs"
Date: Fri, 29 Nov 2019 15:07:22 +0200 [thread overview]
Message-ID: <87muce7rw5.fsf@gaia.fi.intel.com> (raw)
Message-ID: <20191129130722.JoD8WmZZZJsIJH8mq6xCmZxbapk8mfHodEswDPaaIZU@z> (raw)
In-Reply-To: <20191129124846.949100-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Since commit c45e788d95b4 ("drm/i915/tgl: Suspend pre-parser across GTT
> invalidations"), we now disable the advanced preparser on Tigerlake for the
> invalidation phase at the start of the batch, we no longer need to emit
> the GPU relocations from a second context as they are now flushed inlined.
>
> References: 8a9a982767b7 ("drm/i915: use a separate context for gpu relocs")
> References: c45e788d95b4 ("drm/i915/tgl: Suspend pre-parser across GTT invalidations")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Not a complete revert, taking care of preserving the valuable
comment about preparser before gen12_emit_preempt_busywait().
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
> .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 30 +------------------
> 1 file changed, 1 insertion(+), 29 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> index 7a87e8270460..459f4d40b69b 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> @@ -253,7 +253,6 @@ struct i915_execbuffer {
> bool has_fence : 1;
> bool needs_unfenced : 1;
>
> - struct intel_context *ce;
> struct i915_request *rq;
> u32 *rq_cmd;
> unsigned int rq_size;
> @@ -886,9 +885,6 @@ static void eb_destroy(const struct i915_execbuffer *eb)
> {
> GEM_BUG_ON(eb->reloc_cache.rq);
>
> - if (eb->reloc_cache.ce)
> - intel_context_put(eb->reloc_cache.ce);
> -
> if (eb->lut_size > 0)
> kfree(eb->buckets);
> }
> @@ -912,7 +908,6 @@ static void reloc_cache_init(struct reloc_cache *cache,
> cache->has_fence = cache->gen < 4;
> cache->needs_unfenced = INTEL_INFO(i915)->unfenced_needs_alignment;
> cache->node.flags = 0;
> - cache->ce = NULL;
> cache->rq = NULL;
> cache->rq_size = 0;
> }
> @@ -1182,7 +1177,7 @@ static int __reloc_gpu_alloc(struct i915_execbuffer *eb,
> if (err)
> goto err_unmap;
>
> - rq = intel_context_create_request(cache->ce);
> + rq = i915_request_create(eb->context);
> if (IS_ERR(rq)) {
> err = PTR_ERR(rq);
> goto err_unpin;
> @@ -1253,29 +1248,6 @@ static u32 *reloc_gpu(struct i915_execbuffer *eb,
> if (!intel_engine_can_store_dword(eb->engine))
> return ERR_PTR(-ENODEV);
>
> - if (!cache->ce) {
> - struct intel_context *ce;
> -
> - /*
> - * The CS pre-parser can pre-fetch commands across
> - * memory sync points and starting gen12 it is able to
> - * pre-fetch across BB_START and BB_END boundaries
> - * (within the same context). We therefore use a
> - * separate context gen12+ to guarantee that the reloc
> - * writes land before the parser gets to the target
> - * memory location.
> - */
> - if (cache->gen >= 12)
> - ce = intel_context_create(eb->context->gem_context,
> - eb->engine);
> - else
> - ce = intel_context_get(eb->context);
> - if (IS_ERR(ce))
> - return ERR_CAST(ce);
> -
> - cache->ce = ce;
> - }
> -
> err = __reloc_gpu_alloc(eb, vma, len);
> if (unlikely(err))
> return ERR_PTR(err);
> --
> 2.24.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-11-29 13:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-29 12:48 [PATCH] Revert "drm/i915: use a separate context for gpu relocs" Chris Wilson
2019-11-29 12:48 ` [Intel-gfx] " Chris Wilson
2019-11-29 13:07 ` Mika Kuoppala [this message]
2019-11-29 13:07 ` Mika Kuoppala
2019-11-29 20:34 ` ✗ Fi.CI.BAT: failure for " Patchwork
2019-11-29 20:34 ` [Intel-gfx] " Patchwork
2019-12-03 22:19 ` [Intel-gfx] [PATCH] " Daniele Ceraolo Spurio
2019-12-04 18:21 ` Chris Wilson
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=87muce7rw5.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox