Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
To: Swati Sharma <swati2.sharma@intel.com>, igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 2/3] lib/igt_kms: add get_num_scalers()
Date: Fri, 13 Oct 2023 15:06:26 +0300	[thread overview]
Message-ID: <7ef46b76-33f2-25fe-2b9f-97be81febce1@gmail.com> (raw)
In-Reply-To: <20231013102346.95872-3-swati2.sharma@intel.com>

On 13.10.2023 13.23, Swati Sharma wrote:
> Add get_num_scalers(), which will return no. of scalers/CRTC.
> 
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
>   lib/igt_kms.c | 39 +++++++++++++++++++++++++++++++++++++++
>   lib/igt_kms.h |  1 +
>   2 files changed, 40 insertions(+)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 8dc0edc89..666a69495 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -6084,3 +6084,42 @@ int igt_get_dp_mst_connector_id(igt_output_t *output)
>   
>   	return connector_id;
>   }
> +
> +/**
> + * get_num_scalers:
> + * @drm_fd: drm file descriptor
> + * @pipe: display pipe
> + *
> + * Returns: num_scalers supported/pipe.
> + */
> +int get_num_scalers(int drm_fd, enum pipe pipe)
> +{
> +	char buf[8120];
> +	char *start_loc1, *start_loc2;
> +	int dir, res;
> +	int num_scalers = 0;
> +	char dest[20] = ":pipe ";
> +
> +	strcat(dest, kmstest_pipe_name(pipe));
> +
> +	if (is_intel_device(drm_fd) &&
> +	    intel_display_ver(intel_get_drm_devid(drm_fd)) >= 9) {
> +
> +		dir = igt_debugfs_dir(drm_fd);
> +		igt_assert(dir >= 0);
> +
> +		res = igt_debugfs_simple_read(dir, "i915_display_info", buf, sizeof(buf));
> +		close(dir);
> +		igt_require(res > 0);
> +
> +		start_loc1 = strstr(buf, dest);
> +		printf("start_loc1=%s\n", start_loc1);

this printf I think doesn't belong here. Otherwise patch look ok.

> +
> +		if ((start_loc1 = strstr(buf, dest))) {
> +			igt_assert(start_loc2 = strstr(start_loc1, "num_scalers="));
> +			igt_assert_eq(sscanf(start_loc2, "num_scalers=%d", &num_scalers), 1);
> +		}
> +	}
> +
> +	return num_scalers;
> +}
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 4bcaf3f73..356620dc6 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -1016,5 +1016,6 @@ 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(igt_output_t *output);
>   int igt_get_dp_mst_connector_id(igt_output_t *output);
> +int get_num_scalers(int drm_fd, enum pipe pipe);
>   
>   #endif /* __IGT_KMS_H__ */

  reply	other threads:[~2023-10-13 12:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-13 10:23 [igt-dev] [PATCH i-g-t 0/3] tests/kms_plane_scaling: add get_num_scalers() Swati Sharma
2023-10-13 10:23 ` [igt-dev] [PATCH i-g-t 1/3] lib/igt_kms: cosmetic changes Swati Sharma
2023-10-13 10:23 ` [igt-dev] [PATCH i-g-t 2/3] lib/igt_kms: add get_num_scalers() Swati Sharma
2023-10-13 12:06   ` Juha-Pekka Heikkila [this message]
2023-10-13 10:23 ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane_scaling: use get_num_scalers() Swati Sharma
2023-10-13 12:06 ` [igt-dev] [PATCH i-g-t 0/3] tests/kms_plane_scaling: add get_num_scalers() Juha-Pekka Heikkila
2023-10-13 13:30 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_plane_scaling: add get_num_scalers() (rev3) Patchwork
2023-10-13 14:12 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-10-14 14:58 ` [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=7ef46b76-33f2-25fe-2b9f-97be81febce1@gmail.com \
    --to=juhapekka.heikkila@gmail.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