[PATCH i-g-t 2/4] lib/igt_kms: Add igt_is_(big|ultra)_joiner_supported_by_source()
B, Jeevan
jeevan.b at intel.com
Wed Jan 8 18:26:04 UTC 2025
> -----Original Message-----
> From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of Swati
> Sharma
> Sent: Wednesday, January 8, 2025 12:27 AM
> To: igt-dev at lists.freedesktop.org
> Cc: Nautiyal, Ankit K <ankit.k.nautiyal at intel.com>; Sharma, Swati2
> <swati2.sharma at intel.com>
> Subject: [PATCH i-g-t 2/4] lib/igt_kms: Add
> igt_is_(big|ultra)_joiner_supported_by_source()
>
> Add func() returning true/false if platform supports big/ultra joiner and use
> corresponding func() in related binaries.
>
> Signed-off-by: Swati Sharma <swati2.sharma at intel.com>
> ---
> lib/igt_kms.c | 41 ++++++++++++++++++++++++++++++++++++++++
> lib/igt_kms.h | 2 ++
> tests/intel/kms_joiner.c | 8 +++-----
> 3 files changed, 46 insertions(+), 5 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 8ee8741d9..6640a6a58
> 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -7301,3 +7301,44 @@ int igt_backlight_write(int value, const char
> *fname, igt_backlight_context_t *c
>
> return 0;
> }
> +
> +/**
> + * igt_is_bigjoiner_supported_by_source:
> + * @drm_fd: drm file descriptor
> + *
> + * Returns: True if bigjoiner is supported by platform, false otherwise
> +*/ bool igt_is_bigjoiner_supported_by_source(int drm_fd) {
> + int disp_ver;
> + disp_ver = intel_display_ver(intel_get_drm_devid(drm_fd));
> +
> + if (disp_ver < 12) {
> + igt_info("Bigjoiner is not supported on D11 and older
> platforms\n");
> + return false;
> + }
> +
> + return true;
> +}
> +
> +/**
> + * igt_is_ultrajoiner_supported_by_source:
> + * @drm_fd: drm file descriptor
> + *
> + * Returns: True if ultrajoiner is supported by platform, false
> +otherwise */ bool igt_is_ultrajoiner_supported_by_source(int drm_fd) {
> + bool is_dgfx;
> + int disp_ver;
> +
> + is_dgfx = is_xe_device(drm_fd) ? xe_has_vram(drm_fd) :
> gem_has_lmem(drm_fd);
> + disp_ver = intel_display_ver(intel_get_drm_devid(drm_fd));
> +
> + if ((is_dgfx && disp_ver == 14) || (disp_ver > 14)) {
> + igt_info("Ultrajoiner is supported on igfx with D14+ and on
> dgfx with D14\n");
> + return true;
> + }
> +
> + return false;
> +}
This should be moved inside joiner_helper.c which is been added in this patch.
https://patchwork.freedesktop.org/series/143039/
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h index c4d76bdcb..e8a296c18
> 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -1257,6 +1257,8 @@ bool igt_has_force_joiner_debugfs(int drmfd, char
> *conn_name); bool is_joiner_mode(int drm_fd, igt_output_t *output); bool
> igt_check_force_joiner_status(int drmfd, char *connector_name); bool
> igt_check_bigjoiner_support(igt_display_t *display);
> +bool igt_is_bigjoiner_supported_by_source(int drm_fd); bool
> +igt_is_ultrajoiner_supported_by_source(int drm_fd);
> bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo
> *mode); bool intel_pipe_output_combo_valid(igt_display_t *display); bool
> igt_check_output_is_dp_mst(igt_output_t *output); diff --git
> a/tests/intel/kms_joiner.c b/tests/intel/kms_joiner.c index
> 418ff26a6..2b72aa786 100644
> --- a/tests/intel/kms_joiner.c
> +++ b/tests/intel/kms_joiner.c
> @@ -411,8 +411,8 @@ static void test_ultra_joiner(data_t *data, bool
> invalid_pipe, bool two_display,
>
> igt_main
> {
> - bool ultra_joiner_supported, is_dgfx;
> - int i, j, display_ver;
> + bool ultra_joiner_supported;
> + int i, j;
> igt_output_t *output;
> drmModeModeInfo mode;
> data_t data;
> @@ -434,9 +434,7 @@ igt_main
> igt_require(data.display.is_atomic);
> max_dotclock = igt_get_max_dotclock(data.drm_fd);
>
> - is_dgfx = is_xe_device(data.drm_fd) ?
> xe_has_vram(data.drm_fd) : gem_has_lmem(data.drm_fd);
> - display_ver =
> intel_display_ver(intel_get_drm_devid(data.drm_fd));
> - if ((is_dgfx && display_ver == 14) || (display_ver > 14))
> + if (igt_is_ultrajoiner_supported_by_source(data.drm_fd))
> ultra_joiner_supported = true;
>
> for_each_connected_output(&data.display, output) {
> --
> 2.25.1
More information about the igt-dev
mailing list