Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t 2/5] lib/igt_kms: Identify outputs that shares link bandwidth
Date: Sat, 10 Apr 2021 01:00:45 +0530	[thread overview]
Message-ID: <20210409193048.6857-3-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20210409193048.6857-1-bhanuprakash.modem@intel.com>

We have to read the PATH property and parse it to identify the
connector that shares the BW of the same link. Parsing the PATH
property consists of finding all connectors with the same X prefix
in the X-Y[-Z...] path property format and assigning a unique
non-zero link_group_id to all such connectors.

Connectors without a PATH property are not an MST output, so their
link_group_id can be left at 0.

v2:
Update the link_group_id in igt_output_refresh(). (Ankit)

Cc: Imre Deak <imre.deak@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 lib/igt_kms.c | 29 +++++++++++++++++++++++++++++
 lib/igt_kms.h |  1 +
 2 files changed, 30 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index f1a989368..1ba938982 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1684,6 +1684,32 @@ static void igt_display_log_shift(igt_display_t *display, int shift)
 	igt_assert(display->log_shift >= 0);
 }
 
+static
+void igt_update_output_link_group_id(int drmfd, igt_output_t *output)
+{
+	uint64_t blob_id;
+	drmModePropertyBlobPtr blob;
+	char *temp;
+
+	if(!igt_output_has_prop(output, IGT_CONNECTOR_PATH)) {
+		output->link_group_id = 0;
+		return;
+	}
+
+	blob_id = igt_output_get_prop(output, IGT_CONNECTOR_PATH);
+	blob = drmModeGetPropertyBlob(drmfd, blob_id);
+	igt_assert(blob);
+
+	temp = strtok((char *)blob->data, ":");
+	if (strcmp(temp, "mst") == 0)
+		output->link_group_id = atoi(strtok(NULL, "-"));
+	else
+		output->link_group_id = 0;
+
+	drmModeFreePropertyBlob(blob);
+	return;
+}
+
 void igt_output_refresh(igt_output_t *output)
 {
 	igt_display_t *display = output->display;
@@ -1709,6 +1735,9 @@ void igt_output_refresh(igt_output_t *output)
 		igt_atomic_fill_connector_props(display, output,
 			IGT_NUM_CONNECTOR_PROPS, igt_connector_prop_names);
 
+	/* Identify all connectors that share the BW of the same link */
+	igt_update_output_link_group_id(display->drm_fd, output);
+
 	LOG(display, "%s: Selecting pipe %s\n", output->name,
 	    kmstest_pipe_name(output->pending_pipe));
 }
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 39a1ea570..c828e78b5 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -386,6 +386,7 @@ typedef struct {
 	drmModeModeInfo override_mode;
 
 	int32_t writeback_out_fence_fd;
+	int link_group_id;
 
 	/* bitmask of changed properties */
 	uint64_t changed;
-- 
2.20.1

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

  parent reply	other threads:[~2021-04-09 11:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 19:30 [igt-dev] [PATCH i-g-t 0/5] Fix mode selection for 2x tests Bhanuprakash Modem
2021-04-09 13:25 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-04-09 15:55 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-04-09 19:30 ` [igt-dev] [PATCH i-g-t 1/5] lib/igt_kms: Add a support to read PATH connector property Bhanuprakash Modem
2021-04-09 19:30 ` Bhanuprakash Modem [this message]
2021-04-09 19:30 ` [igt-dev] [PATCH i-g-t 3/5] lib/igt_kms: helper to override the mode on all connectors Bhanuprakash Modem
2021-04-09 19:30 ` [igt-dev] [PATCH i-g-t 4/5] tests/kms_frontbuffer_tracking: Fix mode selection for 2x tests Bhanuprakash Modem
2021-04-09 19:30 ` [igt-dev] [PATCH i-g-t 5/5] tests/kms_cursor_legacy: " Bhanuprakash Modem
2021-04-09 20:18 ` [igt-dev] [PATCH i-g-t 0/5] " Daniel Vetter
2021-04-12  3:51   ` Modem, Bhanuprakash
2021-04-14 15:24     ` Daniel Vetter
2021-04-14 16:06       ` Imre Deak
2021-04-14 18:37         ` Daniel Vetter
2021-04-14 19:01           ` Imre Deak
2021-04-15 12:13             ` Nautiyal, Ankit K
2021-04-15 12:56             ` Modem, Bhanuprakash
2021-04-15 14:15               ` Daniel Vetter

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=20210409193048.6857-3-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    /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