All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t v2 15/15] kms_panel_fitting: Add tests for fastboot.
Date: Wed,  6 Jul 2016 11:55:55 +0200	[thread overview]
Message-ID: <1467798955-7324-16-git-send-email-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <1467798955-7324-1-git-send-email-maarten.lankhorst@linux.intel.com>

This is a small testcase to ensure fastboot works as intended.
When I removed the pipe updates in intel_update_pipe_config
the test started failing, so I think it's useful to keep.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_panel_fitting.c | 101 ++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 94 insertions(+), 7 deletions(-)

diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
index da09da32d704..acc51ec5cc88 100644
--- a/tests/kms_panel_fitting.c
+++ b/tests/kms_panel_fitting.c
@@ -24,7 +24,7 @@
 
 #include "igt.h"
 #include <math.h>
-
+#include <sys/stat.h>
 
 IGT_TEST_DESCRIPTION("Test display panel fitting");
 
@@ -214,16 +214,103 @@ static void test_panel_fitting(data_t *d)
 	igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
 }
 
-igt_simple_main
+static void
+test_panel_fitting_fastset(igt_display_t *display, const enum pipe pipe, igt_output_t *output)
+{
+	igt_plane_t *primary, *sprite;
+	drmModeModeInfo mode;
+	igt_crc_t topleft, cur_crc;
+	igt_pipe_crc_t *pipe_crc;
+
+	struct igt_fb black, red;
+
+	igt_assert(kmstest_get_connector_default_mode(display->drm_fd, output->config.connector, &mode));
+
+	igt_output_override_mode(output, &mode);
+	igt_output_set_pipe(output, pipe);
+
+	primary = igt_output_get_plane(output, IGT_PLANE_PRIMARY);
+	sprite = igt_output_get_plane(output, IGT_PLANE_2);
+
+	igt_create_color_fb(display->drm_fd, mode.hdisplay, mode.vdisplay,
+			    DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
+			    0.f, 0.f, 0.f, &black);
+
+	igt_create_color_fb(display->drm_fd, 640, 480,
+			    DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
+			    1.f, 0.f, 0.f, &red);
+
+	igt_plane_set_fb(primary, &black);
+	igt_plane_set_fb(sprite, &red);
+
+	igt_display_commit2(display, COMMIT_ATOMIC);
+
+	pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+	igt_pipe_crc_collect_crc(pipe_crc, &topleft);
+
+	mode.hdisplay = 640;
+	mode.vdisplay = 480;
+	igt_output_override_mode(output, &mode);
+
+	igt_plane_set_fb(sprite, NULL);
+	igt_plane_set_fb(primary, &red);
+
+	/* Don't pass ALLOW_MODESET with overridden mode, force fastset. */
+	igt_display_commit_atomic(display, 0, NULL);
+
+	igt_pipe_crc_collect_crc(pipe_crc, &cur_crc);
+
+	igt_assert(!igt_crc_equal(&topleft, &cur_crc));
+
+	igt_plane_set_fb(primary, NULL);
+	igt_output_set_pipe(output, PIPE_NONE);
+	igt_output_override_mode(output, NULL);
+
+	igt_pipe_crc_free(pipe_crc);
+}
+
+static void test_atomic_fastset(igt_display_t *display)
+{
+	igt_output_t *output;
+	enum pipe pipe;
+	int valid_tests = 0;
+	struct stat sb;
+
+	/* Until this is force enabled, force modeset evasion. */
+	if (stat("/sys/module/i915/parameters/fastboot", &sb) == 0)
+		igt_set_module_param_int("fastboot", 1);
+
+	igt_require_pipe_crc();
+	igt_require(display->is_atomic);
+	igt_require(intel_gen(intel_get_drm_devid(display->drm_fd)) >= 5);
+
+	for_each_pipe_with_valid_output(display, pipe, output) {
+		if (!output->config.atomic_props_connector[IGT_CONNECTOR_SCALING_MODE])
+			continue;
+
+		test_panel_fitting_fastset(display, pipe, output);
+		valid_tests++;
+	}
+	igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
+}
+
+igt_main
 {
 	data_t data = {};
 
-	igt_skip_on_simulation();
+	igt_fixture {
+		igt_skip_on_simulation();
+
+		data.drm_fd = drm_open_driver(DRIVER_ANY);
+		igt_display_init(&data.display, data.drm_fd);
+	}
 
-	data.drm_fd = drm_open_driver(DRIVER_ANY);
-	igt_display_init(&data.display, data.drm_fd);
+	igt_subtest("legacy")
+		test_panel_fitting(&data);
 
-	test_panel_fitting(&data);
+	igt_subtest("atomic-fastset")
+		test_atomic_fastset(&data.display);
 
-	igt_display_fini(&data.display);
+	igt_fixture
+		igt_display_fini(&data.display);
 }
-- 
2.5.5

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

      parent reply	other threads:[~2016-07-06  9:56 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06  9:55 [PATCH i-g-t v2 00/15] Add support for atomic modeset to IGT Maarten Lankhorst
2016-07-06  9:55 ` [PATCH i-g-t v2 01/15] igt_kms: Remove kmstest_connector_config.crtc_idx Maarten Lankhorst
2016-07-13 12:13   ` Daniel Vetter
2016-07-19 12:52     ` Maarten Lankhorst
2016-07-06  9:55 ` [PATCH i-g-t v2 02/15] igt_kms: Find optimal encoder only after selecting pipe Maarten Lankhorst
2016-07-15 11:14   ` Ander Conselvan De Oliveira
2016-07-06  9:55 ` [PATCH i-g-t v2 03/15] kms_psr_sink_crc: Use for_each_pipe_with_valid_output to find a valid config Maarten Lankhorst
2016-07-15 11:15   ` Ander Conselvan De Oliveira
2016-07-19 13:58     ` Ander Conselvan De Oliveira
2016-07-20  7:53       ` Maarten Lankhorst
2016-07-20 12:17         ` Ander Conselvan De Oliveira
2016-07-06  9:55 ` [PATCH i-g-t v2 04/15] igt_kms: Make PIPE_ANY a alias for PIPE_NONE Maarten Lankhorst
2016-07-06  9:55 ` [PATCH i-g-t v2 05/15] tests/kms: Clean up more users of unassigned pipes Maarten Lankhorst
2016-07-20 12:56   ` Ander Conselvan De Oliveira
2016-07-21  9:21     ` Maarten Lankhorst
2016-07-25 13:04     ` Maarten Lankhorst
2016-07-06  9:55 ` [PATCH i-g-t v2 06/15] igt_kms: Change PIPE_ANY behavior to mean unassigned Maarten Lankhorst
2016-07-21  9:23   ` Ander Conselvan De Oliveira
2016-07-06  9:55 ` [PATCH i-g-t v2 07/15] igt_kms: Handle atomic pipe properties better Maarten Lankhorst
2016-07-21 10:07   ` Ander Conselvan De Oliveira
2016-07-06  9:55 ` [PATCH i-g-t v2 08/15] igt_kms: Remove pan members from igt_plane, v2 Maarten Lankhorst
2016-07-21 11:42   ` Ander Conselvan De Oliveira
2016-07-21 12:37     ` Maarten Lankhorst
2016-07-06  9:55 ` [PATCH i-g-t v2 09/15] igt_kms: Clear all _changed members centrally Maarten Lankhorst
2016-07-21 12:13   ` Ander Conselvan De Oliveira
2016-07-21 12:43     ` Maarten Lankhorst
2016-07-06  9:55 ` [PATCH i-g-t v2 10/15] igt_kms: Add modeset support to atomic commits Maarten Lankhorst
2016-07-06  9:55 ` [PATCH i-g-t v2 11/15] tests: Add kms_rmfb test Maarten Lankhorst
2016-07-06  9:55 ` [PATCH i-g-t v2 12/15] tests: Add kms_atomic_transition Maarten Lankhorst
2016-07-06  9:55 ` [PATCH i-g-t v2 13/15] igt_kms: Add more apis for panel fitting test Maarten Lankhorst
2016-07-06  9:55 ` [PATCH i-g-t v2 14/15] igt_kms: Allow disabling previous override mode Maarten Lankhorst
2016-07-06  9:55 ` Maarten Lankhorst [this message]

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=1467798955-7324-16-git-send-email-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=intel-gfx@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.