From: Jim Bride <jim.bride@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH I-G-T 3/4] tests/kms_frontbuffer_tracking: Refactor to use IGT PSR library functions
Date: Mon, 13 Feb 2017 15:43:27 -0800 [thread overview]
Message-ID: <1487029408-28483-3-git-send-email-jim.bride@linux.intel.com> (raw)
In-Reply-To: <1487029408-28483-1-git-send-email-jim.bride@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Jim Bride <jim.bride@linux.intel.com>
---
tests/kms_frontbuffer_tracking.c | 47 ++++++++--------------------------------
1 file changed, 9 insertions(+), 38 deletions(-)
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 4f4848b..91376e4 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -793,23 +793,6 @@ static void fbc_print_status(void)
igt_info("FBC status:\n%s\n", buf);
}
-static bool psr_is_enabled(void)
-{
- char buf[256];
-
- igt_debugfs_read("i915_edp_psr_status", buf);
- return strstr(buf, "\nActive: yes\n") &&
- strstr(buf, "\nHW Enabled & Active bit: yes\n");
-}
-
-static void psr_print_status(void)
-{
- char buf[256];
-
- igt_debugfs_read("i915_edp_psr_status", buf);
- igt_info("PSR status:\n%s\n", buf);
-}
-
static struct timespec fbc_get_last_action(void)
{
struct timespec ret = { 0, 0 };
@@ -915,15 +898,8 @@ static bool fbc_wait_until_enabled(void)
return igt_wait(fbc_is_enabled(), 2000, 1);
}
-static bool psr_wait_until_enabled(void)
-{
- return igt_wait(psr_is_enabled(), 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)
static void get_sink_crc(sink_crc_t *crc, bool mandatory)
{
@@ -1169,7 +1145,7 @@ static void disable_features(const struct test_mode *t)
return;
fbc_disable();
- psr_disable();
+ igt_psr_disable();
}
static void *busy_thread_func(void *data)
@@ -1529,14 +1505,6 @@ static void teardown_fbc(void)
{
}
-static bool psr_sink_has_support(void)
-{
- char buf[256];
-
- igt_debugfs_read("i915_edp_psr_status", buf);
- return strstr(buf, "Sink_Support: yes\n");
-}
-
static void setup_psr(void)
{
if (get_connector(prim_mode_params.connector_id)->connector_type !=
@@ -1545,7 +1513,7 @@ static void setup_psr(void)
return;
}
- if (!psr_sink_has_support()) {
+ if (!igt_psr_sink_support()) {
igt_info("Can't test PSR: not supported by sink.\n");
return;
}
@@ -1699,12 +1667,15 @@ static int adjust_assertion_flags(const struct test_mode *t, int flags)
} \
\
if (flags_ & ASSERT_PSR_ENABLED) { \
- if (!psr_wait_until_enabled()) { \
- psr_print_status(); \
+ if (!igt_psr_await_status(true)) { \
+ igt_psr_print_status(); \
igt_assert_f(false, "PSR disabled\n"); \
} \
} else if (flags_ & ASSERT_PSR_DISABLED) { \
- igt_assert(!psr_wait_until_enabled()); \
+ if (!igt_psr_await_status(false)) { \
+ igt_psr_print_status(); \
+ igt_assert_f(false, "PSR enabled\n"); \
+ } \
} \
} while (0)
@@ -1804,7 +1775,7 @@ static void enable_features_for_test(const struct test_mode *t)
if (t->feature & FEATURE_FBC)
fbc_enable();
if (t->feature & FEATURE_PSR)
- psr_enable();
+ igt_psr_enable();
}
static void check_test_requirements(const struct test_mode *t)
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-02-13 23:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-13 23:43 [PATCH I-G-T 1/4] lib: Add PSR utility functions to igt library Jim Bride
2017-02-13 23:43 ` [PATCH I-G-T 2/4] tests/kms_psr_sink_crc: Refactor to use new PSR library primitives Jim Bride
2017-03-23 22:22 ` Vivi, Rodrigo
2017-02-13 23:43 ` Jim Bride [this message]
2017-03-23 22:22 ` [PATCH I-G-T 3/4] tests/kms_frontbuffer_tracking: Refactor to use IGT PSR library functions Vivi, Rodrigo
2017-02-13 23:43 ` [PATCH I-G-T 4/4] tests/kms_fbcon_fbt: " Jim Bride
2017-03-23 22:24 ` Vivi, Rodrigo
2017-03-23 22:20 ` [PATCH I-G-T 1/4] lib: Add PSR utility functions to igt library Vivi, Rodrigo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1487029408-28483-3-git-send-email-jim.bride@linux.intel.com \
--to=jim.bride@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.com \
--cc=rodrigo.vivi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox