aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2011-12-12 22:34:16 -0500
committerKeith Packard <keithp@keithp.com>2012-01-03 12:09:45 -0500
commit4d85529d584856d077895a2daa703224d3aee7e1 (patch)
tree0ea1a53cb4437d0cd3669792b775300d1677522d /drivers/gpu
parent6ed55ee7da15329476174bc5821dbc723f671f44 (diff)
drm/i915: drpc debugfs update for gen6
Many of the old fields from Ironlake have gone away. Strip all those fields, and try to update to fields people care about. RC information isn't exactly ideal anymore. All we can guarantee when we read the register is that we're not using forcewake, ie. the software isn't forcing the hardware to stay awake. The downside is that in doing this we may wait a while and that causes an unnaturally idle state on the GPU. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42578 Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c86
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h8
2 files changed, 93 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 004b048c5192..11807989f918 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1001,7 +1001,7 @@ static int i915_inttoext_table(struct seq_file *m, void *unused)
1001 return 0; 1001 return 0;
1002} 1002}
1003 1003
1004static int i915_drpc_info(struct seq_file *m, void *unused) 1004static int ironlake_drpc_info(struct seq_file *m)
1005{ 1005{
1006 struct drm_info_node *node = (struct drm_info_node *) m->private; 1006 struct drm_info_node *node = (struct drm_info_node *) m->private;
1007 struct drm_device *dev = node->minor->dev; 1007 struct drm_device *dev = node->minor->dev;
@@ -1068,6 +1068,90 @@ static int i915_drpc_info(struct seq_file *m, void *unused)
1068 return 0; 1068 return 0;
1069} 1069}
1070 1070
1071static int gen6_drpc_info(struct seq_file *m)
1072{
1073
1074 struct drm_info_node *node = (struct drm_info_node *) m->private;
1075 struct drm_device *dev = node->minor->dev;
1076 struct drm_i915_private *dev_priv = dev->dev_private;
1077 u32 rpmodectl1, gt_core_status, rcctl1;
1078 int count=0, ret;
1079
1080
1081 ret = mutex_lock_interruptible(&dev->struct_mutex);
1082 if (ret)
1083 return ret;
1084
1085 if (atomic_read(&dev_priv->forcewake_count)) {
1086 seq_printf(m, "RC information inaccurate because userspace "
1087 "holds a reference \n");
1088 } else {
1089 /* NB: we cannot use forcewake, else we read the wrong values */
1090 while (count++ < 50 && (I915_READ_NOTRACE(FORCEWAKE_ACK) & 1))
1091 udelay(10);
1092 seq_printf(m, "RC information accurate: %s\n", yesno(count < 51));
1093 }
1094
1095 gt_core_status = readl(dev_priv->regs + GEN6_GT_CORE_STATUS);
1096 trace_i915_reg_rw(false, GEN6_GT_CORE_STATUS, gt_core_status, 4);
1097
1098 rpmodectl1 = I915_READ(GEN6_RP_CONTROL);
1099 rcctl1 = I915_READ(GEN6_RC_CONTROL);
1100 mutex_unlock(&dev->struct_mutex);
1101
1102 seq_printf(m, "Video Turbo Mode: %s\n",
1103 yesno(rpmodectl1 & GEN6_RP_MEDIA_TURBO));
1104 seq_printf(m, "HW control enabled: %s\n",
1105 yesno(rpmodectl1 & GEN6_RP_ENABLE));
1106 seq_printf(m, "SW control enabled: %s\n",
1107 yesno((rpmodectl1 & GEN6_RP_MEDIA_MODE_MASK) ==
1108 GEN6_RP_MEDIA_SW_MODE));
1109 seq_printf(m, "RC6 Enabled: %s\n",
1110 yesno(rcctl1 & GEN6_RC_CTL_RC1e_ENABLE));
1111 seq_printf(m, "RC6 Enabled: %s\n",
1112 yesno(rcctl1 & GEN6_RC_CTL_RC6_ENABLE));
1113 seq_printf(m, "Deep RC6 Enabled: %s\n",
1114 yesno(rcctl1 & GEN6_RC_CTL_RC6p_ENABLE));
1115 seq_printf(m, "Deepest RC6 Enabled: %s\n",
1116 yesno(rcctl1 & GEN6_RC_CTL_RC6pp_ENABLE));
1117 seq_printf(m, "Current RC state: ");
1118 switch (gt_core_status & GEN6_RCn_MASK) {
1119 case GEN6_RC0:
1120 if (gt_core_status & GEN6_CORE_CPD_STATE_MASK)
1121 seq_printf(m, "Core Power Down\n");
1122 else
1123 seq_printf(m, "on\n");
1124 break;
1125 case GEN6_RC3:
1126 seq_printf(m, "RC3\n");
1127 break;
1128 case GEN6_RC6:
1129 seq_printf(m, "RC6\n");
1130 break;
1131 case GEN6_RC7:
1132 seq_printf(m, "RC7\n");
1133 break;
1134 default:
1135 seq_printf(m, "Unknown\n");
1136 break;
1137 }
1138
1139 seq_printf(m, "Core Power Down: %s\n",
1140 yesno(gt_core_status & GEN6_CORE_CPD_STATE_MASK));
1141 return 0;
1142}
1143
1144static int i915_drpc_info(struct seq_file *m, void *unused)
1145{
1146 struct drm_info_node *node = (struct drm_info_node *) m->private;
1147 struct drm_device *dev = node->minor->dev;
1148
1149 if (IS_GEN6(dev) || IS_GEN7(dev))
1150 return gen6_drpc_info(m);
1151 else
1152 return ironlake_drpc_info(m);
1153}
1154
1071static int i915_fbc_status(struct seq_file *m, void *unused) 1155static int i915_fbc_status(struct seq_file *m, void *unused)
1072{ 1156{
1073 struct drm_info_node *node = (struct drm_info_node *) m->private; 1157 struct drm_info_node *node = (struct drm_info_node *) m->private;
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 583e8c7569fa..44eabb088b48 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3563,6 +3563,14 @@
3563#define GEN6_PCODE_DATA 0x138128 3563#define GEN6_PCODE_DATA 0x138128
3564#define GEN6_PCODE_FREQ_IA_RATIO_SHIFT 8 3564#define GEN6_PCODE_FREQ_IA_RATIO_SHIFT 8
3565 3565
3566#define GEN6_GT_CORE_STATUS 0x138060
3567#define GEN6_CORE_CPD_STATE_MASK (7<<4)
3568#define GEN6_RCn_MASK 7
3569#define GEN6_RC0 0
3570#define GEN6_RC3 2
3571#define GEN6_RC6 3
3572#define GEN6_RC7 4
3573
3566#define G4X_AUD_VID_DID 0x62020 3574#define G4X_AUD_VID_DID 0x62020
3567#define INTEL_AUDIO_DEVCL 0x808629FB 3575#define INTEL_AUDIO_DEVCL 0x808629FB
3568#define INTEL_AUDIO_DEVBLC 0x80862801 3576#define INTEL_AUDIO_DEVBLC 0x80862801