Different GENs have a different ACK register. Use the correct
one for each case.

Suggested-by: Paulo Zanoni <[email protected]>
Signed-off-by: Oscar Mateo <[email protected]>
Cc: Sagar Arun Kamble <[email protected]>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c
index e968aea..36f40ab 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1465,8 +1465,21 @@ static int gen6_drpc_info(struct seq_file *m)
                seq_puts(m, "RC information inaccurate because somebody "
                            "holds a forcewake reference \n");
        } else {
+               i915_reg_t reg_ack;
+
+               if (INTEL_GEN(dev_priv) >= 9)
+                       reg_ack = FORCEWAKE_ACK_RENDER_GEN9;
+               else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
+                       reg_ack = FORCEWAKE_ACK_VLV;
+               else if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
+                       reg_ack = FORCEWAKE_ACK_HSW;
+               else if (IS_IVYBRIDGE(dev_priv))
+                       reg_ack = FORCEWAKE_MT_ACK;
+               else
+                       reg_ack = FORCEWAKE_ACK;
+
                /* NB: we cannot use forcewake, else we read the wrong values */
-               while (count++ < 50 && (I915_READ_NOTRACE(FORCEWAKE_ACK) & 1))
+               while (count++ < 50 && (I915_READ_NOTRACE(reg_ack) & 1))
                        udelay(10);
                seq_printf(m, "RC information accurate: %s\n", yesno(count < 
51));
        }
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to