From: Lucas De Marchi <lucas.demarchi@intel.com> To: Balasubramani Vivekanandan <balasubramani.vivekanandan@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: Fri, 11 Mar 2022 10:40:28 -0800 [thread overview] Message-ID: <20220311184028.phqpfrnbzkryf2zs@ldmartin-desk2> (raw) In-Reply-To: <20220308164742.692540-1-balasubramani.vivekanandan@intel.com> 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
WARNING: multiple messages have this Message-ID (diff)
From: Lucas De Marchi <lucas.demarchi@intel.com> To: Balasubramani Vivekanandan <balasubramani.vivekanandan@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: Fri, 11 Mar 2022 10:40:28 -0800 [thread overview] Message-ID: <20220311184028.phqpfrnbzkryf2zs@ldmartin-desk2> (raw) In-Reply-To: <20220308164742.692540-1-balasubramani.vivekanandan@intel.com> 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
next prev parent reply other threads:[~2022-03-11 18:40 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-03-08 16:47 [PATCH] drm/i915/guc: Use iosys_map interface to update lrc_desc Balasubramani Vivekanandan 2022-03-08 16:47 ` [Intel-gfx] " 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 ` Lucas De Marchi [this message] 2022-03-11 18:40 ` [Intel-gfx] [PATCH] " Lucas De Marchi 2022-03-14 13:58 ` Balasubramani Vivekanandan 2022-03-14 13:58 ` [Intel-gfx] " Balasubramani Vivekanandan 2022-03-11 18:43 ` Lucas De Marchi 2022-03-11 18:43 ` [Intel-gfx] " Lucas De Marchi 2022-03-30 15:53 ` John Harrison 2022-03-30 15:53 ` [Intel-gfx] " John Harrison 2022-03-30 19:56 ` 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=20220311184028.phqpfrnbzkryf2zs@ldmartin-desk2 \ --to=lucas.demarchi@intel.com \ --cc=John.C.Harrison@intel.com \ --cc=balasubramani.vivekanandan@intel.com \ --cc=casey.g.bowman@intel.com \ --cc=daniele.ceraolospurio@intel.com \ --cc=dri-devel@lists.freedesktop.org \ --cc=intel-gfx@lists.freedesktop.org \ --cc=matthew.brost@intel.com \ --cc=michael.cheng@intel.com \ --cc=siva.mullati@intel.com \ --cc=umesh.nerlige.ramappa@intel.com \ --cc=wayne.boyer@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: linkBe 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.