public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Add media rc6 residency file to sysfs
@ 2015-02-26 15:40 deepak.s
  2015-02-26 15:40 ` [PATCH 1/2] tests/pm_rc6_residency: Fix proper residency calculation deepak.s
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: deepak.s @ 2015-02-26 15:40 UTC (permalink / raw)
  To: intel-gfx

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.

Testcase: igt/pm_rc6_residency --run-subtest media-rc6-accuracy
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-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 cdc9da0..1f269e0 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)
@@ -627,6 +646,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);
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 1/2] tests/pm_rc6_residency: Fix proper residency calculation
  2015-02-26 15:40 [PATCH] drm/i915: Add media rc6 residency file to sysfs deepak.s
@ 2015-02-26 15:40 ` deepak.s
  2015-02-26 15:40 ` [PATCH 2/2] tests/pm_rc6_residency: Add media_rc6_residency_counter subtest deepak.s
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: deepak.s @ 2015-02-26 15:40 UTC (permalink / raw)
  To: intel-gfx

From: Deepak S <deepak.s@linux.intel.com>

With current code we are not considering the RC6 residency during sysfs
read. This is causing test to fail due to incorrect residency_accuracy check
This patch consider code time spent for accuracy check

Signed-off-by: Deepak S <deepak.s@linux.intel.com>
---
 tests/pm_rc6_residency.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c
index 2658a89..1600ac3 100644
--- a/tests/pm_rc6_residency.c
+++ b/tests/pm_rc6_residency.c
@@ -37,6 +37,7 @@
 
 #define SLEEP_DURATION 3000 // in milliseconds
 #define RC6_FUDGE 900 // in milliseconds
+#define CODE_TIME 50 // in microseconfs
 
 static unsigned int readit(const char *path)
 {
@@ -102,7 +103,7 @@ static void residency_accuracy(int value[],const char *name_of_rc6_residency)
 							"the GPU is as idle as possible(ie. no X, "
 							"running and running no other tests)\n");
 
-	counter = ((double)value[1] - (double)value[0]) /(double) SLEEP_DURATION;
+	counter = ((double)value[1] - (double)value[0]) /(double) (SLEEP_DURATION + CODE_TIME);
 
 	if( counter > 0.9 ){
 		counter_result = counter;
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] tests/pm_rc6_residency: Add media_rc6_residency_counter subtest
  2015-02-26 15:40 [PATCH] drm/i915: Add media rc6 residency file to sysfs deepak.s
  2015-02-26 15:40 ` [PATCH 1/2] tests/pm_rc6_residency: Fix proper residency calculation deepak.s
@ 2015-02-26 15:40 ` deepak.s
  2015-02-26 16:52   ` Daniel Vetter
  2015-02-26 16:48 ` [PATCH] drm/i915: Add media rc6 residency file to sysfs Daniel Vetter
  2015-02-28 17:08 ` shuang.he
  3 siblings, 1 reply; 6+ messages in thread
From: deepak.s @ 2015-02-26 15:40 UTC (permalink / raw)
  To: intel-gfx

From: Deepak S <deepak.s@linux.intel.com>

Added new media_rc6_residency_subtest for  chv & vlv.

Signed-off-by: Deepak S <deepak.s@linux.intel.com>
---
 tests/pm_rc6_residency.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c
index 1600ac3..f6152da 100644
--- a/tests/pm_rc6_residency.c
+++ b/tests/pm_rc6_residency.c
@@ -135,7 +135,7 @@ igt_main
 {
 	int fd;
 	int devid = 0;
-	int rc6[2], rc6p[2], rc6pp[2];
+	int rc6[2], rc6p[2], rc6pp[2], media[2];
 
 	igt_skip_on_simulation();
 
@@ -146,6 +146,9 @@ igt_main
 		close(fd);
 
 		read_rc6_residency(rc6, "rc6");
+		if (IS_VALLEYVIEW(devid) || IS_CHERRYVIEW(devid))
+			read_rc6_residency(media, "media_rc6");
+
 		if (IS_GEN6(devid) || IS_IVYBRIDGE(devid)) {
 			read_rc6_residency(rc6p, "rc6p");
 			read_rc6_residency(rc6pp, "rc6pp");
@@ -154,6 +157,9 @@ igt_main
 
 	igt_subtest("rc6-accuracy")
 		residency_accuracy(rc6, "rc6");
+	igt_subtest("media-rc6-accuracy")
+		if (IS_VALLEYVIEW(devid) || IS_CHERRYVIEW(devid))
+			residency_accuracy(media, "media_rc6");
 	igt_subtest("rc6p-accuracy") {
 		if (!IS_GEN6(devid) && !IS_IVYBRIDGE(devid))
 			igt_skip("This platform doesn't support RC6p\n");
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915: Add media rc6 residency file to sysfs
  2015-02-26 15:40 [PATCH] drm/i915: Add media rc6 residency file to sysfs deepak.s
  2015-02-26 15:40 ` [PATCH 1/2] tests/pm_rc6_residency: Fix proper residency calculation deepak.s
  2015-02-26 15:40 ` [PATCH 2/2] tests/pm_rc6_residency: Add media_rc6_residency_counter subtest deepak.s
@ 2015-02-26 16:48 ` Daniel Vetter
  2015-02-28 17:08 ` shuang.he
  3 siblings, 0 replies; 6+ messages in thread
From: Daniel Vetter @ 2015-02-26 16:48 UTC (permalink / raw)
  To: deepak.s; +Cc: intel-gfx

On Thu, Feb 26, 2015 at 09:10:27PM +0530, deepak.s@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.
> 
> Testcase: igt/pm_rc6_residency --run-subtest media-rc6-accuracy
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Deepak S <deepak.s@linux.intel.com>

Queued for -next, thanks for the patch.
-Daniel
-- 
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] tests/pm_rc6_residency: Add media_rc6_residency_counter subtest
  2015-02-26 15:40 ` [PATCH 2/2] tests/pm_rc6_residency: Add media_rc6_residency_counter subtest deepak.s
@ 2015-02-26 16:52   ` Daniel Vetter
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Vetter @ 2015-02-26 16:52 UTC (permalink / raw)
  To: deepak.s; +Cc: intel-gfx

On Thu, Feb 26, 2015 at 09:10:29PM +0530, deepak.s@linux.intel.com wrote:
> From: Deepak S <deepak.s@linux.intel.com>
> 
> Added new media_rc6_residency_subtest for  chv & vlv.
> 
> Signed-off-by: Deepak S <deepak.s@linux.intel.com>

Both igt patches merged, thanks.
-Daniel

> ---
>  tests/pm_rc6_residency.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c
> index 1600ac3..f6152da 100644
> --- a/tests/pm_rc6_residency.c
> +++ b/tests/pm_rc6_residency.c
> @@ -135,7 +135,7 @@ igt_main
>  {
>  	int fd;
>  	int devid = 0;
> -	int rc6[2], rc6p[2], rc6pp[2];
> +	int rc6[2], rc6p[2], rc6pp[2], media[2];
>  
>  	igt_skip_on_simulation();
>  
> @@ -146,6 +146,9 @@ igt_main
>  		close(fd);
>  
>  		read_rc6_residency(rc6, "rc6");
> +		if (IS_VALLEYVIEW(devid) || IS_CHERRYVIEW(devid))
> +			read_rc6_residency(media, "media_rc6");
> +
>  		if (IS_GEN6(devid) || IS_IVYBRIDGE(devid)) {
>  			read_rc6_residency(rc6p, "rc6p");
>  			read_rc6_residency(rc6pp, "rc6pp");
> @@ -154,6 +157,9 @@ igt_main
>  
>  	igt_subtest("rc6-accuracy")
>  		residency_accuracy(rc6, "rc6");
> +	igt_subtest("media-rc6-accuracy")
> +		if (IS_VALLEYVIEW(devid) || IS_CHERRYVIEW(devid))
> +			residency_accuracy(media, "media_rc6");
>  	igt_subtest("rc6p-accuracy") {
>  		if (!IS_GEN6(devid) && !IS_IVYBRIDGE(devid))
>  			igt_skip("This platform doesn't support RC6p\n");
> -- 
> 1.9.1
> 
> _______________________________________________
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915: Add media rc6 residency file to sysfs
  2015-02-26 15:40 [PATCH] drm/i915: Add media rc6 residency file to sysfs deepak.s
                   ` (2 preceding siblings ...)
  2015-02-26 16:48 ` [PATCH] drm/i915: Add media rc6 residency file to sysfs Daniel Vetter
@ 2015-02-28 17:08 ` shuang.he
  3 siblings, 0 replies; 6+ messages in thread
From: shuang.he @ 2015-02-28 17:08 UTC (permalink / raw)
  To: shuang.he, ethan.gao, intel-gfx, deepak.s

Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 5841
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV                 -1              282/282              281/282
ILK                                  308/308              308/308
SNB                 -1              326/326              325/326
IVB                                  379/379              379/379
BYT                                  294/294              294/294
HSW                                  387/387              387/387
BDW                 -1              316/316              315/316
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
 PNV  igt_gem_userptr_blits_minor-unsync-normal      DMESG_WARN(1)PASS(3)      DMESG_WARN(1)PASS(1)
*SNB  igt_pm_rpm_fences-dpms      PASS(3)      DMESG_WARN(1)PASS(1)
*BDW  igt_gem_gtt_hog      PASS(15)      DMESG_WARN(1)PASS(1)
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-02-28 17:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-26 15:40 [PATCH] drm/i915: Add media rc6 residency file to sysfs deepak.s
2015-02-26 15:40 ` [PATCH 1/2] tests/pm_rc6_residency: Fix proper residency calculation deepak.s
2015-02-26 15:40 ` [PATCH 2/2] tests/pm_rc6_residency: Add media_rc6_residency_counter subtest deepak.s
2015-02-26 16:52   ` Daniel Vetter
2015-02-26 16:48 ` [PATCH] drm/i915: Add media rc6 residency file to sysfs Daniel Vetter
2015-02-28 17:08 ` shuang.he

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox