Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/i915/kms_fbcon_fbt: Execute test on multiple modes
@ 2023-05-09  2:02 Nidhi Gupta
  2023-05-09  2:36 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nidhi Gupta @ 2023-05-09  2:02 UTC (permalink / raw)
  To: igt-dev; +Cc: Nidhi Gupta

In present situation the test is executing only for single mode,
execute the test for the next mode supported by the connector if
the first one is invalid to enable fbc.

Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com>
---
 tests/i915/kms_fbcon_fbt.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/tests/i915/kms_fbcon_fbt.c b/tests/i915/kms_fbcon_fbt.c
index 831ec867..543426d1 100644
--- a/tests/i915/kms_fbcon_fbt.c
+++ b/tests/i915/kms_fbcon_fbt.c
@@ -37,6 +37,7 @@ IGT_TEST_DESCRIPTION("Test the relationship between fbcon and the frontbuffer "
 		     "tracking infrastructure.");
 
 #define MAX_CONNECTORS 32
+int j = 0;
 
 struct drm_info {
 	int fd, debugfs_fd;
@@ -164,14 +165,14 @@ typedef bool (*connector_possible_fn)(drmModeConnectorPtr connector);
 static void set_mode_for_one_screen(struct drm_info *drm,
 				    connector_possible_fn connector_possible)
 {
-	int i, rc;
+	int rc;
 	uint32_t crtc_id;
 	drmModeModeInfoPtr mode;
 	uint32_t buffer_id;
 	drmModeConnectorPtr c = NULL;
 
-	for (i = 0; i < drm->res->count_connectors; i++) {
-		c = drm->connectors[i];
+	for (;j < drm->res->count_connectors; j++) {
+		c = drm->connectors[j];
 
 		if (c->connection == DRM_MODE_CONNECTED && c->count_modes &&
 		    connector_possible(c)) {
@@ -179,7 +180,7 @@ static void set_mode_for_one_screen(struct drm_info *drm,
 			break;
 		}
 	}
-	igt_require_f(i < drm->res->count_connectors,
+	igt_require_f(j < drm->res->count_connectors,
 		      "No connector available\n");
 
 	crtc_id = kmstest_find_crtc_for_connector(drm->fd, drm->res, c, 0);
@@ -348,7 +349,12 @@ static void subtest(struct drm_info *drm, struct feature *feature, bool suspend)
 
 	set_mode_for_one_screen(drm, feature->connector_possible_fn);
 	wait_user("Screen set.");
-	igt_assert(feature->wait_until_enabled(drm->debugfs_fd));
+	if (!(feature->wait_until_enabled(drm->debugfs_fd))) {
+		++j;
+		set_mode_for_one_screen(drm, feature->connector_possible_fn);
+		wait_user("Screen set for next mode.");
+		igt_assert(feature->wait_until_enabled(drm->debugfs_fd));
+	}
 
 	if (suspend) {
 		igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
-- 
2.39.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-09  8:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-09  2:02 [igt-dev] [PATCH i-g-t] tests/i915/kms_fbcon_fbt: Execute test on multiple modes Nidhi Gupta
2023-05-09  2:36 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-05-09  8:40 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-05-09  8:45 ` [igt-dev] [PATCH i-g-t] " Hogander, Jouni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox