[Intel-gfx] [PATCH] drm/i915: expose energy counter on SNB and IVB
Daniel Vetter
daniel at ffwll.ch
Sun Jun 24 12:01:24 CEST 2012
On Fri, Jun 22, 2012 at 07:04:29PM -0700, Ben Widawsky wrote:
> On Wed, 20 Jun 2012 14:48:58 -0700
> Jesse Barnes <jbarnes at virtuousgeek.org> wrote:
> > +static struct attribute *gt_attrs[] = {
> > + &dev_attr_gt_energy_uJ.attr,
> > + NULL,
> > +};
>
> I think convention dictates it should be all lowercase. And while on
> that, gt_energy_uJ is about as descriptive a name as rc6 (what jerk
> named that anyway?). I think something like consumed_microjoules is
> better.
I admit that the uJ makes tons of sense for me - J is the official SI
abbrev. for joules (I'm a bit unsure about u for \mu, but it seems to be
customary). Adding consumed makes some sense I think, but otherwise it's
imo good if we stick with the names vpg ppl have come up. So
gt_consumed_energy_uJ anyone? I can bikeshed this name while applying ...
-Daniel
>
> > +
> > +static struct attribute_group gt_attr_group = {
> > + .name = power_group_name,
> > + .attrs = gt_attrs,
> > +};
> > +
> > static int l3_access_valid(struct drm_device *dev, loff_t offset)
> > {
> > if (!IS_IVYBRIDGE(dev))
> > @@ -217,10 +248,18 @@ void i915_setup_sysfs(struct drm_device *dev)
> > if (ret)
> > DRM_ERROR("l3 parity sysfs setup failed\n");
> > }
> > +
> > + if (IS_GEN6(dev) || IS_IVYBRIDGE(dev)) {
> > + ret = sysfs_merge_group(&dev->primary->kdev.kobj,
> > + >_attr_group);
> > + if (ret)
> > + DRM_ERROR("GT energy sysfs setup failed\n");
> > + }
> > }
> >
> > void i915_teardown_sysfs(struct drm_device *dev)
> > {
> > device_remove_bin_file(&dev->primary->kdev, &dpf_attrs);
> > sysfs_unmerge_group(&dev->primary->kdev.kobj, &rc6_attr_group);
> > + sysfs_unmerge_group(&dev->primary->kdev.kobj, >_attr_group);
> > }
>
> teardown should occur in reverse of init, so I'd put this on top.
>
>
>
> --
> Ben Widawsky, Intel Open Source Technology Center
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48
More information about the Intel-gfx
mailing list