All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anusha Srivatsa <anusha.srivatsa@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 10/10] drm/i915/dmc: Modify intel_get_stepping_info()
Date: Thu,  8 Jul 2021 16:18:21 -0700	[thread overview]
Message-ID: <20210708231821.9163-11-anusha.srivatsa@intel.com> (raw)
In-Reply-To: <20210708231821.9163-1-anusha.srivatsa@intel.com>

With all platforms having the tepping info in intel_step.c,
it makes no sense to maintain a separate lookup table
in intel_dmc.c Let modify intel_Get_stepping_info()
to grab stepping info from the central location towards
which everything is moving.

Cc: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dmc.c | 51 +++++-------------------
 1 file changed, 9 insertions(+), 42 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c
index f8789d4543bf..895bee8f9782 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -247,50 +247,16 @@ bool intel_dmc_has_payload(struct drm_i915_private *i915)
 	return i915->dmc.dmc_info[DMC_FW_MAIN].payload;
 }
 
-static const struct stepping_info skl_stepping_info[] = {
-	{'A', '0'}, {'B', '0'}, {'C', '0'},
-	{'D', '0'}, {'E', '0'}, {'F', '0'},
-	{'G', '0'}, {'H', '0'}, {'I', '0'},
-	{'J', '0'}, {'K', '0'}
-};
-
-static const struct stepping_info bxt_stepping_info[] = {
-	{'A', '0'}, {'A', '1'}, {'A', '2'},
-	{'B', '0'}, {'B', '1'}, {'B', '2'}
-};
-
-static const struct stepping_info icl_stepping_info[] = {
-	{'A', '0'}, {'A', '1'}, {'A', '2'},
-	{'B', '0'}, {'B', '2'},
-	{'C', '0'}
-};
-
-static const struct stepping_info no_stepping_info = { '*', '*' };
-
 static const struct stepping_info *
-intel_get_stepping_info(struct drm_i915_private *dev_priv)
+intel_get_stepping_info(struct drm_i915_private *dev_priv,
+			struct stepping_info *si)
 {
-	const struct stepping_info *si;
-	unsigned int size;
-
-	if (IS_ICELAKE(dev_priv)) {
-		size = ARRAY_SIZE(icl_stepping_info);
-		si = icl_stepping_info;
-	} else if (IS_SKYLAKE(dev_priv)) {
-		size = ARRAY_SIZE(skl_stepping_info);
-		si = skl_stepping_info;
-	} 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);
+	struct intel_step_info step = RUNTIME_INFO(dev_priv)->step;
+	const char *step_name = intel_step_name(step.display_step);
 
-	return &no_stepping_info;
+	si->stepping = step_name[0];
+        si->substepping = step_name[1];
+	return si;
 }
 
 static void gen9_set_dc_state_debugmask(struct drm_i915_private *dev_priv)
@@ -616,7 +582,8 @@ static void parse_dmc_fw(struct drm_i915_private *dev_priv,
 	struct intel_package_header *package_header;
 	struct intel_dmc_header_base *dmc_header;
 	struct intel_dmc *dmc = &dev_priv->dmc;
-	const struct stepping_info *si = intel_get_stepping_info(dev_priv);
+	struct stepping_info display_info = { '*', '*'};
+	const struct stepping_info *si = intel_get_stepping_info(dev_priv, &display_info);
 	u32 readcount = 0;
 	u32 r, offset;
 	int id;
-- 
2.32.0

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

  parent reply	other threads:[~2021-07-08 23:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 23:18 [Intel-gfx] [PATCH 00/10] Get stepping info from RUNTIME_INFO->step Anusha Srivatsa
2021-07-08 23:18 ` [Intel-gfx] [PATCH 01/10] drm/i915: Make pre-production detection use direct revid comparison Anusha Srivatsa
2021-07-08 23:18 ` [Intel-gfx] [PATCH 02/10] drm/i915/skl: Use revid->stepping tables Anusha Srivatsa
2021-07-08 23:18 ` [Intel-gfx] [PATCH 03/10] drm/i915/icl: " Anusha Srivatsa
2021-07-08 23:18 ` [Intel-gfx] [PATCH 04/10] drm/i915/jsl_ehl: " Anusha Srivatsa
2021-07-08 23:18 ` [Intel-gfx] [PATCH 05/10] drm/i915/rkl: " Anusha Srivatsa
2021-07-08 23:18 ` [Intel-gfx] [PATCH 06/10] drm/i915/dg1: " Anusha Srivatsa
2021-07-08 23:18 ` [Intel-gfx] [PATCH 07/10] drm/i915/cnl: Drop all workarounds Anusha Srivatsa
2021-07-08 23:18 ` [Intel-gfx] [PATCH 08/10] drm/i915/bxt: Use revid->stepping tables Anusha Srivatsa
2021-07-09  3:53   ` Matt Roper
2021-07-08 23:18 ` [Intel-gfx] [PATCH 09/10] drm/i915/step: Add intel_step_name() helper Anusha Srivatsa
2021-07-09  4:16   ` Matt Roper
2021-07-09 17:52     ` Lucas De Marchi
2021-07-09 18:36       ` Srivatsa, Anusha
2021-07-09 18:43         ` Lucas De Marchi
2021-07-08 23:18 ` Anusha Srivatsa [this message]
2021-07-09  0:35 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Get stepping info from RUNTIME_INFO->step Patchwork
2021-07-09  0:36 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-07-09  1:03 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210708231821.9163-11-anusha.srivatsa@intel.com \
    --to=anusha.srivatsa@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.