[igt-dev] [PATCH i-g-t 4/6] lib/kms: Reprobe connector state after disabling modest

Arkadiusz Hiler arkadiusz.hiler at intel.com
Fri Apr 3 13:03:04 UTC 2020


With TypeC we don't always get hotplug events for a connector until the
mode is disabled.

Cc: Imre Deak <imre.deak at intel.com>
Issue: https://gitlab.freedesktop.org/drm/intel/issues/323
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
Reviewed-by: Imre Deak <imre.deak at intel.com>
---
 lib/igt_kms.c | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 796da1fb..b461818a 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2040,7 +2040,6 @@ void igt_display_require(igt_display_t *display, int drm_fd)
 
 	for (i = 0; i < display->n_outputs; i++) {
 		igt_output_t *output = &display->outputs[i];
-		drmModeConnector *connector;
 
 		/*
 		 * We don't assign each output a pipe unless
@@ -2051,13 +2050,6 @@ void igt_display_require(igt_display_t *display, int drm_fd)
 		output->display = display;
 
 		igt_output_refresh(output);
-
-		connector = output->config.connector;
-		if (connector && (!connector->count_modes ||
-		    connector->connection == DRM_MODE_UNKNOWNCONNECTION)) {
-			output->force_reprobe = true;
-			igt_output_refresh(output);
-		}
 	}
 
 	drmModeFreePlaneResources(plane_resources);
@@ -2070,6 +2062,25 @@ void igt_display_require(igt_display_t *display, int drm_fd)
 	igt_display_commit2(display,
 			    display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
 
+	/*
+	 * Let's reprobe all connectors to make sure we have up to date stete.
+	 * Some connectors may require disabling modeset to be detected
+	 * correctly.
+	 */
+	for (i = 0; i < display->n_outputs; i++) {
+		igt_output_t *output = &display->outputs[i];
+		drmModeConnector *connector;
+
+		igt_output_refresh(output);
+
+		connector = output->config.connector;
+		if (connector && (!connector->count_modes ||
+		    connector->connection == DRM_MODE_UNKNOWNCONNECTION)) {
+			output->force_reprobe = true;
+			igt_output_refresh(output);
+		}
+	}
+
 out:
 	LOG_UNINDENT(display);
 
-- 
2.24.1



More information about the igt-dev mailing list