]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915/tgl: Fix REVID macros for TGL to fetch correct stepping
authorAditya Swarup <aditya.swarup@intel.com>
Thu, 3 Dec 2020 07:23:58 +0000 (23:23 -0800)
committerJani Nikula <jani.nikula@intel.com>
Fri, 18 Dec 2020 10:30:10 +0000 (12:30 +0200)
Fix TGL REVID macros to fetch correct display/gt stepping based
on SOC rev id from INTEL_REVID() macro. Previously, we were just
returning the first element of the revid array instead of using
the correct index based on SOC rev id.

Fixes: c33298cb34f5 ("drm/i915/tgl: Fix stepping WA matching")
Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Aditya Swarup <aditya.swarup@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201203072359.156682-1-aditya.swarup@intel.com
(cherry picked from commit 83dbd74f8243f020d1ad8a3a3b3cd0795067920e)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_drv.h

index 15be8debae5438b03e03a14f881f42655d4e64d0..0a3ee4f9dc0a77d46eda29821a9df04e5a2e7ad1 100644 (file)
@@ -1579,9 +1579,9 @@ static inline const struct i915_rev_steppings *
 tgl_revids_get(struct drm_i915_private *dev_priv)
 {
        if (IS_TGL_U(dev_priv) || IS_TGL_Y(dev_priv))
-               return tgl_uy_revids;
+               return &tgl_uy_revids[INTEL_REVID(dev_priv)];
        else
-               return tgl_revids;
+               return &tgl_revids[INTEL_REVID(dev_priv)];
 }
 
 #define IS_TGL_DISP_REVID(p, since, until) \
@@ -1591,14 +1591,14 @@ tgl_revids_get(struct drm_i915_private *dev_priv)
 
 #define IS_TGL_UY_GT_REVID(p, since, until) \
        ((IS_TGL_U(p) || IS_TGL_Y(p)) && \
-        tgl_uy_revids->gt_stepping >= (since) && \
-        tgl_uy_revids->gt_stepping <= (until))
+        tgl_uy_revids[INTEL_REVID(p)].gt_stepping >= (since) && \
+        tgl_uy_revids[INTEL_REVID(p)].gt_stepping <= (until))
 
 #define IS_TGL_GT_REVID(p, since, until) \
        (IS_TIGERLAKE(p) && \
         !(IS_TGL_U(p) || IS_TGL_Y(p)) && \
-        tgl_revids->gt_stepping >= (since) && \
-        tgl_revids->gt_stepping <= (until))
+        tgl_revids[INTEL_REVID(p)].gt_stepping >= (since) && \
+        tgl_revids[INTEL_REVID(p)].gt_stepping <= (until))
 
 #define RKL_REVID_A0           0x0
 #define RKL_REVID_B0           0x1