All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>,
	rodrigo.vivi@intel.com
Subject: [igt-dev] [PATCH i-g-t 6/6] tests/fbcon_fbt: Enable PSR1 via debugfs
Date: Wed, 29 Aug 2018 14:57:13 -0700	[thread overview]
Message-ID: <20180829215713.20962-6-dhinakaran.pandiyan@intel.com> (raw)
In-Reply-To: <20180829215713.20962-1-dhinakaran.pandiyan@intel.com>

Test only PSR1 on PSR2 panels by making use of the debugfs toggle.

Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 tests/kms_fbcon_fbt.c | 33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c
index e9376cde..e28bd770 100644
--- a/tests/kms_fbcon_fbt.c
+++ b/tests/kms_fbcon_fbt.c
@@ -25,6 +25,7 @@
  */
 
 #include "igt.h"
+#include "igt_psr.h"
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -205,29 +206,39 @@ static bool psr_wait_until_enabled(int fd)
 	return r;
 }
 
+static void disable_features(int fd)
+{
+	igt_set_module_param_int("enable_fbc", 0);
+	psr_disable(fd);
+}
+
+static inline void fbc_modparam_enable(int fd)
+{
+	igt_set_module_param_int("enable_fbc", 1);
+}
+
+static inline void psr_debugfs_enable(int fd)
+{
+	psr_enable(fd);
+}
+
 struct feature {
 	bool (*supported_on_chipset)(int fd);
 	bool (*wait_until_enabled)(int fd);
 	bool (*connector_possible_fn)(drmModeConnectorPtr connector);
-	const char *param_name;
+	void (*enable)(int fd);
 } fbc = {
 	.supported_on_chipset = fbc_supported_on_chipset,
 	.wait_until_enabled = fbc_wait_until_enabled,
 	.connector_possible_fn = connector_can_fbc,
-	.param_name = "enable_fbc",
+	.enable = fbc_modparam_enable,
 }, psr = {
 	.supported_on_chipset = psr_supported_on_chipset,
 	.wait_until_enabled = psr_wait_until_enabled,
 	.connector_possible_fn = connector_can_psr,
-	.param_name = "enable_psr",
+	.enable = psr_debugfs_enable,
 };
 
-static void disable_features(void)
-{
-	igt_set_module_param_int(fbc.param_name, 0);
-	igt_set_module_param_int(psr.param_name, 0);
-}
-
 static void subtest(struct feature *feature, bool suspend)
 {
 	struct drm_info drm;
@@ -237,8 +248,8 @@ static void subtest(struct feature *feature, bool suspend)
 
 	igt_require(feature->supported_on_chipset(drm.debugfs_fd));
 
-	disable_features();
-	igt_set_module_param_int(feature->param_name, 1);
+	disable_features(drm.debugfs_fd);
+	feature->enable(drm.debugfs_fd);
 
 	kmstest_unset_all_crtcs(drm.fd, drm.res);
 	wait_user("Modes unset.");
-- 
2.14.1

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

  parent reply	other threads:[~2018-08-29 21:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-29 21:57 [igt-dev] [PATCH i-g-t 1/6] lib/psr: Add support for toggling edp psr through debugfs, v5 Dhinakaran Pandiyan
2018-08-29 21:57 ` [igt-dev] [PATCH i-g-t 2/6] lib/debugfs: Function to read debugfs with the directory already open Dhinakaran Pandiyan
2018-09-04 21:58   ` Souza, Jose
2018-08-29 21:57 ` [igt-dev] [PATCH i-g-t 3/6] tests/psr: Avoid opening of already open debugfs dir Dhinakaran Pandiyan
2018-09-04 22:07   ` Souza, Jose
2018-09-04 22:08     ` Souza, Jose
2018-08-29 21:57 ` [igt-dev] [PATCH i-g-t 4/6] tests/fbcon_fbt: Avoid opening debugfs dir repeatedly Dhinakaran Pandiyan
2018-09-04 22:12   ` Souza, Jose
2018-08-29 21:57 ` [igt-dev] [PATCH i-g-t 5/6] tests/psr: Test PSR1 in kms_psr Dhinakaran Pandiyan
2018-09-04 22:18   ` Souza, Jose
2018-09-05  1:31     ` Dhinakaran Pandiyan
2018-09-04 22:20   ` Souza, Jose
2018-08-29 21:57 ` Dhinakaran Pandiyan [this message]
2018-09-05 21:10   ` [igt-dev] [PATCH i-g-t 6/6] tests/fbcon_fbt: Enable PSR1 via debugfs Souza, Jose
2018-08-30  8:10 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/6] lib/psr: Add support for toggling edp psr through debugfs, v5 Patchwork
2018-08-30  8:12 ` Patchwork
2018-08-30  8:15 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
2018-08-30  8:27 ` Patchwork
2018-08-30  9:04 ` Patchwork
2018-08-30  9:08 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-09-04 21:59 ` [igt-dev] [PATCH i-g-t 1/6] " Souza, Jose
2018-09-05 17:09   ` Pandiyan, Dhinakaran
2018-09-05 21:05     ` Souza, Jose

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=20180829215713.20962-6-dhinakaran.pandiyan@intel.com \
    --to=dhinakaran.pandiyan@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --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 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.