]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe: Promote xe_hw_engine_class_to_str()
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 17 May 2024 20:43:03 +0000 (13:43 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 21 May 2024 13:33:39 +0000 (06:33 -0700)
Move it out of the sysfs compilation unit so it can be re-used in other
places.

Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Oak Zeng <oak.zeng@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240517204310.88854-2-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_hw_engine.c
drivers/gpu/drm/xe/xe_hw_engine.h
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c

index e19af179af3386f72904d07145e998bc550df768..b71e90c555fa5fb893fc191e18a35cfe88fae91a 100644 (file)
@@ -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 &&
                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;
+       }
+}
index 71968ee2f600d2d917c780ccaa7d59411cb73ebb..843de159e47c357ab613a4f41739b91918732340 100644 (file)
@@ -67,4 +67,6 @@ static inline bool xe_hw_engine_is_valid(struct xe_hw_engine *hwe)
        return hwe->name;
 }
 
+const char *xe_hw_engine_class_to_str(enum xe_engine_class class);
+
 #endif
index 844ec68cbbb86b483d266630fe88dd8824e6eccd..efce6c7dd2a282772d6f747c0faa1fc950c33f20 100644 (file)
@@ -618,24 +618,6 @@ static void hw_engine_class_sysfs_fini(struct drm_device *drm, void *arg)
        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.
  * @gt: Xe GT.