diff mbox

[i-g-t,v2] tests/kms_frontbuffer_tracking: Skip tests when PSR cannot be enabled

Message ID 20171026235137.5022-1-dhinakaran.pandiyan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dhinakaran Pandiyan Oct. 26, 2017, 11:51 p.m. UTC
The frontbuffer_tracking PSR tests fail if PSR cannot be activated when
there is sink support. But, there are several other requirements related to
mode timings that have to be satisfied before PSR can be enabled. No reason
to fail these tests when PSR cannot be enabled.

v2: Check for Source_OK instead of Enabled (Paulo)

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 tests/kms_frontbuffer_tracking.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Dhinakaran Pandiyan Oct. 27, 2017, 12:06 a.m. UTC | #1
On Thu, 2017-10-26 at 16:51 -0700, Dhinakaran Pandiyan wrote:
> The frontbuffer_tracking PSR tests fail if PSR cannot be activated when

> there is sink support. But, there are several other requirements related to

> mode timings that have to be satisfied before PSR can be enabled. No reason

> to fail these tests when PSR cannot be enabled.

> 

> v2: Check for Source_OK instead of Enabled (Paulo)

> 


Checking for Source_OK is as good as checking for Enabled as we don't
bail out on enabling PSR after conditions are met. But checking
Source_OK seems slight better in case the enable_sink(), enable_source()
functions in intel_psr_enable() return errors in the future.


> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>

> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>

> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>

> ---

>  tests/kms_frontbuffer_tracking.c | 9 +++++----

>  1 file changed, 5 insertions(+), 4 deletions(-)

> 

> diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c

> index a068c8af..17af4bbd 100644

> --- a/tests/kms_frontbuffer_tracking.c

> +++ b/tests/kms_frontbuffer_tracking.c

> @@ -1548,12 +1548,13 @@ static void teardown_fbc(void)

>  {

>  }

>  

> -static bool psr_sink_has_support(void)

> +static bool psr_has_support(void)

>  {

>  	char buf[256];

>  

>  	debugfs_read("i915_edp_psr_status", buf);

> -	return strstr(buf, "Sink_Support: yes\n");

> +	return strstr(buf, "Sink_Support: yes\n") &&

> +	       strstr(buf, "Source_OK: yes\n");

>  }

>  

>  static void setup_psr(void)

> @@ -1564,8 +1565,8 @@ static void setup_psr(void)

>  		return;

>  	}

>  

> -	if (!psr_sink_has_support()) {

> -		igt_info("Can't test PSR: not supported by sink.\n");

> +	if (!psr_has_support()) {

> +		igt_info("Can't test PSR: not supported.\n");

>  		return;

>  	}

>  	psr.can_test = true;
diff mbox

Patch

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index a068c8af..17af4bbd 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -1548,12 +1548,13 @@  static void teardown_fbc(void)
 {
 }
 
-static bool psr_sink_has_support(void)
+static bool psr_has_support(void)
 {
 	char buf[256];
 
 	debugfs_read("i915_edp_psr_status", buf);
-	return strstr(buf, "Sink_Support: yes\n");
+	return strstr(buf, "Sink_Support: yes\n") &&
+	       strstr(buf, "Source_OK: yes\n");
 }
 
 static void setup_psr(void)
@@ -1564,8 +1565,8 @@  static void setup_psr(void)
 		return;
 	}
 
-	if (!psr_sink_has_support()) {
-		igt_info("Can't test PSR: not supported by sink.\n");
+	if (!psr_has_support()) {
+		igt_info("Can't test PSR: not supported.\n");
 		return;
 	}
 	psr.can_test = true;