[PATCH 09/10] drm/i915/step: Add intel_step_name() helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@xxxxxxxxx>
---
 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux