Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH] tests/kms_dp_aux_dev: Handle AUX failures on disconnected MST connectors
@ 2020-10-12 17:56 Imre Deak
  2020-10-12 18:37 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Imre Deak @ 2020-10-12 17:56 UTC (permalink / raw)
  To: igt-dev

The DPCD of an MST connector is read out with a REMOTE_DPCD_READ MST
request. If the given connector is disconnected this read will result in
an MST NAK reply and this will be reported as an EIO error to the
initiator of the AUX read.

Handle this in the test that attempts to read the DPCD of any exposed
connector, whether they are connected or not.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 tests/kms_dp_aux_dev.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/tests/kms_dp_aux_dev.c b/tests/kms_dp_aux_dev.c
index 4f52434a..39fc2b92 100644
--- a/tests/kms_dp_aux_dev.c
+++ b/tests/kms_dp_aux_dev.c
@@ -34,6 +34,14 @@
 
 IGT_TEST_DESCRIPTION("Test that /dev/drm_dp_aux reads work");
 
+static bool is_mst_connector(int drm_fd, uint32_t connector_id)
+{
+	return kmstest_get_property(drm_fd, connector_id,
+				    DRM_MODE_OBJECT_CONNECTOR,
+				    "PATH", NULL,
+				    NULL, NULL);
+}
+
 static bool test(int drm_fd, uint32_t connector_id)
 {
 	drmModeConnector *connector;
@@ -67,10 +75,12 @@ static bool test(int drm_fd, uint32_t connector_id)
 		igt_assert(fd >= 0);
 
 		ret = read(fd, buf, sizeof(buf));
-		igt_assert(ret == sizeof(buf) || errno == ETIMEDOUT);
-
 		igt_info("%s: %s\n", path,
-			 ret > 0 ? "success" : "timed out");
+			 ret > 0 ? "success" : strerror(errno));
+
+		igt_assert(ret == sizeof(buf) ||
+			   errno == ETIMEDOUT ||
+			   (errno == EIO && is_mst_connector(drm_fd, connector_id)));
 
 		close(fd);
 
-- 
2.20.1

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

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

end of thread, other threads:[~2020-10-15 19:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-12 17:56 [igt-dev] [PATCH] tests/kms_dp_aux_dev: Handle AUX failures on disconnected MST connectors Imre Deak
2020-10-12 18:37 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2020-10-12 19:57   ` Imre Deak
2020-10-12 20:11 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2020-10-13  0:52 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-10-13  7:18 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2020-10-13 11:27 ` [igt-dev] [PATCH] " Ville Syrjälä
2020-10-13 11:36   ` Imre Deak
2020-10-13 12:56     ` Ville Syrjälä
2020-10-13 13:19       ` Imre Deak
2020-10-15 14:29         ` Imre Deak
2020-10-15 19:08           ` Ville Syrjälä
2020-10-15 19:08 ` Ville Syrjälä

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