Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/igt_kms: Improve connector probing in igt_display_init()
@ 2018-03-26 10:40 Maarten Lankhorst
  2018-03-26 11:06 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  0 siblings, 1 reply; 11+ messages in thread
From: Maarten Lankhorst @ 2018-03-26 10:40 UTC (permalink / raw)
  To: igt-dev

Only do a full probe when the initial connector status is unknown, and
otherwise skip it. This should speed up kms tests ever so slightly.

Also set pipe to PIPE_NONE for igt_output_refresh(), to make the
connector info slightly more accurate.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 lib/igt_kms.c | 17 +++++++++++++----
 lib/igt_kms.h |  2 +-
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index d8f69d3db9ca..44f6ae977092 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -974,7 +974,7 @@ _kmstest_connector_config_find_encoder(int drm_fd, drmModeConnector *connector,
 static bool _kmstest_connector_config(int drm_fd, uint32_t connector_id,
 				      unsigned long crtc_idx_mask,
 				      struct kmstest_connector_config *config,
-				      bool probe)
+				      int probe)
 {
 	drmModeRes *resources;
 	drmModeConnector *connector;
@@ -988,11 +988,19 @@ static bool _kmstest_connector_config(int drm_fd, uint32_t connector_id,
 	}
 
 	/* First, find the connector & mode */
-	if (probe)
+	if (probe > 0)
 		connector = drmModeGetConnector(drm_fd, connector_id);
-	else
+	else {
 		connector = drmModeGetConnectorCurrent(drm_fd, connector_id);
 
+		if (probe < 0 && connector &&
+		    connector->connection == DRM_MODE_UNKNOWNCONNECTION) {
+			drmModeFreeConnector(connector);
+
+			connector = drmModeGetConnector(drm_fd, connector_id);
+		}
+	}
+
 	if (!connector)
 		goto err2;
 
@@ -2028,7 +2036,8 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 		 * We don't assign each output a pipe unless
 		 * a pipe is set with igt_output_set_pipe().
 		 */
-		output->force_reprobe = true;
+		output->force_reprobe = -1;
+		output->pipe = PIPE_NONE;
 		output->id = resources->connectors[i];
 		output->display = display;
 
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 6f16dc8cf85e..9e734ab1a5b8 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -340,7 +340,7 @@ typedef struct {
 	uint32_t id;					/* KMS id */
 	struct kmstest_connector_config config;
 	char *name;
-	bool force_reprobe;
+	int force_reprobe;
 	enum pipe pending_pipe;
 	bool use_override_mode;
 	drmModeModeInfo override_mode;
-- 
2.16.3

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

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

end of thread, other threads:[~2018-03-28 13:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-26 10:40 [igt-dev] [PATCH i-g-t] lib/igt_kms: Improve connector probing in igt_display_init() Maarten Lankhorst
2018-03-26 11:06 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2018-03-26 11:22   ` [igt-dev] [PATCH i-g-t] " Maarten Lankhorst
2018-03-27 13:28     ` Arkadiusz Hiler
2018-03-28  8:37       ` [igt-dev] [PATCH i-g-t] lib/igt_kms: Improve connector probing in igt_display_init(), v2 Maarten Lankhorst
2018-03-28  9:20         ` Arkadiusz Hiler
2018-03-28 11:50           ` Maarten Lankhorst
2018-03-26 11:41   ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_kms: Improve connector probing in igt_display_init() (rev2) Patchwork
2018-03-26 13:41   ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-03-28  9:04   ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_kms: Improve connector probing in igt_display_init() (rev3) Patchwork
2018-03-28 13:58   ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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