All of lore.kernel.org
 help / color / mirror / Atom feed
From: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: michael.cheng@intel.com, intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, siva.mullati@intel.com
Subject: Re: [Intel-gfx] [PATCH] drm/i915/guc: Use iosys_map interface to update lrc_desc
Date: Mon, 14 Mar 2022 19:28:20 +0530	[thread overview]
Message-ID: <Yi9J/AmkJdbY8Cwu@bvivekan-mobl.gar.corp.intel.com> (raw)
In-Reply-To: <20220311184028.phqpfrnbzkryf2zs@ldmartin-desk2>

On 11.03.2022 10:40, Lucas De Marchi wrote:
> On Tue, Mar 08, 2022 at 10:17:42PM +0530, Balasubramani Vivekanandan wrote:
> > This patch is continuation of the effort to move all pointers in i915,
> > which at any point may be pointing to device memory or system memory, to
> > iosys_map interface.
> > More details about the need of this change is explained in the patch
> > series which initiated this task
> > https://patchwork.freedesktop.org/series/99711/
> > 
> > This patch converts all access to the lrc_desc through iosys_map
> > interfaces.
> > 
> > Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> > Cc: John Harrison <John.C.Harrison@Intel.com>
> > Cc: Matthew Brost <matthew.brost@intel.com>
> > Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
> > Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
> > ---
> 
> ...
> 
> > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> > @@ -2245,13 +2256,13 @@ static void prepare_context_registration_info(struct intel_context *ce)
> > 	GEM_BUG_ON(i915_gem_object_is_lmem(guc->ct.vma->obj) !=
> > 		   i915_gem_object_is_lmem(ce->ring->vma->obj));
> > 
> > -	desc = __get_lrc_desc(guc, ctx_id);
> > -	desc->engine_class = engine_class_to_guc_class(engine->class);
> > -	desc->engine_submit_mask = engine->logical_mask;
> > -	desc->hw_context_desc = ce->lrc.lrca;
> > -	desc->priority = ce->guc_state.prio;
> > -	desc->context_flags = CONTEXT_REGISTRATION_FLAG_KMD;
> > -	guc_context_policy_init(engine, desc);
> > +	memset(&desc, 0, sizeof(desc));
> 
> previously we would re-use whatever was left in
> guc->lrc_desc_pool_vaddr. Here we are changing it to always zero
> everything and set the fields we are interested in.
> 
> As I'm not too familiar with this part and I see us traversing child guc_process_desc
> which may point to the same id, it doesn't _feel_ safe. Did you check if
> this is not zero'ing what it shouldn't?
> 
> Matt Brost / John / Daniele, could you clarify?
> 
> thanks
> Lucas De Marchi

I verified that struct guc_lrc_desc is not updated anywhere else in the
driver other than in prepare_context_registration_info. So I went ahead
with clearing it before updating the fields.
But I will still wait for comments from Matt Brost/ John / Daniele for
their confirmation.

Thanks
Bala

WARNING: multiple messages have this Message-ID (diff)
From: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>,
	michael.cheng@intel.com, wayne.boyer@intel.com,
	intel-gfx@lists.freedesktop.org, casey.g.bowman@intel.com,
	dri-devel@lists.freedesktop.org, siva.mullati@intel.com,
	Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
	Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>,
	John Harrison <John.C.Harrison@intel.com>
Subject: Re: [PATCH] drm/i915/guc: Use iosys_map interface to update lrc_desc
Date: Mon, 14 Mar 2022 19:28:20 +0530	[thread overview]
Message-ID: <Yi9J/AmkJdbY8Cwu@bvivekan-mobl.gar.corp.intel.com> (raw)
In-Reply-To: <20220311184028.phqpfrnbzkryf2zs@ldmartin-desk2>

On 11.03.2022 10:40, Lucas De Marchi wrote:
> On Tue, Mar 08, 2022 at 10:17:42PM +0530, Balasubramani Vivekanandan wrote:
> > This patch is continuation of the effort to move all pointers in i915,
> > which at any point may be pointing to device memory or system memory, to
> > iosys_map interface.
> > More details about the need of this change is explained in the patch
> > series which initiated this task
> > https://patchwork.freedesktop.org/series/99711/
> > 
> > This patch converts all access to the lrc_desc through iosys_map
> > interfaces.
> > 
> > Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> > Cc: John Harrison <John.C.Harrison@Intel.com>
> > Cc: Matthew Brost <matthew.brost@intel.com>
> > Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
> > Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
> > ---
> 
> ...
> 
> > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> > @@ -2245,13 +2256,13 @@ static void prepare_context_registration_info(struct intel_context *ce)
> > 	GEM_BUG_ON(i915_gem_object_is_lmem(guc->ct.vma->obj) !=
> > 		   i915_gem_object_is_lmem(ce->ring->vma->obj));
> > 
> > -	desc = __get_lrc_desc(guc, ctx_id);
> > -	desc->engine_class = engine_class_to_guc_class(engine->class);
> > -	desc->engine_submit_mask = engine->logical_mask;
> > -	desc->hw_context_desc = ce->lrc.lrca;
> > -	desc->priority = ce->guc_state.prio;
> > -	desc->context_flags = CONTEXT_REGISTRATION_FLAG_KMD;
> > -	guc_context_policy_init(engine, desc);
> > +	memset(&desc, 0, sizeof(desc));
> 
> previously we would re-use whatever was left in
> guc->lrc_desc_pool_vaddr. Here we are changing it to always zero
> everything and set the fields we are interested in.
> 
> As I'm not too familiar with this part and I see us traversing child guc_process_desc
> which may point to the same id, it doesn't _feel_ safe. Did you check if
> this is not zero'ing what it shouldn't?
> 
> Matt Brost / John / Daniele, could you clarify?
> 
> thanks
> Lucas De Marchi

I verified that struct guc_lrc_desc is not updated anywhere else in the
driver other than in prepare_context_registration_info. So I went ahead
with clearing it before updating the fields.
But I will still wait for comments from Matt Brost/ John / Daniele for
their confirmation.

Thanks
Bala

  reply	other threads:[~2022-03-14 13:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 16:47 [Intel-gfx] [PATCH] drm/i915/guc: Use iosys_map interface to update lrc_desc Balasubramani Vivekanandan
2022-03-08 16:47 ` Balasubramani Vivekanandan
2022-03-09  0:27 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for " Patchwork
2022-03-09  0:58 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-03-09  8:14 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-03-11 18:40 ` [Intel-gfx] [PATCH] " Lucas De Marchi
2022-03-11 18:40   ` Lucas De Marchi
2022-03-14 13:58   ` Balasubramani Vivekanandan [this message]
2022-03-14 13:58     ` Balasubramani Vivekanandan
2022-03-11 18:43 ` [Intel-gfx] " Lucas De Marchi
2022-03-11 18:43   ` Lucas De Marchi
2022-03-30 15:53 ` [Intel-gfx] " John Harrison
2022-03-30 15:53   ` John Harrison
2022-03-30 19:56   ` [Intel-gfx] " Daniel Vetter
2022-03-30 19:56     ` Daniel Vetter

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=Yi9J/AmkJdbY8Cwu@bvivekan-mobl.gar.corp.intel.com \
    --to=balasubramani.vivekanandan@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=michael.cheng@intel.com \
    --cc=siva.mullati@intel.com \
    /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.