Commit ab689514 authored by Lucas De Marchi's avatar Lucas De Marchi

drm/xe: Promote xe_hw_engine_class_to_str()

Move it out of the sysfs compilation unit so it can be re-used in other
places.
Reviewed-by: default avatarNirmoy Das <nirmoy.das@intel.com>
Reviewed-by: default avatarOak Zeng <oak.zeng@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240517204310.88854-2-lucas.demarchi@intel.comSigned-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
parent 844f3228
...@@ -1099,3 +1099,21 @@ bool xe_hw_engine_is_reserved(struct xe_hw_engine *hwe) ...@@ -1099,3 +1099,21 @@ bool xe_hw_engine_is_reserved(struct xe_hw_engine *hwe)
return xe->info.has_usm && hwe->class == XE_ENGINE_CLASS_COPY && return xe->info.has_usm && hwe->class == XE_ENGINE_CLASS_COPY &&
hwe->instance == gt->usm.reserved_bcs_instance; hwe->instance == gt->usm.reserved_bcs_instance;
} }
const char *xe_hw_engine_class_to_str(enum xe_engine_class class)
{
switch (class) {
case XE_ENGINE_CLASS_RENDER:
return "rcs";
case XE_ENGINE_CLASS_VIDEO_DECODE:
return "vcs";
case XE_ENGINE_CLASS_VIDEO_ENHANCE:
return "vecs";
case XE_ENGINE_CLASS_COPY:
return "bcs";
case XE_ENGINE_CLASS_COMPUTE:
return "ccs";
default:
return NULL;
}
}
...@@ -67,4 +67,6 @@ static inline bool xe_hw_engine_is_valid(struct xe_hw_engine *hwe) ...@@ -67,4 +67,6 @@ static inline bool xe_hw_engine_is_valid(struct xe_hw_engine *hwe)
return hwe->name; return hwe->name;
} }
const char *xe_hw_engine_class_to_str(enum xe_engine_class class);
#endif #endif
...@@ -618,24 +618,6 @@ static void hw_engine_class_sysfs_fini(struct drm_device *drm, void *arg) ...@@ -618,24 +618,6 @@ static void hw_engine_class_sysfs_fini(struct drm_device *drm, void *arg)
kobject_put(kobj); kobject_put(kobj);
} }
static const char *xe_hw_engine_class_to_str(enum xe_engine_class class)
{
switch (class) {
case XE_ENGINE_CLASS_RENDER:
return "rcs";
case XE_ENGINE_CLASS_VIDEO_DECODE:
return "vcs";
case XE_ENGINE_CLASS_VIDEO_ENHANCE:
return "vecs";
case XE_ENGINE_CLASS_COPY:
return "bcs";
case XE_ENGINE_CLASS_COMPUTE:
return "ccs";
default:
return NULL;
}
}
/** /**
* xe_hw_engine_class_sysfs_init - Init HW engine classes on GT. * xe_hw_engine_class_sysfs_init - Init HW engine classes on GT.
* @gt: Xe GT. * @gt: Xe GT.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment