[PATCH 2/8] drm/i915/dmc: Use RUNTIME_INFO->step for DMC

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

 



Instead of adding new table for every new platform, lets ues
the stepping info from RUNTIME_INFO(dev_priv)->step
This patch uses RUNTIME_INFO->step only for recent
platforms.

Patches that follow this will address this change for
remaining platforms + missing platforms.

Signed-off-by: Anusha Srivatsa <anusha.srivatsa@xxxxxxxxx>
---
 drivers/gpu/drm/i915/display/intel_dmc.c | 61 +++++++++++++++++++++---
 1 file changed, 54 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c
index f8789d4543bf..a38720f25910 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -266,10 +266,12 @@ static const struct stepping_info icl_stepping_info[] = {
 };
 
 static const struct stepping_info no_stepping_info = { '*', '*' };
+struct stepping_info *display_step;
 
 static const struct stepping_info *
 intel_get_stepping_info(struct drm_i915_private *dev_priv)
 {
+	struct intel_step_info step = RUNTIME_INFO(dev_priv)->step;
 	const struct stepping_info *si;
 	unsigned int size;
 
@@ -282,15 +284,60 @@ intel_get_stepping_info(struct drm_i915_private *dev_priv)
 	} else if (IS_BROXTON(dev_priv)) {
 		size = ARRAY_SIZE(bxt_stepping_info);
 		si = bxt_stepping_info;
-	} else {
-		size = 0;
-		si = NULL;
 	}
 
-	if (INTEL_REVID(dev_priv) < size)
-		return si + INTEL_REVID(dev_priv);
-
-	return &no_stepping_info;
+	if (IS_ICELAKE(dev_priv) || IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv))
+		return INTEL_REVID(dev_priv) < size ? si + INTEL_REVID(dev_priv) : &no_stepping_info;
+
+	else {
+		switch (step.display_step) {
+		case STEP_A0:
+			display_step->stepping = 'A';
+			display_step->substepping = '0';
+			break;
+		case STEP_A2:
+			display_step->stepping = 'A';
+			display_step->substepping = '2';
+			break;
+		case STEP_B0:
+			display_step->stepping = 'B';
+			display_step->substepping = '0';
+			break;
+		case STEP_B1:
+			display_step->stepping = 'B';
+			display_step->substepping = '1';
+			break;
+		case STEP_C0:
+			display_step->stepping = 'C';
+			display_step->substepping = '0';
+			break;
+		case STEP_D0:
+			display_step->stepping = 'D';
+			display_step->substepping = '0';
+			break;
+		case STEP_D1:
+			display_step->stepping = 'D';
+			display_step->substepping = '1';
+			break;
+		case STEP_E0:
+			display_step->stepping = 'E';
+			display_step->substepping = '0';
+			break;
+		case STEP_F0:
+			display_step->stepping = 'F';
+			display_step->substepping = '0';
+			break;
+		case STEP_G0:
+			display_step->stepping = 'G';
+			display_step->substepping = '0';
+			break;
+		default:
+			display_step->stepping = '*';
+			display_step->substepping = '*';
+			break;
+		}
+	}
+	return display_step;
 }
 
 static void gen9_set_dc_state_debugmask(struct drm_i915_private *dev_priv)
-- 
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