Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Teres Alexis, Alan Previn" <alan.previn.teres.alexis@intel.com>
To: "Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Cc: "Nikula, Jani" <jani.nikula@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v5 1/1] drm/i915/pxp: Promote pxp subsystem to top-level of i915
Date: Wed, 30 Nov 2022 00:10:36 +0000	[thread overview]
Message-ID: <f7eeaed53842bdcae62e3fec9dc3fc879189afd5.camel@intel.com> (raw)
In-Reply-To: <Y4Z5ajHrt3hllvUZ@intel.com>

++Nikula if he has suggestions on the bottom most comment.

On Tue, 2022-11-29 at 16:28 -0500, Vivi, Rodrigo wrote:
> On Mon, Nov 28, 2022 at 04:31:52PM -0800, Alan Previn wrote:
> > Starting with MTL, there will be two GT-tiles, a render and media
> > tile. PXP as a service for supporting workloads with protected
> > contexts and protected buffers can be subscribed by process
> > workloads on any tile. However, depending on the platform,
> > only one of the tiles is used for control events pertaining to PXP
> > operation (such as creating the arbitration session and session
> > tear-down). In the case of MTL, this is the media-tile.
> 
> Imho this patch shows that having the pxp under i915 instead of gt
> is the right way to go.
> 
Alan: yes, agreed. 

> but I have a few comments and doubts below...
> 
> > 
> > 
Alan: [snip]

> > @@ -138,31 +144,63 @@ static void pxp_init_full(struct intel_pxp *pxp)
> >  	destroy_vcs_context(pxp);
> >  }
> >  
> > -void intel_pxp_init(struct intel_pxp *pxp)
> > +static struct intel_gt *pxp_get_kcr_owner_gt(struct drm_i915_private *i915)
> 
> pxp_get_ctrl_gt or pxp_get_serving_gt sounds better in my opinion...
> what's "owner"?
> 
Alan: Sure- will change to pxp_get_ctrl_gt (as per the name in the header file).

> >  {
> > -	struct intel_gt *gt = pxp_to_gt(pxp);
> > +	struct intel_gt *gt = NULL;
> > +	int i = 0;
> > +
> > +	for_each_gt(gt, i915, i) {
> > +		/* There can be only one GT that supports PXP */
> > +		if (HAS_ENGINE(gt, GSC0))
> > +			return gt;
> > +	}
> >  
> >  	/* we rely on the mei PXP module */
> > -	if (!IS_ENABLED(CONFIG_INTEL_MEI_PXP))
> > -		return;
> > +	if (IS_ENABLED(CONFIG_INTEL_MEI_PXP))
> > +		return &i915->gt0;
> > +
> > +	return NULL;
> > +}
> > +
> > +int intel_pxp_init(struct intel_pxp **pxp_store_ptr)
> 
> Please let's avoid the ** here and everywhere.
> 
Alan: In order to to avoid causing the entire driver into a rebuild because of any change in the intel_pxp structure,
the only way to accomplish that is to use a ptr in i915. But using a ptr means we allocate the memory at init time and
free it at fini time and those 2 cases would require the ptr-to-ptr to ensure we get the correct store. The only way i
can avoid the ** is be passing i915 as the param and then populating the ptr via i915->pxp. Would this work?

> > 
> > 
Alan:[snip]

> > @@ -12,12 +12,23 @@
> >  #include <linux/workqueue.h>
> >  
> >  struct intel_context;
> > +struct intel_gt;
> >  struct i915_pxp_component;
> > +struct drm_i915_private;
> >  
> >  /**
> >   * struct intel_pxp - pxp state
> >   */
> >  struct intel_pxp {
> > +	/** @i915: back poiner to i915*/
> > +	struct drm_i915_private *i915;
> 
> do you really need this pointer back here?
> or using a container_of should be enough?
> 
Alan: this is the same thing for above. We can use container_of if the caller passes the ptr-to-ptr ... if caller only
passes the pxp ptr, it will be passing, by reference, an allocated address. The only way I can think of to avoid this
is by dropping the ptr-to-ptr method and therefore pulling in the pxp type header into drm_i915_private header file -
which is againts the direction we are trying to head towards. (cc-ing Nikula is he has some ideas on this)
> 

  reply	other threads:[~2022-11-30  0:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29  0:31 [Intel-gfx] [PATCH v5 0/1] drm/i915/pxp: Prepare intel_pxp entry points for MTL Alan Previn
2022-11-29  0:31 ` [Intel-gfx] [PATCH v5 1/1] drm/i915/pxp: Promote pxp subsystem to top-level of i915 Alan Previn
2022-11-29 18:35   ` Teres Alexis, Alan Previn
2022-11-29 21:28   ` Rodrigo Vivi
2022-11-30  0:10     ` Teres Alexis, Alan Previn [this message]
2022-11-30  8:50       ` Jani Nikula
2022-12-01 19:06         ` Teres Alexis, Alan Previn
2022-12-01 23:45     ` Teres Alexis, Alan Previn
2022-11-29  0:51 ` [Intel-gfx] [PATCH v5 0/1] drm/i915/pxp: Prepare intel_pxp entry points for MTL Teres Alexis, Alan Previn
2022-11-29  0:53 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for " Patchwork
2022-11-29  1:07 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2022-11-29 21:29 ` [Intel-gfx] [PATCH v5 0/1] " Rodrigo Vivi
2022-11-30  0:35   ` Teres Alexis, Alan Previn

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=f7eeaed53842bdcae62e3fec9dc3fc879189afd5.camel@intel.com \
    --to=alan.previn.teres.alexis@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=rodrigo.vivi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox