[Intel-xe] [PATCH 1/3] drm/xe: Change the name of frequency sysfs attributes

Rodrigo Vivi rodrigo.vivi at intel.com
Fri Dec 8 05:29:31 UTC 2023


On Fri, Dec 08, 2023 at 10:45:01AM +0530, Riana Tauro wrote:
> 
> 
> On 12/8/2023 10:17 AM, Rodrigo Vivi wrote:
> > On Thu, Dec 07, 2023 at 11:04:04AM +0530, Riana Tauro wrote:
> > > Hi Rodrigo/Suja
> > > 
> > > These changes are removed again in the second patch.
> > 
> > What? they are not. The final result is something_freq.
> 
> The changes made in the guc_pc in this patch are removed and function name
> changed to be called from the freq sysfs layer in the next patch.
> 
> 
> -static ssize_t cur_freq_show(struct device *dev,
> -			     struct device_attribute *attr, char *buf)
> +/**
> + * xe_guc_pc_get_cur_freq - Get Current requested frequency

but without the patch the name of this function would probably
be xe_guc_pc_get_freq_cur
or xe_guc_pc_freq_cur_get

> 
> 
> The next patch changes the name as well. So it is aligning to devfreq.

okay, I see your angle: that all the renaming could be done
in a single patch...
but to be honest I prefer to keep this one here since it was a good base
and separate... also had a separate igt simple patch.

> 
> > 
> > The next patch is based on this.
> > 
> > > Is this patch required?
> > 
> > and both are required if we want to be prepared for a
> > possible alignment with devfreq.
> > 
> > > 
> > > Thanks
> > > Riana
> > > 
> > > On 12/6/2023 3:06 AM, Rodrigo Vivi wrote:
> > > > From: Sujaritha Sundaresan <sujaritha.sundaresan at intel.com>
> > > > 
> > > > Switching the names of frequency sysfs attrbutes to align with
> > > > required devfreq changes. The name changes are as below;
> > > > 
> > > > -freq_act -> act_freq
> > > > -freq_cur -> cur_freq
> > > > -freq_rpn -> rpn_freq
> > > > -freq_rpe -> rpe_freq
> > > > -freq_rp0 -> rp0_freq
> > > > -freq_min -> min_freq
> > > > -freq_max -> max_freq
> > > > 
> > > > Signed-off-by: Sujaritha Sundaresan <sujaritha.sundaresan at intel.com>
> > > > Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> > > > ---
> > > >    drivers/gpu/drm/xe/xe_guc_pc.c | 60 +++++++++++++++++-----------------
> > > >    1 file changed, 30 insertions(+), 30 deletions(-)
> > > > 
> > > > diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c
> > > > index d2605a684b1c..b1876fbea669 100644
> > > > --- a/drivers/gpu/drm/xe/xe_guc_pc.c
> > > > +++ b/drivers/gpu/drm/xe/xe_guc_pc.c
> > > > @@ -60,15 +60,15 @@
> > > >     * Xe's GuC PC provides a sysfs API for frequency management:
> > > >     *
> > > >     * device/gt#/freq_* *read-only* files:
> > > > - * - freq_act: The actual resolved frequency decided by PCODE.
> > > > - * - freq_cur: The current one requested by GuC PC to the Hardware.
> > > > - * - freq_rpn: The Render Performance (RP) N level, which is the minimal one.
> > > > - * - freq_rpe: The Render Performance (RP) E level, which is the efficient one.
> > > > - * - freq_rp0: The Render Performance (RP) 0 level, which is the maximum one.
> > > > + * - act_freq: The actual resolved frequency decided by PCODE.
> > > > + * - cur_freq: The current one requested by GuC PC to the Hardware.
> > > > + * - rpn_freq: The Render Performance (RP) N level, which is the minimal one.
> > > > + * - rpe_freq: The Render Performance (RP) E level, which is the efficient one.
> > > > + * - rp0_freq: The Render Performance (RP) 0 level, which is the maximum one.
> > > >     *
> > > >     * device/gt#/freq_* *read-write* files:
> > > > - * - freq_min: GuC PC min request.
> > > > - * - freq_max: GuC PC max request.
> > > > + * - min_freq: GuC PC min request.
> > > > + * - max_freq: GuC PC max request.
> > > >     *             If max <= min, then freq_min becomes a fixed frequency request.
> > > >     *
> > > >     * Render-C States:
> > > > @@ -388,7 +388,7 @@ static void pc_update_rp_values(struct xe_guc_pc *pc)
> > > >    	pc->rpn_freq = min(pc->rpn_freq, pc->rpe_freq);
> > > >    }
> > > > -static ssize_t freq_act_show(struct device *dev,
> > > > +static ssize_t act_freq_show(struct device *dev,
> > > >    			     struct device_attribute *attr, char *buf)
> > > >    {
> > > >    	struct kobject *kobj = &dev->kobj;
> > > > @@ -413,9 +413,9 @@ static ssize_t freq_act_show(struct device *dev,
> > > >    	xe_device_mem_access_put(gt_to_xe(gt));
> > > >    	return ret;
> > > >    }
> > > > -static DEVICE_ATTR_RO(freq_act);
> > > > +static DEVICE_ATTR_RO(act_freq);
> > > > -static ssize_t freq_cur_show(struct device *dev,
> > > > +static ssize_t cur_freq_show(struct device *dev,
> > > >    			     struct device_attribute *attr, char *buf)
> > > >    {
> > > >    	struct kobject *kobj = &dev->kobj;
> > > > @@ -442,18 +442,18 @@ static ssize_t freq_cur_show(struct device *dev,
> > > >    	xe_device_mem_access_put(gt_to_xe(gt));
> > > >    	return ret;
> > > >    }
> > > > -static DEVICE_ATTR_RO(freq_cur);
> > > > +static DEVICE_ATTR_RO(cur_freq);
> > > > -static ssize_t freq_rp0_show(struct device *dev,
> > > > +static ssize_t rp0_freq_show(struct device *dev,
> > > >    			     struct device_attribute *attr, char *buf)
> > > >    {
> > > >    	struct xe_guc_pc *pc = dev_to_pc(dev);
> > > >    	return sysfs_emit(buf, "%d\n", pc->rp0_freq);
> > > >    }
> > > > -static DEVICE_ATTR_RO(freq_rp0);
> > > > +static DEVICE_ATTR_RO(rp0_freq);
> > > > -static ssize_t freq_rpe_show(struct device *dev,
> > > > +static ssize_t rpe_freq_show(struct device *dev,
> > > >    			     struct device_attribute *attr, char *buf)
> > > >    {
> > > >    	struct xe_guc_pc *pc = dev_to_pc(dev);
> > > > @@ -465,18 +465,18 @@ static ssize_t freq_rpe_show(struct device *dev,
> > > >    	xe_device_mem_access_put(xe);
> > > >    	return sysfs_emit(buf, "%d\n", pc->rpe_freq);
> > > >    }
> > > > -static DEVICE_ATTR_RO(freq_rpe);
> > > > +static DEVICE_ATTR_RO(rpe_freq);
> > > > -static ssize_t freq_rpn_show(struct device *dev,
> > > > +static ssize_t rpn_freq_show(struct device *dev,
> > > >    			     struct device_attribute *attr, char *buf)
> > > >    {
> > > >    	struct xe_guc_pc *pc = dev_to_pc(dev);
> > > >    	return sysfs_emit(buf, "%d\n", pc->rpn_freq);
> > > >    }
> > > > -static DEVICE_ATTR_RO(freq_rpn);
> > > > +static DEVICE_ATTR_RO(rpn_freq);
> > > > -static ssize_t freq_min_show(struct device *dev,
> > > > +static ssize_t min_freq_show(struct device *dev,
> > > >    			     struct device_attribute *attr, char *buf)
> > > >    {
> > > >    	struct xe_guc_pc *pc = dev_to_pc(dev);
> > > > @@ -513,7 +513,7 @@ static ssize_t freq_min_show(struct device *dev,
> > > >    	return ret;
> > > >    }
> > > > -static ssize_t freq_min_store(struct device *dev, struct device_attribute *attr,
> > > > +static ssize_t min_freq_store(struct device *dev, struct device_attribute *attr,
> > > >    			      const char *buff, size_t count)
> > > >    {
> > > >    	struct xe_guc_pc *pc = dev_to_pc(dev);
> > > > @@ -543,9 +543,9 @@ static ssize_t freq_min_store(struct device *dev, struct device_attribute *attr,
> > > >    	xe_device_mem_access_put(pc_to_xe(pc));
> > > >    	return ret ?: count;
> > > >    }
> > > > -static DEVICE_ATTR_RW(freq_min);
> > > > +static DEVICE_ATTR_RW(min_freq);
> > > > -static ssize_t freq_max_show(struct device *dev,
> > > > +static ssize_t max_freq_show(struct device *dev,
> > > >    			     struct device_attribute *attr, char *buf)
> > > >    {
> > > >    	struct xe_guc_pc *pc = dev_to_pc(dev);
> > > > @@ -571,7 +571,7 @@ static ssize_t freq_max_show(struct device *dev,
> > > >    	return ret;
> > > >    }
> > > > -static ssize_t freq_max_store(struct device *dev, struct device_attribute *attr,
> > > > +static ssize_t max_freq_store(struct device *dev, struct device_attribute *attr,
> > > >    			      const char *buff, size_t count)
> > > >    {
> > > >    	struct xe_guc_pc *pc = dev_to_pc(dev);
> > > > @@ -601,7 +601,7 @@ static ssize_t freq_max_store(struct device *dev, struct device_attribute *attr,
> > > >    	xe_device_mem_access_put(pc_to_xe(pc));
> > > >    	return ret ?: count;
> > > >    }
> > > > -static DEVICE_ATTR_RW(freq_max);
> > > > +static DEVICE_ATTR_RW(max_freq);
> > > >    /**
> > > >     * xe_guc_pc_c_status - get the current GT C state
> > > > @@ -667,13 +667,13 @@ u64 xe_guc_pc_mc6_residency(struct xe_guc_pc *pc)
> > > >    }
> > > >    static const struct attribute *pc_attrs[] = {
> > > > -	&dev_attr_freq_act.attr,
> > > > -	&dev_attr_freq_cur.attr,
> > > > -	&dev_attr_freq_rp0.attr,
> > > > -	&dev_attr_freq_rpe.attr,
> > > > -	&dev_attr_freq_rpn.attr,
> > > > -	&dev_attr_freq_min.attr,
> > > > -	&dev_attr_freq_max.attr,
> > > > +	&dev_attr_act_freq.attr,
> > > > +	&dev_attr_cur_freq.attr,
> > > > +	&dev_attr_rp0_freq.attr,
> > > > +	&dev_attr_rpe_freq.attr,
> > > > +	&dev_attr_rpn_freq.attr,
> > > > +	&dev_attr_min_freq.attr,
> > > > +	&dev_attr_max_freq.attr,
> > > >    	NULL
> > > >    };


More information about the Intel-xe mailing list