All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH igt-dev v15] tests/kms_frontbuffer_tracking: Including DRRS test coverage
@ 2018-01-31 11:50 Lohith BS
  2018-02-01  8:27 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_frontbuffer_tracking: Including DRRS test coverage (rev2) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lohith BS @ 2018-01-31 11:50 UTC (permalink / raw)
  To: igt-dev, rodrigo.vivi, jani.saarinen, daniel.vetter, chris,
	jari.tahvanainen

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].

v13: En/Dis-able DRRS only when DRRS is capable on the setup.

v14: Handle the error states of drrs_enable only [Rodrigo].

v15: Resolved compiler warning and rebased.

Signed-off-by: Lohith BS <lohith.bs@intel.com>
Signed-off-by: aknautiy <ankit.k.nautiyal@intel.com>
---
 tests/kms_frontbuffer_tracking.c | 177 +++++++++++++++++++++++++++++++++++++--
 1 file changed, 169 insertions(+), 8 deletions(-)

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 79e4f58..cc08bb9 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
@@ -182,6 +183,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 {
@@ -790,7 +798,13 @@ static void __debugfs_read(const char *param, char *buf, int len)
 	buf[len] = '\0';
 }
 
+static int __debugfs_write(const char *param, char *buf, int len)
+{
+	return igt_sysfs_write(drm.debugfs, param, buf, len - 1);
+}
+
 #define debugfs_read(p, arr) __debugfs_read(p, arr, sizeof(arr))
+#define debugfs_write(p, arr) __debugfs_write(p, arr, sizeof(arr))
 
 static bool fbc_is_enabled(int lvl)
 {
@@ -818,6 +832,68 @@ static void psr_print_status(void)
 	igt_info("PSR status:\n%s\n", buf);
 }
 
+void drrs_set(unsigned int val)
+{
+	char buf[2];
+	int ret;
+
+	igt_debug("Manually %sabling DRRS. %u\n", val ? "en" : "dis", val);
+	snprintf(buf, sizeof(buf), "%d", val);
+	ret = debugfs_write("i915_drrs_ctl", buf);
+
+	/*
+	 * drrs_enable() is called on DRRS capable platform only,
+	 * whereas drrs_disable() is called on all platforms.
+	 * So handle the failure of debugfs_write only for drrs_enable().
+	 */
+	if (val)
+		igt_assert_f(ret == (sizeof(buf) - 1), "debugfs_write failed");
+}
+
+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("i915_drrs_status", buf);
+	igt_info("DRRS STATUS :\n%s\n", buf);
+}
+
 static struct timespec fbc_get_last_action(void)
 {
 	struct timespec ret = { 0, 0 };
@@ -928,10 +1004,17 @@ static bool psr_wait_until_enabled(void)
 	return igt_wait(psr_is_enabled(), 5000, 1);
 }
 
+static bool drrs_wait_until_rr_switch_to_low(void)
+{
+	return igt_wait(is_drrs_low(), 5000, 1);
+}
+
 #define fbc_enable() igt_set_module_param_int("enable_fbc", 1)
 #define fbc_disable() igt_set_module_param_int("enable_fbc", 0)
 #define psr_enable() igt_set_module_param_int("enable_psr", 1)
 #define psr_disable() igt_set_module_param_int("enable_psr", 0)
+#define drrs_enable()	drrs_set(1)
+#define drrs_disable()	drrs_set(0)
 
 static void get_sink_crc(sink_crc_t *crc, bool mandatory)
 {
@@ -1177,6 +1260,7 @@ static void disable_features(const struct test_mode *t)
 
 	fbc_disable();
 	psr_disable();
+	drrs_disable();
 }
 
 static void *busy_thread_func(void *data)
@@ -1570,6 +1654,22 @@ static void teardown_psr(void)
 {
 }
 
+static void setup_drrs(void)
+{
+	if (get_connector(prim_mode_params.connector_id)->connector_type !=
+	    DRM_MODE_CONNECTOR_eDP) {
+		igt_info("Can't test DRRS: no usable eDP screen.\n");
+		return;
+	}
+
+	if (!is_drrs_supported()) {
+		igt_info("Can't test DRRS: Not supported.\n");
+		return;
+	}
+
+	drrs.can_test = true;
+}
+
 static void setup_environment(void)
 {
 	setup_drm();
@@ -1577,6 +1677,7 @@ static void setup_environment(void)
 
 	setup_fbc();
 	setup_psr();
+	setup_drrs();
 
 	setup_crcs();
 }
@@ -1655,6 +1756,11 @@ static void do_flush(const struct test_mode *t)
 #define ASSERT_PSR_ENABLED		(1 << 6)
 #define ASSERT_PSR_DISABLED		(1 << 7)
 
+#define DRRS_ASSERT_FLAGS		(7 << 8)
+#define ASSERT_DRRS_HIGH		(1 << 8)
+#define ASSERT_DRRS_LOW		(1 << 9)
+#define ASSERT_DRRS_INACTIVE		(1 << 10)
+
 static int adjust_assertion_flags(const struct test_mode *t, int flags)
 {
 	if (!(flags & DONT_ASSERT_FEATURE_STATUS)) {
@@ -1662,12 +1768,17 @@ static int adjust_assertion_flags(const struct test_mode *t, int flags)
 			flags |= ASSERT_FBC_ENABLED;
 		if (!(flags & ASSERT_PSR_DISABLED))
 			flags |= ASSERT_PSR_ENABLED;
+		if (!((flags & ASSERT_DRRS_LOW) ||
+		    (flags & ASSERT_DRRS_INACTIVE)))
+			flags |= ASSERT_DRRS_HIGH;
 	}
 
 	if ((t->feature & FEATURE_FBC) == 0)
 		flags &= ~FBC_ASSERT_FLAGS;
 	if ((t->feature & FEATURE_PSR) == 0)
 		flags &= ~PSR_ASSERT_FLAGS;
+	if ((t->feature & FEATURE_DRRS) == 0)
+		flags &= ~DRRS_ASSERT_FLAGS;
 
 	return flags;
 }
@@ -1699,6 +1810,23 @@ static void do_status_assertions(int flags)
 		return;
 	}
 
+	if (flags & ASSERT_DRRS_HIGH) {
+		if (!is_drrs_high()) {
+			drrs_print_status();
+			igt_assert_f(false, "DRRS HIGH\n");
+		}
+	} else if (flags & ASSERT_DRRS_LOW) {
+		if (!drrs_wait_until_rr_switch_to_low()) {
+			drrs_print_status();
+			igt_assert_f(false, "DRRS LOW\n");
+		}
+	} else if (flags & ASSERT_DRRS_INACTIVE) {
+		if (!is_drrs_inactive()) {
+			drrs_print_status();
+			igt_assert_f(false, "DRRS INACTIVE\n");
+		}
+	}
+
 	if (flags & ASSERT_FBC_ENABLED) {
 		igt_require(!fbc_not_enough_stolen());
 		igt_require(!fbc_stride_not_supported());
@@ -1826,6 +1954,8 @@ static void enable_features_for_test(const struct test_mode *t)
 		fbc_enable();
 	if (t->feature & FEATURE_PSR)
 		psr_enable();
+	if (t->feature & FEATURE_DRRS)
+		drrs_enable();
 }
 
 static void check_test_requirements(const struct test_mode *t)
@@ -1845,6 +1975,18 @@ static void check_test_requirements(const struct test_mode *t)
 			      "Can't test PSR without sink CRCs\n");
 	}
 
+	if (t->feature & FEATURE_DRRS)
+		igt_require_f(drrs.can_test,
+			      "Can't test DRRS with the current outputs\n");
+
+	/*
+	 * In kernel, When PSR is enabled, DRRS will be disabled. So If a test
+	 * case needs DRRS + PSR enabled, that will be skipped.
+	 */
+	igt_require_f(!((t->feature & FEATURE_PSR) &&
+		      (t->feature & FEATURE_DRRS)),
+		      "Can't test PSR and DRRS together\n");
+
 	if (opt.only_pipes != PIPE_COUNT)
 		igt_require(t->pipes == opt.only_pipes);
 }
@@ -1966,7 +2108,7 @@ static void rte_subtest(const struct test_mode *t)
 
 	unset_all_crtcs();
 	do_assertions(ASSERT_FBC_DISABLED | ASSERT_PSR_DISABLED |
-		      DONT_ASSERT_CRC);
+		      DONT_ASSERT_CRC | ASSERT_DRRS_INACTIVE);
 
 	enable_prim_screen_and_wait(t);
 	set_cursor_for_test(t, &prim_mode_params);
@@ -2058,6 +2200,13 @@ static void draw_subtest(const struct test_mode *t)
 	if (op_disables_psr(t, t->method))
 		assertions |= ASSERT_PSR_DISABLED;
 
+	/*
+	 * On FBS_INDIVIDUAL, write to offscreen plane will not touch the
+	 * current frambuffer. Hence assert for DRRS_LOW.
+	 */
+	if ((t->fbs == FBS_INDIVIDUAL) && (t->screen == SCREEN_OFFSCREEN))
+		assertions |= ASSERT_DRRS_LOW;
+
 	prepare_subtest(t, pattern);
 	target = pick_target(t, params);
 
@@ -2266,7 +2415,11 @@ static void slow_draw_subtest(const struct test_mode *t)
 		sleep(2);
 
 		update_wanted_crc(t, &pattern->crcs[t->format][r]);
-		do_assertions(0);
+
+		if (t->feature & FEATURE_DRRS)
+			do_assertions(ASSERT_DRRS_LOW);
+		else
+			do_assertions(0);
 	}
 }
 
@@ -2875,14 +3028,14 @@ static void suspend_subtest(const struct test_mode *t)
 	sleep(5);
 	igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
 	sleep(5);
-	do_assertions(0);
+	do_assertions(ASSERT_DRRS_LOW);
 
 	unset_all_crtcs();
 	sleep(5);
 	igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
 	sleep(5);
 	do_assertions(ASSERT_FBC_DISABLED | ASSERT_PSR_DISABLED |
-		      DONT_ASSERT_CRC);
+		      DONT_ASSERT_CRC | ASSERT_DRRS_INACTIVE);
 
 	set_mode_for_params(params);
 	do_assertions(0);
@@ -3364,6 +3517,14 @@ static const char *feature_str(int feature)
 		return "psr";
 	case FEATURE_FBC | FEATURE_PSR:
 		return "fbcpsr";
+	case FEATURE_DRRS:
+		return "drrs";
+	case FEATURE_FBC | FEATURE_DRRS:
+		return "fbcdrrs";
+	case FEATURE_PSR | FEATURE_DRRS:
+		return "psrdrrs";
+	case FEATURE_FBC | FEATURE_PSR | FEATURE_DRRS:
+		return "fbcpsrdrrs";
 	default:
 		igt_assert(false);
 	}
@@ -3628,7 +3789,7 @@ int main(int argc, char *argv[])
 				tilingchange_subtest(&t);
 		}
 
-		if (t.feature & FEATURE_PSR)
+		if ((t.feature & FEATURE_PSR) || (t.feature & FEATURE_DRRS))
 			igt_subtest_f("%s-slowdraw", feature_str(t.feature))
 				slow_draw_subtest(&t);
 
-- 
1.9.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_frontbuffer_tracking: Including DRRS test coverage (rev2)
  2018-01-31 11:50 [igt-dev] [PATCH igt-dev v15] tests/kms_frontbuffer_tracking: Including DRRS test coverage Lohith BS
@ 2018-02-01  8:27 ` Patchwork
  2018-02-01 10:13 ` [igt-dev] ✗ Fi.CI.IGT: warning " Patchwork
  2018-02-05 17:00 ` [igt-dev] [PATCH igt-dev v15] tests/kms_frontbuffer_tracking: Including DRRS test coverage Rodrigo Vivi
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-02-01  8:27 UTC (permalink / raw)
  To: Lohith BS; +Cc: igt-dev

== Series Details ==

Series: tests/kms_frontbuffer_tracking: Including DRRS test coverage (rev2)
URL   : https://patchwork.freedesktop.org/series/37464/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
7f0be0e7d9becb79630093bf0e6daeadcd937062 tools/intel_reg: Add reading and writing registers through engine

with latest DRM-Tip kernel build CI_DRM_3709
efb4e2e6223b drm-tip: 2018y-02m-01d-07h-23m-44s UTC integration manifest

Testlist changes:
+++ 570 lines
--- 0 lines

Test debugfs_test:
        Subgroup read_all_entries:
                dmesg-fail -> DMESG-WARN (fi-elk-e7500) fdo#103989 +1
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:418s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:426s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:373s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:489s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:285s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:482s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:487s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:471s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:456s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:571s
fi-elk-e7500     total:224  pass:169  dwarn:9   dfail:0   fail:0   skip:45 
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:281s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:509s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:390s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:398s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:415s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:465s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:413s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:457s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:498s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:453s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:499s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:580s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:426s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:505s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:528s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:491s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:486s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:416s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:433s
fi-snb-2520m     total:3    pass:2    dwarn:0   dfail:0   fail:0   skip:0  
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:397s
Blacklisted hosts:
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:473s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_846/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ Fi.CI.IGT: warning for tests/kms_frontbuffer_tracking: Including DRRS test coverage (rev2)
  2018-01-31 11:50 [igt-dev] [PATCH igt-dev v15] tests/kms_frontbuffer_tracking: Including DRRS test coverage Lohith BS
  2018-02-01  8:27 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_frontbuffer_tracking: Including DRRS test coverage (rev2) Patchwork
@ 2018-02-01 10:13 ` Patchwork
  2018-02-05 17:00 ` [igt-dev] [PATCH igt-dev v15] tests/kms_frontbuffer_tracking: Including DRRS test coverage Rodrigo Vivi
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-02-01 10:13 UTC (permalink / raw)
  To: Lohith BS; +Cc: igt-dev

== Series Details ==

Series: tests/kms_frontbuffer_tracking: Including DRRS test coverage (rev2)
URL   : https://patchwork.freedesktop.org/series/37464/
State : warning

== Summary ==

Test perf:
        Subgroup oa-exponents:
                pass       -> FAIL       (shard-apl) fdo#102254
Test kms_flip:
        Subgroup flip-vs-blocking-wf-vblank:
                pass       -> FAIL       (shard-hsw) fdo#100368
Test kms_cursor_legacy:
        Subgroup cursor-vs-flip-legacy:
                pass       -> FAIL       (shard-apl) fdo#103355
Test kms_fbcon_fbt:
        Subgroup fbc-suspend:
                pass       -> SKIP       (shard-snb)
Test drv_selftest:
        Subgroup live_gtt:
                incomplete -> PASS       (shard-apl) fdo#103927
Test gem_eio:
        Subgroup in-flight-suspend:
                fail       -> PASS       (shard-hsw) fdo#104676

fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676

shard-apl        total:3408 pass:1750 dwarn:1   dfail:0   fail:23  skip:1634 time:12824s
shard-hsw        total:3408 pass:1734 dwarn:1   dfail:0   fail:12  skip:1660 time:12001s
shard-snb        total:3408 pass:1329 dwarn:1   dfail:0   fail:10  skip:2068 time:6623s
Blacklisted hosts:
shard-kbl        total:3348 pass:1830 dwarn:6   dfail:0   fail:23  skip:1488 time:9493s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_846/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH igt-dev v15] tests/kms_frontbuffer_tracking: Including DRRS test coverage
  2018-01-31 11:50 [igt-dev] [PATCH igt-dev v15] tests/kms_frontbuffer_tracking: Including DRRS test coverage Lohith BS
  2018-02-01  8:27 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_frontbuffer_tracking: Including DRRS test coverage (rev2) Patchwork
  2018-02-01 10:13 ` [igt-dev] ✗ Fi.CI.IGT: warning " Patchwork
@ 2018-02-05 17:00 ` Rodrigo Vivi
  2 siblings, 0 replies; 4+ messages in thread
From: Rodrigo Vivi @ 2018-02-05 17:00 UTC (permalink / raw)
  To: Lohith BS; +Cc: jari.tahvanainen, igt-dev

On Wed, Jan 31, 2018 at 11:50:22AM +0000, 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].
> 
> v13: En/Dis-able DRRS only when DRRS is capable on the setup.
> 
> v14: Handle the error states of drrs_enable only [Rodrigo].
> 
> v15: Resolved compiler warning and rebased.

thanks

> 
> Signed-off-by: Lohith BS <lohith.bs@intel.com>
> Signed-off-by: aknautiy <ankit.k.nautiyal@intel.com>


Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

and merged...

> ---
>  tests/kms_frontbuffer_tracking.c | 177 +++++++++++++++++++++++++++++++++++++--
>  1 file changed, 169 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
> index 79e4f58..cc08bb9 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
> @@ -182,6 +183,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 {
> @@ -790,7 +798,13 @@ static void __debugfs_read(const char *param, char *buf, int len)
>  	buf[len] = '\0';
>  }
>  
> +static int __debugfs_write(const char *param, char *buf, int len)
> +{
> +	return igt_sysfs_write(drm.debugfs, param, buf, len - 1);
> +}
> +
>  #define debugfs_read(p, arr) __debugfs_read(p, arr, sizeof(arr))
> +#define debugfs_write(p, arr) __debugfs_write(p, arr, sizeof(arr))
>  
>  static bool fbc_is_enabled(int lvl)
>  {
> @@ -818,6 +832,68 @@ static void psr_print_status(void)
>  	igt_info("PSR status:\n%s\n", buf);
>  }
>  
> +void drrs_set(unsigned int val)
> +{
> +	char buf[2];
> +	int ret;
> +
> +	igt_debug("Manually %sabling DRRS. %u\n", val ? "en" : "dis", val);
> +	snprintf(buf, sizeof(buf), "%d", val);
> +	ret = debugfs_write("i915_drrs_ctl", buf);
> +
> +	/*
> +	 * drrs_enable() is called on DRRS capable platform only,
> +	 * whereas drrs_disable() is called on all platforms.
> +	 * So handle the failure of debugfs_write only for drrs_enable().
> +	 */
> +	if (val)
> +		igt_assert_f(ret == (sizeof(buf) - 1), "debugfs_write failed");
> +}
> +
> +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("i915_drrs_status", buf);
> +	igt_info("DRRS STATUS :\n%s\n", buf);
> +}
> +
>  static struct timespec fbc_get_last_action(void)
>  {
>  	struct timespec ret = { 0, 0 };
> @@ -928,10 +1004,17 @@ static bool psr_wait_until_enabled(void)
>  	return igt_wait(psr_is_enabled(), 5000, 1);
>  }
>  
> +static bool drrs_wait_until_rr_switch_to_low(void)
> +{
> +	return igt_wait(is_drrs_low(), 5000, 1);
> +}
> +
>  #define fbc_enable() igt_set_module_param_int("enable_fbc", 1)
>  #define fbc_disable() igt_set_module_param_int("enable_fbc", 0)
>  #define psr_enable() igt_set_module_param_int("enable_psr", 1)
>  #define psr_disable() igt_set_module_param_int("enable_psr", 0)
> +#define drrs_enable()	drrs_set(1)
> +#define drrs_disable()	drrs_set(0)
>  
>  static void get_sink_crc(sink_crc_t *crc, bool mandatory)
>  {
> @@ -1177,6 +1260,7 @@ static void disable_features(const struct test_mode *t)
>  
>  	fbc_disable();
>  	psr_disable();
> +	drrs_disable();
>  }
>  
>  static void *busy_thread_func(void *data)
> @@ -1570,6 +1654,22 @@ static void teardown_psr(void)
>  {
>  }
>  
> +static void setup_drrs(void)
> +{
> +	if (get_connector(prim_mode_params.connector_id)->connector_type !=
> +	    DRM_MODE_CONNECTOR_eDP) {
> +		igt_info("Can't test DRRS: no usable eDP screen.\n");
> +		return;
> +	}
> +
> +	if (!is_drrs_supported()) {
> +		igt_info("Can't test DRRS: Not supported.\n");
> +		return;
> +	}
> +
> +	drrs.can_test = true;
> +}
> +
>  static void setup_environment(void)
>  {
>  	setup_drm();
> @@ -1577,6 +1677,7 @@ static void setup_environment(void)
>  
>  	setup_fbc();
>  	setup_psr();
> +	setup_drrs();
>  
>  	setup_crcs();
>  }
> @@ -1655,6 +1756,11 @@ static void do_flush(const struct test_mode *t)
>  #define ASSERT_PSR_ENABLED		(1 << 6)
>  #define ASSERT_PSR_DISABLED		(1 << 7)
>  
> +#define DRRS_ASSERT_FLAGS		(7 << 8)
> +#define ASSERT_DRRS_HIGH		(1 << 8)
> +#define ASSERT_DRRS_LOW		(1 << 9)
> +#define ASSERT_DRRS_INACTIVE		(1 << 10)
> +
>  static int adjust_assertion_flags(const struct test_mode *t, int flags)
>  {
>  	if (!(flags & DONT_ASSERT_FEATURE_STATUS)) {
> @@ -1662,12 +1768,17 @@ static int adjust_assertion_flags(const struct test_mode *t, int flags)
>  			flags |= ASSERT_FBC_ENABLED;
>  		if (!(flags & ASSERT_PSR_DISABLED))
>  			flags |= ASSERT_PSR_ENABLED;
> +		if (!((flags & ASSERT_DRRS_LOW) ||
> +		    (flags & ASSERT_DRRS_INACTIVE)))
> +			flags |= ASSERT_DRRS_HIGH;
>  	}
>  
>  	if ((t->feature & FEATURE_FBC) == 0)
>  		flags &= ~FBC_ASSERT_FLAGS;
>  	if ((t->feature & FEATURE_PSR) == 0)
>  		flags &= ~PSR_ASSERT_FLAGS;
> +	if ((t->feature & FEATURE_DRRS) == 0)
> +		flags &= ~DRRS_ASSERT_FLAGS;
>  
>  	return flags;
>  }
> @@ -1699,6 +1810,23 @@ static void do_status_assertions(int flags)
>  		return;
>  	}
>  
> +	if (flags & ASSERT_DRRS_HIGH) {
> +		if (!is_drrs_high()) {
> +			drrs_print_status();
> +			igt_assert_f(false, "DRRS HIGH\n");
> +		}
> +	} else if (flags & ASSERT_DRRS_LOW) {
> +		if (!drrs_wait_until_rr_switch_to_low()) {
> +			drrs_print_status();
> +			igt_assert_f(false, "DRRS LOW\n");
> +		}
> +	} else if (flags & ASSERT_DRRS_INACTIVE) {
> +		if (!is_drrs_inactive()) {
> +			drrs_print_status();
> +			igt_assert_f(false, "DRRS INACTIVE\n");
> +		}
> +	}
> +
>  	if (flags & ASSERT_FBC_ENABLED) {
>  		igt_require(!fbc_not_enough_stolen());
>  		igt_require(!fbc_stride_not_supported());
> @@ -1826,6 +1954,8 @@ static void enable_features_for_test(const struct test_mode *t)
>  		fbc_enable();
>  	if (t->feature & FEATURE_PSR)
>  		psr_enable();
> +	if (t->feature & FEATURE_DRRS)
> +		drrs_enable();
>  }
>  
>  static void check_test_requirements(const struct test_mode *t)
> @@ -1845,6 +1975,18 @@ static void check_test_requirements(const struct test_mode *t)
>  			      "Can't test PSR without sink CRCs\n");
>  	}
>  
> +	if (t->feature & FEATURE_DRRS)
> +		igt_require_f(drrs.can_test,
> +			      "Can't test DRRS with the current outputs\n");
> +
> +	/*
> +	 * In kernel, When PSR is enabled, DRRS will be disabled. So If a test
> +	 * case needs DRRS + PSR enabled, that will be skipped.
> +	 */
> +	igt_require_f(!((t->feature & FEATURE_PSR) &&
> +		      (t->feature & FEATURE_DRRS)),
> +		      "Can't test PSR and DRRS together\n");
> +
>  	if (opt.only_pipes != PIPE_COUNT)
>  		igt_require(t->pipes == opt.only_pipes);
>  }
> @@ -1966,7 +2108,7 @@ static void rte_subtest(const struct test_mode *t)
>  
>  	unset_all_crtcs();
>  	do_assertions(ASSERT_FBC_DISABLED | ASSERT_PSR_DISABLED |
> -		      DONT_ASSERT_CRC);
> +		      DONT_ASSERT_CRC | ASSERT_DRRS_INACTIVE);
>  
>  	enable_prim_screen_and_wait(t);
>  	set_cursor_for_test(t, &prim_mode_params);
> @@ -2058,6 +2200,13 @@ static void draw_subtest(const struct test_mode *t)
>  	if (op_disables_psr(t, t->method))
>  		assertions |= ASSERT_PSR_DISABLED;
>  
> +	/*
> +	 * On FBS_INDIVIDUAL, write to offscreen plane will not touch the
> +	 * current frambuffer. Hence assert for DRRS_LOW.
> +	 */
> +	if ((t->fbs == FBS_INDIVIDUAL) && (t->screen == SCREEN_OFFSCREEN))
> +		assertions |= ASSERT_DRRS_LOW;
> +
>  	prepare_subtest(t, pattern);
>  	target = pick_target(t, params);
>  
> @@ -2266,7 +2415,11 @@ static void slow_draw_subtest(const struct test_mode *t)
>  		sleep(2);
>  
>  		update_wanted_crc(t, &pattern->crcs[t->format][r]);
> -		do_assertions(0);
> +
> +		if (t->feature & FEATURE_DRRS)
> +			do_assertions(ASSERT_DRRS_LOW);
> +		else
> +			do_assertions(0);
>  	}
>  }
>  
> @@ -2875,14 +3028,14 @@ static void suspend_subtest(const struct test_mode *t)
>  	sleep(5);
>  	igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
>  	sleep(5);
> -	do_assertions(0);
> +	do_assertions(ASSERT_DRRS_LOW);
>  
>  	unset_all_crtcs();
>  	sleep(5);
>  	igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
>  	sleep(5);
>  	do_assertions(ASSERT_FBC_DISABLED | ASSERT_PSR_DISABLED |
> -		      DONT_ASSERT_CRC);
> +		      DONT_ASSERT_CRC | ASSERT_DRRS_INACTIVE);
>  
>  	set_mode_for_params(params);
>  	do_assertions(0);
> @@ -3364,6 +3517,14 @@ static const char *feature_str(int feature)
>  		return "psr";
>  	case FEATURE_FBC | FEATURE_PSR:
>  		return "fbcpsr";
> +	case FEATURE_DRRS:
> +		return "drrs";
> +	case FEATURE_FBC | FEATURE_DRRS:
> +		return "fbcdrrs";
> +	case FEATURE_PSR | FEATURE_DRRS:
> +		return "psrdrrs";
> +	case FEATURE_FBC | FEATURE_PSR | FEATURE_DRRS:
> +		return "fbcpsrdrrs";
>  	default:
>  		igt_assert(false);
>  	}
> @@ -3628,7 +3789,7 @@ int main(int argc, char *argv[])
>  				tilingchange_subtest(&t);
>  		}
>  
> -		if (t.feature & FEATURE_PSR)
> +		if ((t.feature & FEATURE_PSR) || (t.feature & FEATURE_DRRS))
>  			igt_subtest_f("%s-slowdraw", feature_str(t.feature))
>  				slow_draw_subtest(&t);
>  
> -- 
> 1.9.1
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2018-02-05 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-31 11:50 [igt-dev] [PATCH igt-dev v15] tests/kms_frontbuffer_tracking: Including DRRS test coverage Lohith BS
2018-02-01  8:27 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_frontbuffer_tracking: Including DRRS test coverage (rev2) Patchwork
2018-02-01 10:13 ` [igt-dev] ✗ Fi.CI.IGT: warning " Patchwork
2018-02-05 17:00 ` [igt-dev] [PATCH igt-dev v15] tests/kms_frontbuffer_tracking: Including DRRS test coverage Rodrigo Vivi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.