public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Oleg Vasilev <oleg.vasilev@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH v2] tests/i915/i915_pm_rpm: skip i2c subtest on VGA subconnector
Date: Fri, 30 Aug 2019 13:47:47 +0300	[thread overview]
Message-ID: <20190830104747.17536-1-oleg.vasilev@intel.com> (raw)

The subtest compares EDID obtained through I2C with the one thorugh DRM
interface. Getting EDID through I2C on VGA is not reliable, and the test
should be skipped. However, on some machines VGA connector is
implemented as DP branch device. More background in an fdo bug [1].

The patch enables skips of the test based on a subconnector property,
introduced in the kernel series [2].

V2: free drm property (Simon)

[1]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
[2]: https://patchwork.freedesktop.org/series/65800/

Reviewed-by: Simon Ser <simon.ser@intel.com>
Signed-off-by: Oleg Vasilev <oleg.vasilev@intel.com>
CC: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 tests/i915/i915_pm_rpm.c | 40 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 38 insertions(+), 2 deletions(-)

diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
index 2168ff72..40a8df14 100644
--- a/tests/i915/i915_pm_rpm.c
+++ b/tests/i915/i915_pm_rpm.c
@@ -389,6 +389,43 @@ static drmModePropertyBlobPtr get_connector_edid(drmModeConnectorPtr connector,
 	return blob;
 }
 
+static bool is_vga(drmModeConnectorPtr connector)
+{
+	bool found;
+	uint64_t prop_value;
+	drmModePropertyPtr prop;
+	char *enum_name = NULL;
+	bool is_subconnector_vga = false;
+
+	if (connector->connector_type == DRM_MODE_CONNECTOR_VGA)
+		return true;
+
+	if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort)
+		return false;
+
+	found = kmstest_get_property(drm_fd, connector->connector_id,
+				     DRM_MODE_OBJECT_CONNECTOR, "subconnector",
+				     NULL, &prop_value, &prop);
+
+	igt_assert(found);
+	igt_assert(prop->flags & DRM_MODE_PROP_ENUM);
+
+	for (int i = 0; i < prop->count_enums; i++) {
+		if (prop->enums[i].value == prop_value) {
+			enum_name = prop->enums[i].name;
+			break;
+		}
+	}
+	igt_assert(enum_name);
+
+	is_subconnector_vga = (strcmp(enum_name, "VGA") == 0);
+	if (is_subconnector_vga)
+		igt_debug("This DP is in fact VGA, skipping\n");
+
+	drmModeFreeProperty(prop);
+	return is_subconnector_vga;
+}
+
 static void init_mode_set_data(struct mode_set_data *data)
 {
 	data->res = drmModeGetResources(drm_fd);
@@ -679,7 +716,6 @@ static void test_i2c(struct mode_set_data *data)
 
 		bool got_i2c_edid = i2c_read_edid(connector_name, i2c_edid);
 		bool got_drm_edid = drm_edid != NULL;
-		bool is_vga = data->connectors[i]->connector_type == DRM_MODE_CONNECTOR_VGA;
 
 		bool edids_equal;
 
@@ -688,7 +724,7 @@ static void test_i2c(struct mode_set_data *data)
 		 * the EDID reading mostly FFs and then disabling bit-banging. Since we
 		 * don't want to reimplement everything the Kernel does, let's just
 		 * accept the fact that some VGA outputs won't be properly detected. */
-		if (is_vga)
+		if (is_vga(data->connectors[i]))
 			continue;
 
 		if (!got_i2c_edid && !got_drm_edid)
-- 
2.23.0

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

             reply	other threads:[~2019-08-30 10:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-30 10:47 Oleg Vasilev [this message]
2019-08-30 11:14 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/i915_pm_rpm: skip i2c subtest on VGA subconnector (rev2) Patchwork
2019-08-31  5:38 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

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=20190830104747.17536-1-oleg.vasilev@intel.com \
    --to=oleg.vasilev@intel.com \
    --cc=igt-dev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox