From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 4/5] tests/kms_frontbuffer_tracking: Add support for toggling edp psr through debugfs.
Date: Mon, 12 Mar 2018 18:30:12 +0100 [thread overview]
Message-ID: <20180312173013.50903-5-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20180312173013.50903-1-maarten.lankhorst@linux.intel.com>
It's harmful to write to enable_psr at runtime, and the patch that allows
us to change i915_edp_psr_status with the panel running will require us
to abandon the module parameter. Hence the userspace change needs to be
put in IGT first before we can change it at kernel time.
Toggling it to debugfs will mean we can skip a modeset when changing our
feature set.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
tests/kms_frontbuffer_tracking.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 000f54eef408..7fe392bc0a08 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -799,11 +799,29 @@ static void drrs_set(int val)
igt_assert_f(ret == (sizeof(buf) - 1), "debugfs_write failed");
}
+static void restore_psr_debugfs(int sig)
+{
+ debugfs_write("i915_edp_psr_status", "-1");
+}
+
static bool psr_set(int val)
{
- int oldval;
+ char buf[4];
+ int ret, oldval;
static int default_psr = -1;
+ snprintf(buf, sizeof(buf), "%i\n", val);
+
+ ret = debugfs_write("i915_edp_psr_status", buf);
+ if (ret != -EINVAL) {
+ igt_assert(ret > 0 || val <= 0);
+
+ if (ret > 0)
+ igt_install_exit_handler(restore_psr_debugfs);
+
+ return false;
+ }
+
oldval = igt_get_module_param_int("enable_psr");
if (default_psr == -1)
default_psr = oldval;
--
2.16.2
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-03-12 17:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-12 17:30 [igt-dev] [PATCH i-g-t 0/5] tests/kms_frontbuffer_tracking: Rework to prevent modesets! Maarten Lankhorst
2018-03-12 17:30 ` [igt-dev] [PATCH i-g-t 1/5] lib/igt_aux: Add igt_get_module_param_int Maarten Lankhorst
2018-03-14 14:00 ` Chris Wilson
2018-03-12 17:30 ` [igt-dev] [PATCH i-g-t 2/5] tests/kms_frontbuffer_tracking: Rework toggling drrs/fbc/psr Maarten Lankhorst
2018-03-12 17:30 ` [igt-dev] [PATCH i-g-t 3/5] tests/kms_frontbuffer_tracking: Fix basic subtest Maarten Lankhorst
2018-03-12 17:30 ` Maarten Lankhorst [this message]
2018-03-12 17:30 ` [igt-dev] [PATCH i-g-t 5/5] tests/kms_frontbuffer_tracking: Remove redundant modesets during subtest start, v2 Maarten Lankhorst
2018-03-12 23:51 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_frontbuffer_tracking: Rework to prevent modesets! Patchwork
2018-03-13 5:02 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
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=20180312173013.50903-5-maarten.lankhorst@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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 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.