<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 4, 2014 at 1:47 AM, Daniel Vetter <span dir="ltr"><<a href="mailto:daniel@ffwll.ch" target="_blank">daniel@ffwll.ch</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Wed, Sep 03, 2014 at 09:29:55PM -0400, Rodrigo Vivi wrote:<br>
> v2: Doesn't duplicate kernel's HAS_PSR. skip based on debugfs output.<br>
><br>
> Signed-off-by: Rodrigo Vivi <<a href="mailto:rodrigo.vivi@intel.com">rodrigo.vivi@intel.com</a>><br>
<br>
</div>I'm not sure whether we should still keep this one here around given that<br>
we have the full-blown crc based testcase, which also checks residency.<br>
But your call.<br></blockquote><div><br></div><div>Agree. I'm going to kill this test.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Daniel<br>
<div class="HOEnZb"><div class="h5"><br>
> ---<br>
> tests/pm_psr.c | 30 +++++++++++++++++++++---------<br>
> 1 file changed, 21 insertions(+), 9 deletions(-)<br>
><br>
> diff --git a/tests/pm_psr.c b/tests/pm_psr.c<br>
> index 3ab7e7a..16ec3fa 100644<br>
> --- a/tests/pm_psr.c<br>
> +++ b/tests/pm_psr.c<br>
> @@ -32,6 +32,8 @@<br>
> #include <errno.h><br>
><br>
> #include "drmtest.h"<br>
> +#include "intel_chipset.h"<br>
> +#include "igt_debugfs.h"<br>
><br>
> #define SLEEP_DURATION 5000 // in milliseconds<br>
><br>
> @@ -41,22 +43,34 @@ static int get_perf(const char *path)<br>
> FILE *file;<br>
> char str[4];<br>
><br>
> - file = fopen(path, "r");<br>
> - igt_assert(file);<br>
> + file = igt_debugfs_fopen("i915_edp_psr_status", "r");<br>
> + igt_require(file);<br>
><br>
> ret = fscanf(file, "Sink_Support: %s\n", str);<br>
> igt_skip_on_f(ret == 0,<br>
> "i915_edp_psr_status format not supported by this test case\n");<br>
> - igt_require(strcmp(str, "yes") == 0);<br>
> + igt_skip_on_f(strcmp(str, "yes") != 0,<br>
> + "PSR not supported on this platform\n");<br>
> +<br>
> ret = fscanf(file, "Source_OK: %s\n", str);<br>
> igt_assert(ret != 0);<br>
> -<br>
> igt_require(strcmp(str, "yes") == 0);<br>
><br>
> ret = fscanf(file, "Enabled: %s\n", str);<br>
> igt_assert(ret != 0);<br>
> igt_assert(strcmp(str, "yes") == 0);<br>
><br>
> + ret = fscanf(file, "Active: %s\n", str);<br>
> + igt_skip_on_f(ret == 0,<br>
> + "i915_edp_psr_status format not supported by this test case\n");<br>
> +<br>
> + ret = fscanf(file, "Busy frontbuffer bits: %s\n", str);<br>
> + igt_assert(ret != 0);<br>
> + ret = fscanf(file, "Re-enable work scheduled: %s\n", str);<br>
> + igt_assert(ret != 0);<br>
> + ret = fscanf(file, "HW Enabled & Active bit: %s\n", str);<br>
> + igt_assert(ret != 0);<br>
> +<br>
> ret = fscanf(file, "Performance_Counter: %i", &perf);<br>
> igt_assert(ret != 0);<br>
><br>
> @@ -68,15 +82,13 @@ static int get_perf(const char *path)<br>
><br>
> igt_simple_main<br>
> {<br>
> - int ret, perf1, perf2;<br>
> - int device = drm_get_card();<br>
> + int perf1, perf2;<br>
> + int drm_fd = drm_open_any();<br>
> + uint32_t devid = intel_get_drm_devid(drm_fd);<br>
> char *path;<br>
><br>
> igt_skip_on_simulation();<br>
><br>
> - ret = asprintf(&path, "/sys/kernel/debug/dri/%d/i915_edp_psr_status", device);<br>
> - igt_assert(ret != -1);<br>
> -<br>
> perf1 = get_perf(path);<br>
> sleep(SLEEP_DURATION / 1000);<br>
> perf2 = get_perf(path);<br>
> --<br>
> 1.9.3<br>
><br>
> _______________________________________________<br>
> Intel-gfx mailing list<br>
> <a href="mailto:Intel-gfx@lists.freedesktop.org">Intel-gfx@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/intel-gfx" target="_blank">http://lists.freedesktop.org/mailman/listinfo/intel-gfx</a><br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Daniel Vetter<br>
Software Engineer, Intel Corporation<br>
<a href="tel:%2B41%20%280%29%2079%20365%2057%2048" value="+41793655748">+41 (0) 79 365 57 48</a> - <a href="http://blog.ffwll.ch" target="_blank">http://blog.ffwll.ch</a><br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Intel-gfx mailing list<br>
<a href="mailto:Intel-gfx@lists.freedesktop.org">Intel-gfx@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/intel-gfx" target="_blank">http://lists.freedesktop.org/mailman/listinfo/intel-gfx</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Rodrigo Vivi</div><div>Blog: <a href="http://blog.vivi.eng.br" target="_blank">http://blog.vivi.eng.br</a></div><div> </div>
</div></div>