aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_sysfs.c')
-rw-r--r--drivers/gpu/drm/i915/i915_sysfs.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index 503847f18fdd..4a5af695307e 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -139,8 +139,6 @@ static DEVICE_ATTR(rc6pp_residency_ms, S_IRUGO, show_rc6pp_ms, NULL);
139static struct attribute *rc6_attrs[] = { 139static struct attribute *rc6_attrs[] = {
140 &dev_attr_rc6_enable.attr, 140 &dev_attr_rc6_enable.attr,
141 &dev_attr_rc6_residency_ms.attr, 141 &dev_attr_rc6_residency_ms.attr,
142 &dev_attr_rc6p_residency_ms.attr,
143 &dev_attr_rc6pp_residency_ms.attr,
144 NULL 142 NULL
145}; 143};
146 144
@@ -148,6 +146,17 @@ static struct attribute_group rc6_attr_group = {
148 .name = power_group_name, 146 .name = power_group_name,
149 .attrs = rc6_attrs 147 .attrs = rc6_attrs
150}; 148};
149
150static struct attribute *rc6p_attrs[] = {
151 &dev_attr_rc6p_residency_ms.attr,
152 &dev_attr_rc6pp_residency_ms.attr,
153 NULL
154};
155
156static struct attribute_group rc6p_attr_group = {
157 .name = power_group_name,
158 .attrs = rc6p_attrs
159};
151#endif 160#endif
152 161
153static int l3_access_valid(struct drm_device *dev, loff_t offset) 162static int l3_access_valid(struct drm_device *dev, loff_t offset)
@@ -595,12 +604,18 @@ void i915_setup_sysfs(struct drm_device *dev)
595 int ret; 604 int ret;
596 605
597#ifdef CONFIG_PM 606#ifdef CONFIG_PM
598 if (INTEL_INFO(dev)->gen >= 6) { 607 if (HAS_RC6(dev)) {
599 ret = sysfs_merge_group(&dev->primary->kdev->kobj, 608 ret = sysfs_merge_group(&dev->primary->kdev->kobj,
600 &rc6_attr_group); 609 &rc6_attr_group);
601 if (ret) 610 if (ret)
602 DRM_ERROR("RC6 residency sysfs setup failed\n"); 611 DRM_ERROR("RC6 residency sysfs setup failed\n");
603 } 612 }
613 if (HAS_RC6p(dev)) {
614 ret = sysfs_merge_group(&dev->primary->kdev->kobj,
615 &rc6p_attr_group);
616 if (ret)
617 DRM_ERROR("RC6p residency sysfs setup failed\n");
618 }
604#endif 619#endif
605 if (HAS_L3_DPF(dev)) { 620 if (HAS_L3_DPF(dev)) {
606 ret = device_create_bin_file(dev->primary->kdev, &dpf_attrs); 621 ret = device_create_bin_file(dev->primary->kdev, &dpf_attrs);
@@ -640,5 +655,6 @@ void i915_teardown_sysfs(struct drm_device *dev)
640 device_remove_bin_file(dev->primary->kdev, &dpf_attrs); 655 device_remove_bin_file(dev->primary->kdev, &dpf_attrs);
641#ifdef CONFIG_PM 656#ifdef CONFIG_PM
642 sysfs_unmerge_group(&dev->primary->kdev->kobj, &rc6_attr_group); 657 sysfs_unmerge_group(&dev->primary->kdev->kobj, &rc6_attr_group);
658 sysfs_unmerge_group(&dev->primary->kdev->kobj, &rc6p_attr_group);
643#endif 659#endif
644} 660}