[Intel-gfx] [PATCH 1/5] drm/i915: Use local variable for SSEU info in GETPARAM ioctl

Summers, Stuart stuart.summers at intel.com
Wed May 1 00:38:18 UTC 2019


On Tue, 2019-04-30 at 11:58 +0300, Jani Nikula wrote:
> On Mon, 29 Apr 2019, Stuart Summers <stuart.summers at intel.com> wrote:
> > In the GETPARAM ioctl handler, use a local variable to consolidate
> > usage of SSEU runtime info.
> > 
> > Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
> > Signed-off-by: Stuart Summers <stuart.summers at intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.c | 11 ++++++-----
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c
> > b/drivers/gpu/drm/i915/i915_drv.c
> > index aacc8dd6ecfd..b6ce7580d414 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -321,6 +321,7 @@ static int i915_getparam_ioctl(struct
> > drm_device *dev, void *data,
> >  {
> >  	struct drm_i915_private *dev_priv = to_i915(dev);
> >  	struct pci_dev *pdev = dev_priv->drm.pdev;
> > +	struct sseu_dev_info *sseu = &RUNTIME_INFO(dev_priv)->sseu;
> 
> const?

Somehow I had missed this email, sorry for the late response. I'll make
this change and post a quick update.

Thanks,
Stuart

> 
> >  	drm_i915_getparam_t *param = data;
> >  	int value;
> >  
> > @@ -374,12 +375,12 @@ static int i915_getparam_ioctl(struct
> > drm_device *dev, void *data,
> >  		value = i915_cmd_parser_get_version(dev_priv);
> >  		break;
> >  	case I915_PARAM_SUBSLICE_TOTAL:
> > -		value = sseu_subslice_total(&RUNTIME_INFO(dev_priv)-
> > >sseu);
> > +		value = sseu_subslice_total(sseu);
> >  		if (!value)
> >  			return -ENODEV;
> >  		break;
> >  	case I915_PARAM_EU_TOTAL:
> > -		value = RUNTIME_INFO(dev_priv)->sseu.eu_total;
> > +		value = sseu->eu_total;
> >  		if (!value)
> >  			return -ENODEV;
> >  		break;
> > @@ -396,7 +397,7 @@ static int i915_getparam_ioctl(struct
> > drm_device *dev, void *data,
> >  		value = HAS_POOLED_EU(dev_priv);
> >  		break;
> >  	case I915_PARAM_MIN_EU_IN_POOL:
> > -		value = RUNTIME_INFO(dev_priv)->sseu.min_eu_in_pool;
> > +		value = sseu->min_eu_in_pool;
> >  		break;
> >  	case I915_PARAM_HUC_STATUS:
> >  		value = intel_huc_check_status(&dev_priv->huc);
> > @@ -446,12 +447,12 @@ static int i915_getparam_ioctl(struct
> > drm_device *dev, void *data,
> >  		value = intel_engines_has_context_isolation(dev_priv);
> >  		break;
> >  	case I915_PARAM_SLICE_MASK:
> > -		value = RUNTIME_INFO(dev_priv)->sseu.slice_mask;
> > +		value = sseu->slice_mask;
> >  		if (!value)
> >  			return -ENODEV;
> >  		break;
> >  	case I915_PARAM_SUBSLICE_MASK:
> > -		value = RUNTIME_INFO(dev_priv)->sseu.subslice_mask[0];
> > +		value = sseu->subslice_mask[0];
> >  		if (!value)
> >  			return -ENODEV;
> >  		break;
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3270 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20190501/62e4e8e5/attachment.bin>


More information about the Intel-gfx mailing list