diff mbox

[7/7] drm/i915: Add media rc6 residency file to sysfs

Message ID 1421668253-18641-8-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjala Jan. 19, 2015, 11:50 a.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

On VLV/CHV the media well rc6 residency gets reported separately
from the render well, so add another file to sysfs so that we can
report the residency to the user.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_sysfs.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

Comments

Chris Wilson Jan. 19, 2015, 12:27 p.m. UTC | #1
On Mon, Jan 19, 2015 at 01:50:53PM +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> On VLV/CHV the media well rc6 residency gets reported separately
> from the render well, so add another file to sysfs so that we can
> report the residency to the user.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

To be extended in future I am sure.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Shuang He Jan. 19, 2015, 7:16 p.m. UTC | #2
Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 5603
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV                 -1              353/353              352/353
ILK                                  353/353              353/353
SNB                                  400/422              400/422
IVB                                  487/487              487/487
BYT                                  296/296              296/296
HSW              +21                 487/508              508/508
BDW                                  401/402              401/402
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
*PNV  igt_gen3_render_linear_blits      PASS(5, M25M23)      CRASH(1, M23)
 HSW  igt_kms_cursor_crc_cursor-size-change      NSPT(1, M19)TIMEOUT(1, M40)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_kms_fence_pin_leak      NSPT(1, M19)DMESG_WARN(1, M40)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_kms_mmio_vs_cs_flip_setcrtc_vs_cs_flip      NSPT(1, M19)TIMEOUT(1, M40)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_kms_mmio_vs_cs_flip_setplane_vs_cs_flip      NSPT(1, M19)TIMEOUT(1, M40)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_lpsp_non-edp      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_cursor      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_cursor-dpms      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_dpms-mode-unset-non-lpsp      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_dpms-non-lpsp      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_drm-resources-equal      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_fences      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_fences-dpms      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_gem-execbuf      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_gem-mmap-cpu      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_gem-mmap-gtt      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_gem-pread      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_i2c      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_modeset-non-lpsp      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_modeset-non-lpsp-stress-no-wait      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_pci-d3-state      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_rte      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
Note: You need to pay more attention to line start with '*'
deepak.s@linux.intel.com Jan. 20, 2015, 3:24 a.m. UTC | #3
On Monday 19 January 2015 05:20 PM, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> On VLV/CHV the media well rc6 residency gets reported separately
> from the render well, so add another file to sysfs so that we can
> report the residency to the user.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Looks like we missed Media well completely :) and I think we need igt test to verify media residency?

Reviewed-by: Deepak S<deepak.s@linux.intel.com>

> ---
>   drivers/gpu/drm/i915/i915_sysfs.c | 25 +++++++++++++++++++++++++
>   1 file changed, 25 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
> index 1ca944b..db14d3e 100644
> --- a/drivers/gpu/drm/i915/i915_sysfs.c
> +++ b/drivers/gpu/drm/i915/i915_sysfs.c
> @@ -127,10 +127,19 @@ show_rc6pp_ms(struct device *kdev, struct device_attribute *attr, char *buf)
>   	return snprintf(buf, PAGE_SIZE, "%u\n", rc6pp_residency);
>   }
>   
> +static ssize_t
> +show_media_rc6_ms(struct device *kdev, struct device_attribute *attr, char *buf)
> +{
> +	struct drm_minor *dminor = dev_get_drvdata(kdev);
> +	u32 rc6_residency = calc_residency(dminor->dev, VLV_GT_MEDIA_RC6);
> +	return snprintf(buf, PAGE_SIZE, "%u\n", rc6_residency);
> +}
> +
>   static DEVICE_ATTR(rc6_enable, S_IRUGO, show_rc6_mask, NULL);
>   static DEVICE_ATTR(rc6_residency_ms, S_IRUGO, show_rc6_ms, NULL);
>   static DEVICE_ATTR(rc6p_residency_ms, S_IRUGO, show_rc6p_ms, NULL);
>   static DEVICE_ATTR(rc6pp_residency_ms, S_IRUGO, show_rc6pp_ms, NULL);
> +static DEVICE_ATTR(media_rc6_residency_ms, S_IRUGO, show_media_rc6_ms, NULL);
>   
>   static struct attribute *rc6_attrs[] = {
>   	&dev_attr_rc6_enable.attr,
> @@ -153,6 +162,16 @@ static struct attribute_group rc6p_attr_group = {
>   	.name = power_group_name,
>   	.attrs =  rc6p_attrs
>   };
> +
> +static struct attribute *media_rc6_attrs[] = {
> +	&dev_attr_media_rc6_residency_ms.attr,
> +	NULL
> +};
> +
> +static struct attribute_group media_rc6_attr_group = {
> +	.name = power_group_name,
> +	.attrs =  media_rc6_attrs
> +};
>   #endif
>   
>   static int l3_access_valid(struct drm_device *dev, loff_t offset)
> @@ -612,6 +631,12 @@ void i915_setup_sysfs(struct drm_device *dev)
>   		if (ret)
>   			DRM_ERROR("RC6p residency sysfs setup failed\n");
>   	}
> +	if (IS_VALLEYVIEW(dev)) {
> +		ret = sysfs_merge_group(&dev->primary->kdev->kobj,
> +					&media_rc6_attr_group);
> +		if (ret)
> +			DRM_ERROR("Media RC6 residency sysfs setup failed\n");
> +	}
>   #endif
>   	if (HAS_L3_DPF(dev)) {
>   		ret = device_create_bin_file(dev->primary->kdev, &dpf_attrs);
Daniel Vetter Jan. 20, 2015, 8:50 a.m. UTC | #4
On Tue, Jan 20, 2015 at 08:54:58AM +0530, Deepak S wrote:
> 
> On Monday 19 January 2015 05:20 PM, ville.syrjala@linux.intel.com wrote:
> >From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> >On VLV/CHV the media well rc6 residency gets reported separately
> >from the render well, so add another file to sysfs so that we can
> >report the residency to the user.
> >
> >Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Looks like we missed Media well completely :) and I think we need igt test to verify media residency?

Indeed, Testcase: line is missing. And unfortunately the current testcase
is severly broken, so there's some work to be done there.

I've merged all the other patches from this series.

Thanks, Daniel
> 
> Reviewed-by: Deepak S<deepak.s@linux.intel.com>
> 
> >---
> >  drivers/gpu/drm/i915/i915_sysfs.c | 25 +++++++++++++++++++++++++
> >  1 file changed, 25 insertions(+)
> >
> >diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
> >index 1ca944b..db14d3e 100644
> >--- a/drivers/gpu/drm/i915/i915_sysfs.c
> >+++ b/drivers/gpu/drm/i915/i915_sysfs.c
> >@@ -127,10 +127,19 @@ show_rc6pp_ms(struct device *kdev, struct device_attribute *attr, char *buf)
> >  	return snprintf(buf, PAGE_SIZE, "%u\n", rc6pp_residency);
> >  }
> >+static ssize_t
> >+show_media_rc6_ms(struct device *kdev, struct device_attribute *attr, char *buf)
> >+{
> >+	struct drm_minor *dminor = dev_get_drvdata(kdev);
> >+	u32 rc6_residency = calc_residency(dminor->dev, VLV_GT_MEDIA_RC6);
> >+	return snprintf(buf, PAGE_SIZE, "%u\n", rc6_residency);
> >+}
> >+
> >  static DEVICE_ATTR(rc6_enable, S_IRUGO, show_rc6_mask, NULL);
> >  static DEVICE_ATTR(rc6_residency_ms, S_IRUGO, show_rc6_ms, NULL);
> >  static DEVICE_ATTR(rc6p_residency_ms, S_IRUGO, show_rc6p_ms, NULL);
> >  static DEVICE_ATTR(rc6pp_residency_ms, S_IRUGO, show_rc6pp_ms, NULL);
> >+static DEVICE_ATTR(media_rc6_residency_ms, S_IRUGO, show_media_rc6_ms, NULL);
> >  static struct attribute *rc6_attrs[] = {
> >  	&dev_attr_rc6_enable.attr,
> >@@ -153,6 +162,16 @@ static struct attribute_group rc6p_attr_group = {
> >  	.name = power_group_name,
> >  	.attrs =  rc6p_attrs
> >  };
> >+
> >+static struct attribute *media_rc6_attrs[] = {
> >+	&dev_attr_media_rc6_residency_ms.attr,
> >+	NULL
> >+};
> >+
> >+static struct attribute_group media_rc6_attr_group = {
> >+	.name = power_group_name,
> >+	.attrs =  media_rc6_attrs
> >+};
> >  #endif
> >  static int l3_access_valid(struct drm_device *dev, loff_t offset)
> >@@ -612,6 +631,12 @@ void i915_setup_sysfs(struct drm_device *dev)
> >  		if (ret)
> >  			DRM_ERROR("RC6p residency sysfs setup failed\n");
> >  	}
> >+	if (IS_VALLEYVIEW(dev)) {
> >+		ret = sysfs_merge_group(&dev->primary->kdev->kobj,
> >+					&media_rc6_attr_group);
> >+		if (ret)
> >+			DRM_ERROR("Media RC6 residency sysfs setup failed\n");
> >+	}
> >  #endif
> >  	if (HAS_L3_DPF(dev)) {
> >  		ret = device_create_bin_file(dev->primary->kdev, &dpf_attrs);
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ville Syrjala Jan. 20, 2015, 9:30 a.m. UTC | #5
On Tue, Jan 20, 2015 at 09:50:36AM +0100, Daniel Vetter wrote:
> On Tue, Jan 20, 2015 at 08:54:58AM +0530, Deepak S wrote:
> > 
> > On Monday 19 January 2015 05:20 PM, ville.syrjala@linux.intel.com wrote:
> > >From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > >
> > >On VLV/CHV the media well rc6 residency gets reported separately
> > >from the render well, so add another file to sysfs so that we can
> > >report the residency to the user.
> > >
> > >Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Looks like we missed Media well completely :) and I think we need igt test to verify media residency?
> 
> Indeed, Testcase: line is missing. And unfortunately the current testcase
> is severly broken, so there's some work to be done there.

Do we have any volunteers? I have a boatload of bigger fish to fry at
the moment so can't take up another project.

> 
> I've merged all the other patches from this series.
> 
> Thanks, Daniel
> > 
> > Reviewed-by: Deepak S<deepak.s@linux.intel.com>
> > 
> > >---
> > >  drivers/gpu/drm/i915/i915_sysfs.c | 25 +++++++++++++++++++++++++
> > >  1 file changed, 25 insertions(+)
> > >
> > >diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
> > >index 1ca944b..db14d3e 100644
> > >--- a/drivers/gpu/drm/i915/i915_sysfs.c
> > >+++ b/drivers/gpu/drm/i915/i915_sysfs.c
> > >@@ -127,10 +127,19 @@ show_rc6pp_ms(struct device *kdev, struct device_attribute *attr, char *buf)
> > >  	return snprintf(buf, PAGE_SIZE, "%u\n", rc6pp_residency);
> > >  }
> > >+static ssize_t
> > >+show_media_rc6_ms(struct device *kdev, struct device_attribute *attr, char *buf)
> > >+{
> > >+	struct drm_minor *dminor = dev_get_drvdata(kdev);
> > >+	u32 rc6_residency = calc_residency(dminor->dev, VLV_GT_MEDIA_RC6);
> > >+	return snprintf(buf, PAGE_SIZE, "%u\n", rc6_residency);
> > >+}
> > >+
> > >  static DEVICE_ATTR(rc6_enable, S_IRUGO, show_rc6_mask, NULL);
> > >  static DEVICE_ATTR(rc6_residency_ms, S_IRUGO, show_rc6_ms, NULL);
> > >  static DEVICE_ATTR(rc6p_residency_ms, S_IRUGO, show_rc6p_ms, NULL);
> > >  static DEVICE_ATTR(rc6pp_residency_ms, S_IRUGO, show_rc6pp_ms, NULL);
> > >+static DEVICE_ATTR(media_rc6_residency_ms, S_IRUGO, show_media_rc6_ms, NULL);
> > >  static struct attribute *rc6_attrs[] = {
> > >  	&dev_attr_rc6_enable.attr,
> > >@@ -153,6 +162,16 @@ static struct attribute_group rc6p_attr_group = {
> > >  	.name = power_group_name,
> > >  	.attrs =  rc6p_attrs
> > >  };
> > >+
> > >+static struct attribute *media_rc6_attrs[] = {
> > >+	&dev_attr_media_rc6_residency_ms.attr,
> > >+	NULL
> > >+};
> > >+
> > >+static struct attribute_group media_rc6_attr_group = {
> > >+	.name = power_group_name,
> > >+	.attrs =  media_rc6_attrs
> > >+};
> > >  #endif
> > >  static int l3_access_valid(struct drm_device *dev, loff_t offset)
> > >@@ -612,6 +631,12 @@ void i915_setup_sysfs(struct drm_device *dev)
> > >  		if (ret)
> > >  			DRM_ERROR("RC6p residency sysfs setup failed\n");
> > >  	}
> > >+	if (IS_VALLEYVIEW(dev)) {
> > >+		ret = sysfs_merge_group(&dev->primary->kdev->kobj,
> > >+					&media_rc6_attr_group);
> > >+		if (ret)
> > >+			DRM_ERROR("Media RC6 residency sysfs setup failed\n");
> > >+	}
> > >  #endif
> > >  	if (HAS_L3_DPF(dev)) {
> > >  		ret = device_create_bin_file(dev->primary->kdev, &dpf_attrs);
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index 1ca944b..db14d3e 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -127,10 +127,19 @@  show_rc6pp_ms(struct device *kdev, struct device_attribute *attr, char *buf)
 	return snprintf(buf, PAGE_SIZE, "%u\n", rc6pp_residency);
 }
 
+static ssize_t
+show_media_rc6_ms(struct device *kdev, struct device_attribute *attr, char *buf)
+{
+	struct drm_minor *dminor = dev_get_drvdata(kdev);
+	u32 rc6_residency = calc_residency(dminor->dev, VLV_GT_MEDIA_RC6);
+	return snprintf(buf, PAGE_SIZE, "%u\n", rc6_residency);
+}
+
 static DEVICE_ATTR(rc6_enable, S_IRUGO, show_rc6_mask, NULL);
 static DEVICE_ATTR(rc6_residency_ms, S_IRUGO, show_rc6_ms, NULL);
 static DEVICE_ATTR(rc6p_residency_ms, S_IRUGO, show_rc6p_ms, NULL);
 static DEVICE_ATTR(rc6pp_residency_ms, S_IRUGO, show_rc6pp_ms, NULL);
+static DEVICE_ATTR(media_rc6_residency_ms, S_IRUGO, show_media_rc6_ms, NULL);
 
 static struct attribute *rc6_attrs[] = {
 	&dev_attr_rc6_enable.attr,
@@ -153,6 +162,16 @@  static struct attribute_group rc6p_attr_group = {
 	.name = power_group_name,
 	.attrs =  rc6p_attrs
 };
+
+static struct attribute *media_rc6_attrs[] = {
+	&dev_attr_media_rc6_residency_ms.attr,
+	NULL
+};
+
+static struct attribute_group media_rc6_attr_group = {
+	.name = power_group_name,
+	.attrs =  media_rc6_attrs
+};
 #endif
 
 static int l3_access_valid(struct drm_device *dev, loff_t offset)
@@ -612,6 +631,12 @@  void i915_setup_sysfs(struct drm_device *dev)
 		if (ret)
 			DRM_ERROR("RC6p residency sysfs setup failed\n");
 	}
+	if (IS_VALLEYVIEW(dev)) {
+		ret = sysfs_merge_group(&dev->primary->kdev->kobj,
+					&media_rc6_attr_group);
+		if (ret)
+			DRM_ERROR("Media RC6 residency sysfs setup failed\n");
+	}
 #endif
 	if (HAS_L3_DPF(dev)) {
 		ret = device_create_bin_file(dev->primary->kdev, &dpf_attrs);