[PATCH i-g-t 4/6] tests/intel/kms_joiner_helper: Add lib changes to check joiner is enabled
Karthik B S
karthik.b.s at intel.com
Fri Jan 31 04:33:17 UTC 2025
Hi,
On 1/30/2025 10:50 PM, Jeevan B wrote:
> Added a library change where we if joiner is enabled or not.
Please fix the commit message.
>
> Signed-off-by: Jeevan B <jeevan.b at intel.com>
> ---
> tests/intel/kms_joiner_helper.c | 38 +++++++++++++++++++++++++++++++++
> tests/intel/kms_joiner_helper.h | 2 ++
> 2 files changed, 40 insertions(+)
>
> diff --git a/tests/intel/kms_joiner_helper.c b/tests/intel/kms_joiner_helper.c
> index af89be777..a86099fb7 100644
> --- a/tests/intel/kms_joiner_helper.c
> +++ b/tests/intel/kms_joiner_helper.c
> @@ -3,6 +3,44 @@
> #include "igt_kms.h"
> #include "intel_chipset.h"
>
> +/**
> + * is_joiner_has
> + * @drmfd: A drm file descriptor
> + *
> + * Returns: True if joiner is enabled, false otherwise.
> + */
> +bool is_joiner_has(int drmfd)
> +{
> + if (!igt_check_joiner_enabled(drmfd)) {
> + igt_debug("Joiner is NOT Enabled\n");
> + return false;
> + }
> +
> + return true;
> +}
Is this wrapper adding any additional value?
> +
> +/**
> + * igt_check_joiner_enabled:
> + * @drmfd: A drm file descriptor
> + *
> + * Returns: True if joiner is enabled, false otherwise.
> + */
> +bool igt_check_joiner_enabled(int drmfd)
> +{
> + char buf[4096];
> + int dir, res;
> +
> + dir = igt_debugfs_dir(drmfd);
> + igt_assert(dir >= 0);
> +
> + res = igt_debugfs_simple_read(dir, "i915_display_info",
> + buf, sizeof(buf));
> + close(dir);
> +
> + return res > 0 ? (strstr(buf, "pipes as a master") &&
> + strstr(buf, "pipes as a slave")) : 0;
Please make the check more specific by checking for the exact pipe we're
committing on.
Thanks,
Karthik.B.S
> +}
> +
> /*
> * Detect if the output needs 1, 2, or 4 pipes (non-joiner, big joiner, ultra).
> * This re-uses your existing logic from:
> diff --git a/tests/intel/kms_joiner_helper.h b/tests/intel/kms_joiner_helper.h
> index 95e71a229..e38b9f61b 100644
> --- a/tests/intel/kms_joiner_helper.h
> +++ b/tests/intel/kms_joiner_helper.h
> @@ -3,6 +3,8 @@
>
> #include "igt_kms.h"
>
> +bool is_joiner_has(int drmfd);
> +bool igt_check_joiner_enabled(int drmfd);
> void igt_set_all_master_pipes_for_platform(igt_display_t *display,
> uint32_t *master_pipes);
> bool igt_assign_pipes_for_outputs(int drm_fd,
More information about the igt-dev
mailing list