[PATCH 3/8] drm/xe/guc: Add support for threshold KLVs in to_string() helper

Piotr Piórkowski piotr.piorkowski at intel.com
Tue May 14 08:20:58 UTC 2024


Michal Wajdeczko <michal.wajdeczko at intel.com> wrote on pon [2024-maj-06 15:38:09 +0200]:
> Use MAKE_XE_GUC_KLV_THRESHOLDS_SET to generate missing conversion
> of threshold KLV keys to string.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_guc_klv_helpers.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc_klv_helpers.c b/drivers/gpu/drm/xe/xe_guc_klv_helpers.c
> index ceca949932a0..cf7c5fed407d 100644
> --- a/drivers/gpu/drm/xe/xe_guc_klv_helpers.c
> +++ b/drivers/gpu/drm/xe/xe_guc_klv_helpers.c
> @@ -8,6 +8,7 @@
>  
>  #include "abi/guc_klvs_abi.h"
>  #include "xe_guc_klv_helpers.h"
> +#include "xe_guc_klv_thresholds_set.h"
>  
>  #define make_u64(hi, lo) ((u64)((u64)(u32)(hi) << 32 | (u32)(lo)))
>  
> @@ -48,6 +49,14 @@ const char *xe_guc_klv_key_to_string(u16 key)
>  		return "begin_db_id";
>  	case GUC_KLV_VF_CFG_BEGIN_CONTEXT_ID_KEY:
>  		return "begin_ctx_id";
> +
> +	/* VF CFG threshold keys */
> +#define define_threshold_key_to_string_case(TAG, NAME, ...)	\
> +	case MAKE_GUC_KLV_VF_CFG_THRESHOLD_KEY(TAG):		\
> +		return #NAME;
> +	MAKE_XE_GUC_KLV_THRESHOLDS_SET(define_threshold_key_to_string_case)
> +#undef define_threshold_key_to_string_case

In a review of an earlier patch, I already mentioned that placing the definition of this macro
inside the switch worsens the readability of the code, but still:
Reviewed-by: Piotr Piórkowski <piotr.piorkowski at intel.com>
> +
>  	default:
>  		return "(unknown)";
>  	}
> -- 
> 2.43.0
> 

-- 


More information about the Intel-xe mailing list