Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Modem, Bhanuprakash" <bhanuprakash.modem@intel.com>
To: Swati Sharma <swati2.sharma@intel.com>, <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [v2 2/4] lib/igt_kms: add helper for dp-mst connector id
Date: Thu, 17 Aug 2023 23:59:23 +0530	[thread overview]
Message-ID: <9aa74228-8825-61f8-d393-4dced1851ff8@intel.com> (raw)
In-Reply-To: <20230810081743.1065566-3-swati2.sharma@intel.com>

Hi Swati,

On Thu-10-08-2023 01:47 pm, Swati Sharma wrote:
> Helper is added which returns dp-mst connector id.
> 
> v2: -use connector_path instead of blob (Bhanu)
>      -rewrite helper (Bhanu/Ankit)
> 
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
>   lib/igt_kms.c | 34 ++++++++++++++++++++++++++++++++++
>   lib/igt_kms.h |  1 +
>   2 files changed, 35 insertions(+)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index b3a9375ee..e6c26bf0b 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -6060,3 +6060,37 @@ bool igt_check_output_is_dp_mst(int drm_fd, igt_output_t *output)
>   
>   	return true;
>   }
> +
> +static int parse_path_connector(char *connector_path)
> +{
> +	int connector_id;
> +	char *encoder;
> +
> +	encoder = strtok(connector_path, ":");
> +	igt_assert_f(!strcmp(encoder, "mst"), "PATH connector property expected to have 'mst'\n");
> +
> +	connector_id = atoi(strtok(NULL, "-"));
> +
> +	return connector_id;
> +}
> +
> +/**
> + * igt_get_dp_mst_connector_id
> + * @drmfd: Handle to open drm device
> + * @output: Target output
> + *
> + * Returns: connector id if output is dp-mst, else -EINVAL.
> + */
> +int igt_get_dp_mst_connector_id(int drm_fd, igt_output_t *output)
> +{
> +	int connector_id;
> +	char *connector_path;
> +
> +	if (!igt_check_output_is_dp_mst(drm_fd, output))
> +		return -EINVAL;
> +
> +	connector_path = output->config.connector_path;
> +	connector_id = parse_path_connector(connector_path);

If my comment in patch 1/4 is true, then no need to parse the path 
property. We can directly get the connector_id from the 
output->config.connector->connector_id

- Bhanu

> +
> +	return connector_id;
> +}
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index d8d6ccfe5..d83186613 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -1014,5 +1014,6 @@ 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);
> +int igt_get_dp_mst_connector_id(int drmfd, igt_output_t *output);
>   
>   #endif /* __IGT_KMS_H__ */

  reply	other threads:[~2023-08-17 18:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10  8:17 [igt-dev] [v2 0/4] dp-mst helpers Swati Sharma
2023-08-10  8:17 ` [igt-dev] [v2 1/4] lib/igt_kms: add helper to check if output is mst Swati Sharma
2023-08-17 18:20   ` Modem, Bhanuprakash
2023-08-10  8:17 ` [igt-dev] [v2 2/4] lib/igt_kms: add helper for dp-mst connector id Swati Sharma
2023-08-17 18:29   ` Modem, Bhanuprakash [this message]
2023-08-10  8:17 ` [igt-dev] [v2 3/4] tests/kms: use dp-mst helpers Swati Sharma
2023-08-17 18:33   ` Modem, Bhanuprakash
2023-08-10  8:17 ` [igt-dev] [v2 4/4] tests/kms_color: skip deep-color test for mst Swati Sharma
2023-08-17 18:44   ` Modem, Bhanuprakash
2023-08-10 10:45 ` [igt-dev] ○ CI.xeBAT: info for dp-mst helpers (rev3) Patchwork
2023-08-10 10:46 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
2023-08-10 11:21 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
2023-08-17 19:46 ` [igt-dev] ○ CI.xeBAT: info for dp-mst helpers (rev4) Patchwork
2023-08-17 19:58 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-08-18 14:31 ` [igt-dev] ✓ Fi.CI.IGT: " 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=9aa74228-8825-61f8-d393-4dced1851ff8@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=swati2.sharma@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