Re: [Intel-gfx] [PATCH i-g-t v12] tests/kms_frontbuffer_tracking: Including DRRS test coverage

2018-01-06 Thread Ramalingam C



On Saturday 06 January 2018 04:18 PM, Ramalingam C wrote:



On Friday 05 January 2018 11:25 PM, Rodrigo Vivi wrote:

On Fri, Jan 05, 2018 at 11:40:29AM +, Lohith BS wrote:

Dynamic Refresh Rate Switch(DRRS) is used to switch the panel's
refresh rate to the lowest vrefresh supported by panel, when frame is
not flipped for more than a Sec.

In kernel, DRRS uses the front buffer tracking infrastructure.
Hence DRRS test coverage is added along with other frontbuffer tracking
based features such as FBC and PSR tests.

Here, we are testing DRRS with other features in all possible
combinations, in all required test cases, to capture any possible
regression.

v2: Addressed the comments and suggestions from Vlad, Marius.
 The signoff details from the earlier work are also included.

v3: Modified vblank rate calculation by using reply-sequence,
 provided by drmWaitVBlank, as suggested by Chris Wilson.

v4: As suggested from Chris Wilson and Daniel Vetter
 1) Avoided using pthread for calculating vblank refresh rate,
    instead used drmWaitVBlank reply sequence.
 2) Avoided using kernel-specific info like transitional delays,
    instead polling mechanism with timeout is used.
 3) Included edp-DRRS as a subtest in kms_frontbuffer_tracking.c,
    instead of having a separate test.

v5: This patch adds DRRS as a new feature in the
 kms_frontbuffer_tracking IGT.
 DRRS switch to lower vrefresh rate is tested at slow-draw subtest.

 Note:
 1) Currently kernel doesn't have support to enable and disable
    the DRRS feature dynamically(as in case of PSR). Hence if the
    panel supports DRRS it will be enabled by default.

 This is in continuation of last patch
"https://patchwork.freedesktop.org/patch/162726/";

v6: This patch adds runtime enable and disable feature for testing DRRS

v7: This patch adds runtime enable and disable feature for testing DRRS
 through debugfs entry "i915_drrs_ctl".

v8: Commit message is updated to reflect current implementation.

v9: Addressed Paulo Zanoni comments.
 Check for DRRS_LOW at tests with OFFSCREEN + FBS_INDIVIDUAL.

v10: Corrected DRRS state expectation in suspend related subtests.

v11: Removing the global flag is_psr_drrs_combo [Rodrigo].

v12: Rewriting the DRRS inactive deduction [Rodrigo].

Signed-off-by: Lohith BS 
Signed-off-by: aknautiy 

I was almost adding the rv-b here, but I will step back while CI is not
fully happy with the patch:

https://patchwork.freedesktop.org/series/32888/

regressed many sub-tests on snb and hsw...

Rodrigo, please share the logs for regressions. We will analyze it.

Please ignore this. found in the already shared link.
-Ram


Thanks
-Ram



---
  tests/kms_frontbuffer_tracking.c | 178 
+--

  1 file changed, 170 insertions(+), 8 deletions(-)

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

index 1601cab..4b87273 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -34,7 +34,7 @@
      IGT_TEST_DESCRIPTION("Test the Kernel's frontbuffer tracking 
mechanism and "

- "its related features: FBC and PSR");
+ "its related features: FBC, PSR and DRRS");
    /*
   * One of the aspects of this test is that, for every subtest, we 
try different

@@ -105,8 +105,9 @@ struct test_mode {
  FEATURE_NONE  = 0,
  FEATURE_FBC   = 1,
  FEATURE_PSR   = 2,
-    FEATURE_COUNT = 4,
-    FEATURE_DEFAULT = 4,
+    FEATURE_DRRS  = 4,
+    FEATURE_COUNT = 8,
+    FEATURE_DEFAULT = 8,
  } feature;
    /* Possible pixel formats. We just use FORMAT_DEFAULT for 
most tests and

@@ -156,6 +157,7 @@ struct rect {
  struct {
  int fd;
  int debugfs;
+    int drrs_debugfs_fd;
  drmModeResPtr res;
  drmModeConnectorPtr connectors[MAX_CONNECTORS];
  drmModeEncoderPtr encoders[MAX_ENCODERS];
@@ -182,6 +184,13 @@ struct {
  .can_test = false,
  };
  +#define MAX_DRRS_STATUS_BUF_LEN 256
+
+struct {
+    bool can_test;
+} drrs = {
+    .can_test = false,
+};
    #define SINK_CRC_SIZE 12
  typedef struct {
@@ -825,6 +834,60 @@ static void psr_print_status(void)
  igt_info("PSR status:\n%s\n", buf);
  }
  +void drrs_set(unsigned int val)
+{
+    char buf[2];
+
+    igt_debug("Manually %sabling DRRS. %llu\n", val ? "en" : "dis", 
val);

+    snprintf(buf, sizeof(buf), "%d", val);
+    igt_assert_eq(write(drm.drrs_debugfs_fd,
+  buf, strlen(buf)), strlen(buf));
+}
+
+static bool is_drrs_high(void)
+{
+    char buf[MAX_DRRS_STATUS_BUF_LEN];
+
+    debugfs_read("i915_drrs_status", buf);
+    return strstr(buf, "DRRS_HIGH_RR");
+}
+
+static bool is_drrs_low(void)
+{
+    char buf[MAX_DRRS_STATUS_BUF_LEN];
+
+    debugfs_read("i915_drrs_status", buf);
+    return strstr(buf, "DRRS_LOW_RR");
+}
+
+static bool is_drrs_supported(void)
+{
+    char buf[MAX_DRRS_STATUS_BUF_LEN];
+
+    debugfs_read("

Re: [Intel-gfx] [PATCH i-g-t v12] tests/kms_frontbuffer_tracking: Including DRRS test coverage

2018-01-06 Thread Ramalingam C



On Friday 05 January 2018 11:25 PM, Rodrigo Vivi wrote:

On Fri, Jan 05, 2018 at 11:40:29AM +, Lohith BS wrote:

Dynamic Refresh Rate Switch(DRRS) is used to switch the panel's
refresh rate to the lowest vrefresh supported by panel, when frame is
not flipped for more than a Sec.

In kernel, DRRS uses the front buffer tracking infrastructure.
Hence DRRS test coverage is added along with other frontbuffer tracking
based features such as FBC and PSR tests.

Here, we are testing DRRS with other features in all possible
combinations, in all required test cases, to capture any possible
regression.

v2: Addressed the comments and suggestions from Vlad, Marius.
 The signoff details from the earlier work are also included.

v3: Modified vblank rate calculation by using reply-sequence,
 provided by drmWaitVBlank, as suggested by Chris Wilson.

v4: As suggested from Chris Wilson and Daniel Vetter
 1) Avoided using pthread for calculating vblank refresh rate,
instead used drmWaitVBlank reply sequence.
 2) Avoided using kernel-specific info like transitional delays,
instead polling mechanism with timeout is used.
 3) Included edp-DRRS as a subtest in kms_frontbuffer_tracking.c,
instead of having a separate test.

v5: This patch adds DRRS as a new feature in the
 kms_frontbuffer_tracking IGT.
 DRRS switch to lower vrefresh rate is tested at slow-draw subtest.

 Note:
 1) Currently kernel doesn't have support to enable and disable
the DRRS feature dynamically(as in case of PSR). Hence if the
panel supports DRRS it will be enabled by default.

 This is in continuation of last patch
"https://patchwork.freedesktop.org/patch/162726/";

v6: This patch adds runtime enable and disable feature for testing DRRS

v7: This patch adds runtime enable and disable feature for testing DRRS
 through debugfs entry "i915_drrs_ctl".

v8: Commit message is updated to reflect current implementation.

v9: Addressed Paulo Zanoni comments.
 Check for DRRS_LOW at tests with OFFSCREEN + FBS_INDIVIDUAL.

v10: Corrected DRRS state expectation in suspend related subtests.

v11: Removing the global flag is_psr_drrs_combo [Rodrigo].

v12: Rewriting the DRRS inactive deduction [Rodrigo].

Signed-off-by: Lohith BS 
Signed-off-by: aknautiy 

I was almost adding the rv-b here, but I will step back while CI is not
fully happy with the patch:

https://patchwork.freedesktop.org/series/32888/

regressed many sub-tests on snb and hsw...

Rodrigo, please share the logs for regressions. We will analyze it.

Thanks
-Ram



---
  tests/kms_frontbuffer_tracking.c | 178 +--
  1 file changed, 170 insertions(+), 8 deletions(-)

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 1601cab..4b87273 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -34,7 +34,7 @@
  
  
  IGT_TEST_DESCRIPTION("Test the Kernel's frontbuffer tracking mechanism and "

-"its related features: FBC and PSR");
+"its related features: FBC, PSR and DRRS");
  
  /*

   * One of the aspects of this test is that, for every subtest, we try 
different
@@ -105,8 +105,9 @@ struct test_mode {
FEATURE_NONE  = 0,
FEATURE_FBC   = 1,
FEATURE_PSR   = 2,
-   FEATURE_COUNT = 4,
-   FEATURE_DEFAULT = 4,
+   FEATURE_DRRS  = 4,
+   FEATURE_COUNT = 8,
+   FEATURE_DEFAULT = 8,
} feature;
  
  	/* Possible pixel formats. We just use FORMAT_DEFAULT for most tests and

@@ -156,6 +157,7 @@ struct rect {
  struct {
int fd;
int debugfs;
+   int drrs_debugfs_fd;
drmModeResPtr res;
drmModeConnectorPtr connectors[MAX_CONNECTORS];
drmModeEncoderPtr encoders[MAX_ENCODERS];
@@ -182,6 +184,13 @@ struct {
.can_test = false,
  };
  
+#define MAX_DRRS_STATUS_BUF_LEN 256

+
+struct {
+   bool can_test;
+} drrs = {
+   .can_test = false,
+};
  
  #define SINK_CRC_SIZE 12

  typedef struct {
@@ -825,6 +834,60 @@ static void psr_print_status(void)
igt_info("PSR status:\n%s\n", buf);
  }
  
+void drrs_set(unsigned int val)

+{
+   char buf[2];
+
+   igt_debug("Manually %sabling DRRS. %llu\n", val ? "en" : "dis", val);
+   snprintf(buf, sizeof(buf), "%d", val);
+   igt_assert_eq(write(drm.drrs_debugfs_fd,
+ buf, strlen(buf)), strlen(buf));
+}
+
+static bool is_drrs_high(void)
+{
+   char buf[MAX_DRRS_STATUS_BUF_LEN];
+
+   debugfs_read("i915_drrs_status", buf);
+   return strstr(buf, "DRRS_HIGH_RR");
+}
+
+static bool is_drrs_low(void)
+{
+   char buf[MAX_DRRS_STATUS_BUF_LEN];
+
+   debugfs_read("i915_drrs_status", buf);
+   return strstr(buf, "DRRS_LOW_RR");
+}
+
+static bool is_drrs_supported(void)
+{
+   char buf[MAX_DRRS_STATUS_BUF_LEN];
+
+ 

Re: [Intel-gfx] [PATCH i-g-t v12] tests/kms_frontbuffer_tracking: Including DRRS test coverage

2018-01-05 Thread Rodrigo Vivi
On Fri, Jan 05, 2018 at 11:40:29AM +, Lohith BS wrote:
> Dynamic Refresh Rate Switch(DRRS) is used to switch the panel's
> refresh rate to the lowest vrefresh supported by panel, when frame is
> not flipped for more than a Sec.
> 
> In kernel, DRRS uses the front buffer tracking infrastructure.
> Hence DRRS test coverage is added along with other frontbuffer tracking
> based features such as FBC and PSR tests.
> 
> Here, we are testing DRRS with other features in all possible
> combinations, in all required test cases, to capture any possible
> regression.
> 
> v2: Addressed the comments and suggestions from Vlad, Marius.
> The signoff details from the earlier work are also included.
> 
> v3: Modified vblank rate calculation by using reply-sequence,
> provided by drmWaitVBlank, as suggested by Chris Wilson.
> 
> v4: As suggested from Chris Wilson and Daniel Vetter
> 1) Avoided using pthread for calculating vblank refresh rate,
>instead used drmWaitVBlank reply sequence.
> 2) Avoided using kernel-specific info like transitional delays,
>instead polling mechanism with timeout is used.
> 3) Included edp-DRRS as a subtest in kms_frontbuffer_tracking.c,
>instead of having a separate test.
> 
> v5: This patch adds DRRS as a new feature in the
> kms_frontbuffer_tracking IGT.
> DRRS switch to lower vrefresh rate is tested at slow-draw subtest.
> 
> Note:
> 1) Currently kernel doesn't have support to enable and disable
>the DRRS feature dynamically(as in case of PSR). Hence if the
>panel supports DRRS it will be enabled by default.
> 
> This is in continuation of last patch
>   "https://patchwork.freedesktop.org/patch/162726/";
> 
> v6: This patch adds runtime enable and disable feature for testing DRRS
> 
> v7: This patch adds runtime enable and disable feature for testing DRRS
> through debugfs entry "i915_drrs_ctl".
> 
> v8: Commit message is updated to reflect current implementation.
> 
> v9: Addressed Paulo Zanoni comments.
> Check for DRRS_LOW at tests with OFFSCREEN + FBS_INDIVIDUAL.
> 
> v10: Corrected DRRS state expectation in suspend related subtests.
> 
> v11: Removing the global flag is_psr_drrs_combo [Rodrigo].
> 
> v12: Rewriting the DRRS inactive deduction [Rodrigo].
> 
> Signed-off-by: Lohith BS 
> Signed-off-by: aknautiy 

I was almost adding the rv-b here, but I will step back while CI is not
fully happy with the patch:

https://patchwork.freedesktop.org/series/32888/

regressed many sub-tests on snb and hsw...

> ---
>  tests/kms_frontbuffer_tracking.c | 178 
> +--
>  1 file changed, 170 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/kms_frontbuffer_tracking.c 
> b/tests/kms_frontbuffer_tracking.c
> index 1601cab..4b87273 100644
> --- a/tests/kms_frontbuffer_tracking.c
> +++ b/tests/kms_frontbuffer_tracking.c
> @@ -34,7 +34,7 @@
>  
>  
>  IGT_TEST_DESCRIPTION("Test the Kernel's frontbuffer tracking mechanism and "
> -  "its related features: FBC and PSR");
> +  "its related features: FBC, PSR and DRRS");
>  
>  /*
>   * One of the aspects of this test is that, for every subtest, we try 
> different
> @@ -105,8 +105,9 @@ struct test_mode {
>   FEATURE_NONE  = 0,
>   FEATURE_FBC   = 1,
>   FEATURE_PSR   = 2,
> - FEATURE_COUNT = 4,
> - FEATURE_DEFAULT = 4,
> + FEATURE_DRRS  = 4,
> + FEATURE_COUNT = 8,
> + FEATURE_DEFAULT = 8,
>   } feature;
>  
>   /* Possible pixel formats. We just use FORMAT_DEFAULT for most tests and
> @@ -156,6 +157,7 @@ struct rect {
>  struct {
>   int fd;
>   int debugfs;
> + int drrs_debugfs_fd;
>   drmModeResPtr res;
>   drmModeConnectorPtr connectors[MAX_CONNECTORS];
>   drmModeEncoderPtr encoders[MAX_ENCODERS];
> @@ -182,6 +184,13 @@ struct {
>   .can_test = false,
>  };
>  
> +#define MAX_DRRS_STATUS_BUF_LEN 256
> +
> +struct {
> + bool can_test;
> +} drrs = {
> + .can_test = false,
> +};
>  
>  #define SINK_CRC_SIZE 12
>  typedef struct {
> @@ -825,6 +834,60 @@ static void psr_print_status(void)
>   igt_info("PSR status:\n%s\n", buf);
>  }
>  
> +void drrs_set(unsigned int val)
> +{
> + char buf[2];
> +
> + igt_debug("Manually %sabling DRRS. %llu\n", val ? "en" : "dis", val);
> + snprintf(buf, sizeof(buf), "%d", val);
> + igt_assert_eq(write(drm.drrs_debugfs_fd,
> +   buf, strlen(buf)), strlen(buf));
> +}
> +
> +static bool is_drrs_high(void)
> +{
> + char buf[MAX_DRRS_STATUS_BUF_LEN];
> +
> + debugfs_read("i915_drrs_status", buf);
> + return strstr(buf, "DRRS_HIGH_RR");
> +}
> +
> +static bool is_drrs_low(void)
> +{
> + char buf[MAX_DRRS_STATUS_BUF_LEN];
> +
> + debugfs_read("i915_drrs_status", buf);
> + return strstr(buf, "DRRS_LOW_RR");
> +}
> +
> +static bool is_drrs_supported(void)
> +{
> + char 

[Intel-gfx] [PATCH i-g-t v12] tests/kms_frontbuffer_tracking: Including DRRS test coverage

2018-01-05 Thread Lohith BS
Dynamic Refresh Rate Switch(DRRS) is used to switch the panel's
refresh rate to the lowest vrefresh supported by panel, when frame is
not flipped for more than a Sec.

In kernel, DRRS uses the front buffer tracking infrastructure.
Hence DRRS test coverage is added along with other frontbuffer tracking
based features such as FBC and PSR tests.

Here, we are testing DRRS with other features in all possible
combinations, in all required test cases, to capture any possible
regression.

v2: Addressed the comments and suggestions from Vlad, Marius.
The signoff details from the earlier work are also included.

v3: Modified vblank rate calculation by using reply-sequence,
provided by drmWaitVBlank, as suggested by Chris Wilson.

v4: As suggested from Chris Wilson and Daniel Vetter
1) Avoided using pthread for calculating vblank refresh rate,
   instead used drmWaitVBlank reply sequence.
2) Avoided using kernel-specific info like transitional delays,
   instead polling mechanism with timeout is used.
3) Included edp-DRRS as a subtest in kms_frontbuffer_tracking.c,
   instead of having a separate test.

v5: This patch adds DRRS as a new feature in the
kms_frontbuffer_tracking IGT.
DRRS switch to lower vrefresh rate is tested at slow-draw subtest.

Note:
1) Currently kernel doesn't have support to enable and disable
   the DRRS feature dynamically(as in case of PSR). Hence if the
   panel supports DRRS it will be enabled by default.

This is in continuation of last patch
"https://patchwork.freedesktop.org/patch/162726/";

v6: This patch adds runtime enable and disable feature for testing DRRS

v7: This patch adds runtime enable and disable feature for testing DRRS
through debugfs entry "i915_drrs_ctl".

v8: Commit message is updated to reflect current implementation.

v9: Addressed Paulo Zanoni comments.
Check for DRRS_LOW at tests with OFFSCREEN + FBS_INDIVIDUAL.

v10: Corrected DRRS state expectation in suspend related subtests.

v11: Removing the global flag is_psr_drrs_combo [Rodrigo].

v12: Rewriting the DRRS inactive deduction [Rodrigo].

Signed-off-by: Lohith BS 
Signed-off-by: aknautiy 
---
 tests/kms_frontbuffer_tracking.c | 178 +--
 1 file changed, 170 insertions(+), 8 deletions(-)

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 1601cab..4b87273 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -34,7 +34,7 @@
 
 
 IGT_TEST_DESCRIPTION("Test the Kernel's frontbuffer tracking mechanism and "
-"its related features: FBC and PSR");
+"its related features: FBC, PSR and DRRS");
 
 /*
  * One of the aspects of this test is that, for every subtest, we try different
@@ -105,8 +105,9 @@ struct test_mode {
FEATURE_NONE  = 0,
FEATURE_FBC   = 1,
FEATURE_PSR   = 2,
-   FEATURE_COUNT = 4,
-   FEATURE_DEFAULT = 4,
+   FEATURE_DRRS  = 4,
+   FEATURE_COUNT = 8,
+   FEATURE_DEFAULT = 8,
} feature;
 
/* Possible pixel formats. We just use FORMAT_DEFAULT for most tests and
@@ -156,6 +157,7 @@ struct rect {
 struct {
int fd;
int debugfs;
+   int drrs_debugfs_fd;
drmModeResPtr res;
drmModeConnectorPtr connectors[MAX_CONNECTORS];
drmModeEncoderPtr encoders[MAX_ENCODERS];
@@ -182,6 +184,13 @@ struct {
.can_test = false,
 };
 
+#define MAX_DRRS_STATUS_BUF_LEN 256
+
+struct {
+   bool can_test;
+} drrs = {
+   .can_test = false,
+};
 
 #define SINK_CRC_SIZE 12
 typedef struct {
@@ -825,6 +834,60 @@ static void psr_print_status(void)
igt_info("PSR status:\n%s\n", buf);
 }
 
+void drrs_set(unsigned int val)
+{
+   char buf[2];
+
+   igt_debug("Manually %sabling DRRS. %llu\n", val ? "en" : "dis", val);
+   snprintf(buf, sizeof(buf), "%d", val);
+   igt_assert_eq(write(drm.drrs_debugfs_fd,
+ buf, strlen(buf)), strlen(buf));
+}
+
+static bool is_drrs_high(void)
+{
+   char buf[MAX_DRRS_STATUS_BUF_LEN];
+
+   debugfs_read("i915_drrs_status", buf);
+   return strstr(buf, "DRRS_HIGH_RR");
+}
+
+static bool is_drrs_low(void)
+{
+   char buf[MAX_DRRS_STATUS_BUF_LEN];
+
+   debugfs_read("i915_drrs_status", buf);
+   return strstr(buf, "DRRS_LOW_RR");
+}
+
+static bool is_drrs_supported(void)
+{
+   char buf[MAX_DRRS_STATUS_BUF_LEN];
+
+   debugfs_read("i915_drrs_status", buf);
+   return strstr(buf, "DRRS Supported: Yes");
+}
+
+static bool is_drrs_inactive(void)
+{
+   char buf[MAX_DRRS_STATUS_BUF_LEN];
+
+   debugfs_read("i915_drrs_status", buf);
+
+   if (strstr(buf, "DRRS_State: "))
+   return false;
+
+   return true;
+}
+
+static void drrs_print_status(void)
+{
+   char buf[MAX_DRRS_STATUS_BUF_LEN];
+
+   debugfs_read(