[Intel-gfx] [PATCH 09/10] drm/i915/step: Add intel_step_name() helper
Anusha Srivatsa
anusha.srivatsa at intel.com
Thu Jul 8 23:18:20 UTC 2021
Add a helper to convert the step info to string.
This is specifically useful when we want to load a specific
firmware for a given stepping/substepping combination.
Suggested-by: Jani Nikula <jani.nikula at linux.intel.com>
Signed-off-by: Anusha Srivatsa <anusha.srivatsa at intel.com>
---
drivers/gpu/drm/i915/intel_step.c | 58 +++++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_step.h | 1 +
2 files changed, 59 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_step.c b/drivers/gpu/drm/i915/intel_step.c
index 99c0d3df001b..9af7f30b777e 100644
--- a/drivers/gpu/drm/i915/intel_step.c
+++ b/drivers/gpu/drm/i915/intel_step.c
@@ -182,3 +182,61 @@ void intel_step_init(struct drm_i915_private *i915)
RUNTIME_INFO(i915)->step = step;
}
+
+const char *intel_step_name(enum intel_step step) {
+ switch (step) {
+ case STEP_A0:
+ return "A0";
+ break;
+ case STEP_A1:
+ return "A1";
+ break;
+ case STEP_A2:
+ return "A2";
+ break;
+ case STEP_B0:
+ return "B0";
+ break;
+ case STEP_B1:
+ return "B1";
+ break;
+ case STEP_B2:
+ return "B2";
+ break;
+ case STEP_C0:
+ return "C0";
+ break;
+ case STEP_C1:
+ return "C1";
+ break;
+ case STEP_D0:
+ return "D0";
+ break;
+ case STEP_D1:
+ return "D1";
+ break;
+ case STEP_E0:
+ return "E0";
+ break;
+ case STEP_F0:
+ return "F0";
+ break;
+ case STEP_G0:
+ return "G0";
+ break;
+ case STEP_H0:
+ return "H0";
+ break;
+ case STEP_I0:
+ return "I0";
+ break;
+ case STEP_I1:
+ return "I1";
+ break;
+ case STEP_J0:
+ return "J0";
+ break;
+ default:
+ return "**";
+ }
+}
diff --git a/drivers/gpu/drm/i915/intel_step.h b/drivers/gpu/drm/i915/intel_step.h
index 3e8b2babd9da..2fbe51483472 100644
--- a/drivers/gpu/drm/i915/intel_step.h
+++ b/drivers/gpu/drm/i915/intel_step.h
@@ -43,5 +43,6 @@ enum intel_step {
};
void intel_step_init(struct drm_i915_private *i915);
+const char *intel_step_name(enum intel_step step);
#endif /* __INTEL_STEP_H__ */
--
2.32.0
More information about the Intel-gfx
mailing list