diff mbox series

[5/5] drm/i915/mtl: don't expose GSC command streamer to the user

Message ID 20221027221554.2638087-6-daniele.ceraolospurio@intel.com (mailing list archive)
State New, archived
Headers show
Series Introduce the GSC CS | expand

Commit Message

Daniele Ceraolo Spurio Oct. 27, 2022, 10:15 p.m. UTC
There is no userspace user for this CS yet, we only need it for internal
kernel ops (e.g. HuC, PXP), so don't expose it.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_engine_user.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Matt Roper Oct. 28, 2022, 3:40 a.m. UTC | #1
On Thu, Oct 27, 2022 at 03:15:54PM -0700, Daniele Ceraolo Spurio wrote:
> There is no userspace user for this CS yet, we only need it for internal
> kernel ops (e.g. HuC, PXP), so don't expose it.
> 
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Matt Roper <matthew.d.roper@intel.com>

Since we never expose it to userspace, we also never get to the point of
doing an engine rename and removing the apostrophe.  I assume we're okay
with this engine continuing to show up as "other'6" in debug logs?

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

> ---
>  drivers/gpu/drm/i915/gt/intel_engine_user.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_user.c b/drivers/gpu/drm/i915/gt/intel_engine_user.c
> index 79312b734690..ca795daca116 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_user.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_user.c
> @@ -211,6 +211,10 @@ void intel_engines_driver_register(struct drm_i915_private *i915)
>  		if (intel_gt_has_unrecoverable_error(engine->gt))
>  			continue; /* ignore incomplete engines */
>  
> +		/* don't expose GSC engine to user */
> +		if (engine->class == OTHER_CLASS)
> +			continue;
> +
>  		GEM_BUG_ON(engine->class >= ARRAY_SIZE(uabi_classes));
>  		engine->uabi_class = uabi_classes[engine->class];
>  
> -- 
> 2.37.3
>
Daniele Ceraolo Spurio Oct. 28, 2022, 5:14 p.m. UTC | #2
On 10/27/2022 8:40 PM, Matt Roper wrote:
> On Thu, Oct 27, 2022 at 03:15:54PM -0700, Daniele Ceraolo Spurio wrote:
>> There is no userspace user for this CS yet, we only need it for internal
>> kernel ops (e.g. HuC, PXP), so don't expose it.
>>
>> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>> Cc: Matt Roper <matthew.d.roper@intel.com>
> Since we never expose it to userspace, we also never get to the point of
> doing an engine rename and removing the apostrophe.  I assume we're okay
> with this engine continuing to show up as "other'6" in debug logs?

I don't think it matters a lot in debug logs, but anyway it wouldn't be 
hard to rename it to something different. What do you suggest to rename 
it to? Since OTHER_CLASS doesn't have a uabi_class defined we can't use 
a count of engines of that type like we do for the other classes. Just 
rename it straight to hardcoded gsc0 ?

Daniele

>
> Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
>
>> ---
>>   drivers/gpu/drm/i915/gt/intel_engine_user.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_user.c b/drivers/gpu/drm/i915/gt/intel_engine_user.c
>> index 79312b734690..ca795daca116 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_engine_user.c
>> +++ b/drivers/gpu/drm/i915/gt/intel_engine_user.c
>> @@ -211,6 +211,10 @@ void intel_engines_driver_register(struct drm_i915_private *i915)
>>   		if (intel_gt_has_unrecoverable_error(engine->gt))
>>   			continue; /* ignore incomplete engines */
>>   
>> +		/* don't expose GSC engine to user */
>> +		if (engine->class == OTHER_CLASS)
>> +			continue;
>> +
>>   		GEM_BUG_ON(engine->class >= ARRAY_SIZE(uabi_classes));
>>   		engine->uabi_class = uabi_classes[engine->class];
>>   
>> -- 
>> 2.37.3
>>
Matt Roper Oct. 28, 2022, 6:01 p.m. UTC | #3
On Fri, Oct 28, 2022 at 10:14:05AM -0700, Ceraolo Spurio, Daniele wrote:
> 
> 
> On 10/27/2022 8:40 PM, Matt Roper wrote:
> > On Thu, Oct 27, 2022 at 03:15:54PM -0700, Daniele Ceraolo Spurio wrote:
> > > There is no userspace user for this CS yet, we only need it for internal
> > > kernel ops (e.g. HuC, PXP), so don't expose it.
> > > 
> > > Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> > > Cc: Matt Roper <matthew.d.roper@intel.com>
> > Since we never expose it to userspace, we also never get to the point of
> > doing an engine rename and removing the apostrophe.  I assume we're okay
> > with this engine continuing to show up as "other'6" in debug logs?
> 
> I don't think it matters a lot in debug logs, but anyway it wouldn't be hard
> to rename it to something different. What do you suggest to rename it to?
> Since OTHER_CLASS doesn't have a uabi_class defined we can't use a count of
> engines of that type like we do for the other classes. Just rename it
> straight to hardcoded gsc0 ?

Yeah, a hardcoded "gsc0" seems fine to me.  I agree it doesn't matter
too much either way, so I'll leave it up to you whether you add that
rename or not.


Matt

> 
> Daniele
> 
> > 
> > Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
> > 
> > > ---
> > >   drivers/gpu/drm/i915/gt/intel_engine_user.c | 4 ++++
> > >   1 file changed, 4 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/gt/intel_engine_user.c b/drivers/gpu/drm/i915/gt/intel_engine_user.c
> > > index 79312b734690..ca795daca116 100644
> > > --- a/drivers/gpu/drm/i915/gt/intel_engine_user.c
> > > +++ b/drivers/gpu/drm/i915/gt/intel_engine_user.c
> > > @@ -211,6 +211,10 @@ void intel_engines_driver_register(struct drm_i915_private *i915)
> > >   		if (intel_gt_has_unrecoverable_error(engine->gt))
> > >   			continue; /* ignore incomplete engines */
> > > +		/* don't expose GSC engine to user */
> > > +		if (engine->class == OTHER_CLASS)
> > > +			continue;
> > > +
> > >   		GEM_BUG_ON(engine->class >= ARRAY_SIZE(uabi_classes));
> > >   		engine->uabi_class = uabi_classes[engine->class];
> > > -- 
> > > 2.37.3
> > > 
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_engine_user.c b/drivers/gpu/drm/i915/gt/intel_engine_user.c
index 79312b734690..ca795daca116 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_user.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_user.c
@@ -211,6 +211,10 @@  void intel_engines_driver_register(struct drm_i915_private *i915)
 		if (intel_gt_has_unrecoverable_error(engine->gt))
 			continue; /* ignore incomplete engines */
 
+		/* don't expose GSC engine to user */
+		if (engine->class == OTHER_CLASS)
+			continue;
+
 		GEM_BUG_ON(engine->class >= ARRAY_SIZE(uabi_classes));
 		engine->uabi_class = uabi_classes[engine->class];