[Intel-gfx] [PATCH] drm/i915/gt: make a gt sysfs group and move power management files
Chris Wilson
chris at chris-wilson.co.uk
Fri Feb 14 13:14:31 UTC 2020
Quoting Andi Shyti (2020-02-14 11:03:08)
> +struct intel_gt *intel_gt_sysfs_get_drvdata(struct device *dev)
> +{
> + struct kobject *kobj = &dev->kobj;
> + /*
> + * We are interested at knowing from where the interface
> + * has been called, whether it's called from gt/ or from
> + * the parent directory.
> + * From the interface position it depends also the value of
> + * the private data.
> + * If the interface is called from gt/ then private data is
> + * of the "struct intel_gt *" type, otherwise it's * a
> + * "struct drm_i915_private *" type.
> + */
> + if (strcmp(dev->kobj.name, "gt")) {
> + struct drm_i915_private *i915 = kdev_minor_to_i915(dev);
> +
> + drm_warn(&i915->drm, "the interface is obsolete, use gt/\n");
> + return &i915->gt;
I guess it's not possible to flesh this out with path? And we do need it
to be warn_once else the user will be flooded.
One final request, can we also put the old entries under
CONFIG_DRM_I915_SYSFS_OBSOLETE_GT (or somesuch)
As far as the naming goes, the compromise isn't horrendous.
-Chris
More information about the Intel-gfx
mailing list