[PATCH i-g-t 3/4] lib/xe_eudebug: Use xe_engine_class_short_string

Manszewski, Christoph christoph.manszewski at intel.com
Thu Dec 12 16:38:56 UTC 2024


Hi Dominik,

On 11.12.2024 12:40, Dominik Grzegorzek wrote:
> Replace local function returning class short name by library function
> defined in xe_query.h.
> 
> Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek at intel.com>

Reviewed-by: Christoph Manszewski <christoph.manszewski at intel.com>

Thanks,
Christoph

> ---
>   lib/xe/xe_eudebug.c | 15 ++-------------
>   1 file changed, 2 insertions(+), 13 deletions(-)
> 
> diff --git a/lib/xe/xe_eudebug.c b/lib/xe/xe_eudebug.c
> index f2483028f..24062e399 100644
> --- a/lib/xe/xe_eudebug.c
> +++ b/lib/xe/xe_eudebug.c
> @@ -16,6 +16,7 @@
>   #include "intel_pat.h"
>   #include "xe_eudebug.h"
>   #include "xe_ioctl.h"
> +#include "xe/xe_query.h"
>   
>   struct event_trigger {
>   	xe_eudebug_trigger_fn fn;
> @@ -124,18 +125,6 @@ static const char *flags_to_str(unsigned int flags)
>   	return "flags unknown";
>   }
>   
> -static const char *eu_engine_class_to_str(uint16_t engine_class)
> -{
> -	switch (engine_class) {
> -	case DRM_XE_ENGINE_CLASS_COMPUTE:
> -		return "ccs";
> -	case DRM_XE_ENGINE_CLASS_RENDER:
> -		return "rcs";
> -	default:
> -		return "unsupported class";
> -	}
> -}
> -
>   static const char *event_members_to_str(struct drm_xe_eudebug_event *e, char *buf)
>   {
>   	switch (e->type) {
> @@ -176,7 +165,7 @@ static const char *event_members_to_str(struct drm_xe_eudebug_event *e, char *bu
>   
>   		for (i = 0; i < ee->num_placements; i++)
>   			l += sprintf(buf + l, "%s%d pad%d, ",
> -				     eu_engine_class_to_str(instances[i].engine_class),
> +				     xe_engine_class_short_string(instances[i].engine_class),
>   				     instances[i].engine_instance, instances[i].pad);
>   		buf[l - 2] = ']';
>   


More information about the igt-dev mailing list