All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Zanoni <przanoni@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH igt 4/4] tests/kms_psr_sink_crc: test even if PSR is disabled by default
Date: Thu,  4 Jun 2015 11:31:06 -0300	[thread overview]
Message-ID: <1433428266-1867-4-git-send-email-przanoni@gmail.com> (raw)
In-Reply-To: <1433428266-1867-1-git-send-email-przanoni@gmail.com>

From: Paulo Zanoni <paulo.r.zanoni@intel.com>

Use the igt_set_module_param_int() call to enable it, then restore the
previous value after we are done testing.

With this, we can change the psr_enabled() function to psr_possible():
the only requirement should be that we have a PSR capable sink. The
test should now be able to make "Source_OK" and "Enabled" become true
whenever it wants.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 tests/kms_psr_sink_crc.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 099391b..1823a68 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -203,7 +203,7 @@ static void fill_render(data_t *data, uint32_t handle, unsigned char color)
 	gem_bo_busy(data->drm_fd, handle);
 }
 
-static bool psr_enabled(data_t *data)
+static bool psr_possible(data_t *data)
 {
 	FILE *file;
 	char buf[4096];
@@ -229,14 +229,6 @@ static bool psr_enabled(data_t *data)
 	igt_require_f(ret == 1 && strcmp(buf, "yes") == 0,
 		      "Sink_Support: %s\n", buf);
 
-	ret = fscanf(file, "Source_OK: %s\n", buf);
-	igt_require_f(ret == 1 && strcmp(buf, "yes") == 0,
-		      "Source_OK: %s\n", buf);
-
-	ret = fscanf(file, "Enabled: %s\n", buf);
-	igt_require_f(ret == 1 && strcmp(buf, "yes") == 0,
-		      "Enabled: %s\n", buf);
-
 	fclose(file);
 	return true;
 }
@@ -570,7 +562,9 @@ int main(int argc, char *argv[])
 		kmstest_set_vt_graphics_mode();
 		data.devid = intel_get_drm_devid(data.drm_fd);
 
-		igt_skip_on(!psr_enabled(&data));
+		igt_set_module_param_int("enable_psr", 1);
+
+		igt_skip_on(!psr_possible(&data));
 
 		data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);
 		igt_assert(data.bufmgr);
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-06-04 14:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04 14:31 [PATCH igt 1/4] tests/template: add IGT_TEST_DESCRIPTION Paulo Zanoni
2015-06-04 14:31 ` [PATCH igt 2/4] lib/igt_aux: add functions to manipulate i915.ko parameters Paulo Zanoni
2015-06-04 14:31 ` [PATCH igt 3/4] tests/kms_fbc_crc: run even if FBC is disabled by default Paulo Zanoni
2015-06-15 12:11   ` Daniel Vetter
2015-06-15 14:08     ` Paulo Zanoni
2015-06-15 15:07       ` Daniel Vetter
2015-06-04 14:31 ` Paulo Zanoni [this message]
2015-06-04 16:01   ` [PATCH igt 4/4] tests/kms_psr_sink_crc: test even if PSR " Rodrigo Vivi
2015-06-15 12:11 ` [PATCH igt 1/4] tests/template: add IGT_TEST_DESCRIPTION Daniel Vetter

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=1433428266-1867-4-git-send-email-przanoni@gmail.com \
    --to=przanoni@gmail.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 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.