[PATCH i-g-t 1/4] lib/igt_kms: Add igt_get_joined_pipes_name()

B, Jeevan jeevan.b at intel.com
Wed Jan 8 18:21:17 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 1/4] lib/igt_kms: Add igt_get_joined_pipes_name()
> 
> Add function to transform the enum into a string.
> 
> Signed-off-by: Swati Sharma <swati2.sharma at intel.com>
> ---
>  lib/igt_kms.c | 23 +++++++++++++++++++++++  lib/igt_kms.h |  1 +
>  2 files changed, 24 insertions(+)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c index a67d17c4f..8ee8741d9 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -61,6 +61,7 @@
>  #include "igt_device.h"
>  #include "igt_sysfs.h"
>  #include "sw_sync.h"
> +#include "xe/xe_query.h"
>  #ifdef HAVE_CHAMELIUM
>  #include "igt_chamelium.h"
>  #endif
> @@ -1803,6 +1804,28 @@ bool kmstest_force_connector_joiner(int drm_fd,
> drmModeConnector *connector, int
>  	return true;
>  }
> 
> +/**
> + * igt_get_joined_pipes_name:
> + * @val: forced value
> + *
> + * Simple function to transform the enum into a string.

Returns missing. 
Suggestion for description :  
* Turns a joined_pipes enum value into a readable string, useful for debugging and logs. 
 * If an invalid value is passed, the program will stop with an assertion.

> + */
> +const char *igt_get_joined_pipes_name(enum joined_pipes val) {
> +	switch (val) {
> +	case JOINED_PIPES_DEFAULT:
> +		return "";
> +	case JOINED_PIPES_NONE:
> +		return "-none";
> +	case JOINED_PIPES_BIG_JOINER:
> +		return "-big-joiner";
> +	case JOINED_PIPES_ULTRA_JOINER:
> +		return "-ultra-joiner";
> +	default:
> +		igt_assert(false);
> +	}
> +}
> +
>  /**
>   * kmstest_force_edid:
>   * @drm_fd: drm file descriptor
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 1e2a927ab..c4d76bdcb
> 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -1275,5 +1275,6 @@ int igt_get_dp_pending_retrain(int drm_fd,
> igt_output_t *output);  void igt_reset_link_params(int drm_fd, igt_output_t
> *output);  int igt_backlight_read(int *result, const char *fname,
> igt_backlight_context_t *context);  int igt_backlight_write(int value, const char
> *fname, igt_backlight_context_t *context);
> +const char *igt_get_joined_pipes_name(enum joined_pipes val);
> 
>  #endif /* __IGT_KMS_H__ */
> --
> 2.25.1



More information about the igt-dev mailing list