public inbox for igt-dev@lists.freedesktop.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>
Subject: [igt-dev] [CI 5/5] tests/fbcon_fbt: Enable PSR1 via debugfs
Date: Wed,  5 Sep 2018 14:15:59 -0700	[thread overview]
Message-ID: <20180905211559.30713-5-dhinakaran.pandiyan@intel.com> (raw)
In-Reply-To: <20180905211559.30713-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>
Reviewed-by: José Roberto de Souza <jose.souza@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 d1f3a385..4cfececa 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.17.1

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

  parent reply	other threads:[~2018-09-05 21:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-05 21:15 [igt-dev] [CI 1/5] lib/debugfs: Function to read debugfs with the directory already open Dhinakaran Pandiyan
2018-09-05 21:15 ` [igt-dev] [CI 2/5] tests/psr: Avoid opening of already open debugfs dir Dhinakaran Pandiyan
2018-09-05 21:15 ` [igt-dev] [CI 3/5] tests/fbcon_fbt: Avoid opening debugfs dir repeatedly Dhinakaran Pandiyan
2018-09-05 21:15 ` [igt-dev] [CI 4/5] tests/psr: Test PSR1 in kms_psr Dhinakaran Pandiyan
2018-09-05 21:15 ` Dhinakaran Pandiyan [this message]
2018-09-05 22:58 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [CI,1/5] lib/debugfs: Function to read debugfs with the directory already open Patchwork
2018-09-06  8:10 ` [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=20180905211559.30713-5-dhinakaran.pandiyan@intel.com \
    --to=dhinakaran.pandiyan@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox