Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Swati Sharma <swati2.sharma@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 1/4] lib/igt_kms: add helper to check if output is mst
Date: Wed,  9 Aug 2023 01:10:33 +0530	[thread overview]
Message-ID: <20230808194036.1045626-2-swati2.sharma@intel.com> (raw)
In-Reply-To: <20230808194036.1045626-1-swati2.sharma@intel.com>

Helper is added to check if output is mst or not.

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 lib/igt_kms.c | 21 +++++++++++++++++++++
 lib/igt_kms.h |  1 +
 2 files changed, 22 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index e0959ccff..b3a9375ee 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6039,3 +6039,24 @@ bool i915_pipe_output_combo_valid(igt_display_t *display)
 	 */
 	return igt_check_bigjoiner_support(display);
 }
+
+/**
+ * igt_check_output_is_dp_mst
+ * @drmfd: Handle to open drm device
+ * @output: Target output
+ *
+ * Returns: true if output is dp-mst, else false.
+ */
+bool igt_check_output_is_dp_mst(int drm_fd, igt_output_t *output)
+{
+	struct kmstest_connector_config config;
+	const char *encoder;
+
+	kmstest_get_connector_config(drm_fd, output->config.connector->connector_id, -1, &config);
+	encoder = kmstest_encoder_type_str(config.encoder->encoder_type);
+
+	if (strcmp(encoder, "DP MST"))
+		return false;
+
+	return true;
+}
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 91355c910..d8d6ccfe5 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1013,5 +1013,6 @@ bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock);
 bool igt_check_bigjoiner_support(igt_display_t *display);
 bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode);
 bool i915_pipe_output_combo_valid(igt_display_t *display);
+bool igt_check_output_is_dp_mst(int drmfd, igt_output_t *output);
 
 #endif /* __IGT_KMS_H__ */
-- 
2.25.1

  reply	other threads:[~2023-08-08 19:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08 19:40 [igt-dev] [PATCH i-g-t 0/4] dp-mst helpers Swati Sharma
2023-08-08 19:40 ` Swati Sharma [this message]
2023-08-08 19:40 ` [igt-dev] [PATCH i-g-t 2/4] lib/igt_kms: add helper for dp-mst connector id Swati Sharma
2023-08-08 19:40 ` [igt-dev] [PATCH i-g-t 3/4] tests/kms: use dp-mst helpers Swati Sharma
2023-08-08 19:40 ` [igt-dev] [PATCH i-g-t 4/4] tests/kms_color: skip deep-color test for mst Swati Sharma
2023-08-08 20:31 ` [igt-dev] ✓ Fi.CI.BAT: success for dp-mst helpers (rev2) Patchwork
2023-08-09  0:12 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-08-09  7:19 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-08-06 16:47 [igt-dev] [PATCH i-g-t 0/4] dp-mst helpers Swati Sharma
2023-08-06 16:47 ` [igt-dev] [PATCH i-g-t 1/4] lib/igt_kms: add helper to check if output is mst Swati Sharma

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=20230808194036.1045626-2-swati2.sharma@intel.com \
    --to=swati2.sharma@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