drm/i915: Update GEN6_RP_CONTROL definitions
Subsystems (2)
PATCH 1/2 drm/i915: Update GEN6_RP_CONTROL definitions
This matches the modern specs more accurately.
This will be used by the following patch to fix the way we display RC status.
--- drivers/gpu/drm/i915/i915_reg.h | 6 +++++- drivers/gpu/drm/i915/intel_display.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +5 -1
@@ -3469,7 +3469,11 @@#define GEN6_CAGF_MASK (0x7f << GEN6_CAGF_SHIFT)#define GEN6_RP_CONTROL 0xA024#define GEN6_RP_MEDIA_TURBO (1<<11) -#define GEN6_RP_USE_NORMAL_FREQ (1<<9) +#define GEN6_RP_MEDIA_MODE_MASK (3<<9) +#define GEN6_RP_MEDIA_HW_TURBO_MODE (3<<9) +#define GEN6_RP_MEDIA_HW_NORMAL_MODE (2<<9) +#define GEN6_RP_MEDIA_HW_MODE (1<<9) +#define GEN6_RP_MEDIA_SW_MODE (0<<9)#define GEN6_RP_MEDIA_IS_GFX (1<<8)#define GEN6_RP_ENABLE (1<<7)#define GEN6_RP_UP_IDLE_MIN (0x1<<3)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -7949,7 +7949,7 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv)I915_WRITE (GEN6_RP_IDLE_HYSTERSIS ,10 ); I915_WRITE(GEN6_RP_CONTROL, GEN6_RP_MEDIA_TURBO | - GEN6_RP_USE_NORMAL_FREQ | + GEN6_RP_MEDIA_HW_MODE | GEN6_RP_MEDIA_IS_GFX | GEN6_RP_ENABLE | GEN6_RP_UP_BUSY_AVG |
Signature · 1 line
1.7.7.4
PATCH 2/2 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
--- drivers/gpu/drm/i915/i915_debugfs.c | 82 ++++++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/i915_reg.h | 13 +++++- 2 files changed, 93 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +81 -1
@@ -999,7 +999,7 @@ static int i915_inttoext_table(struct seq_file *m, void *unused)return 0 ; } -static int i915_drpc_info (struct seq_file *m,void *unused) +static int ironlake_drpc_info (struct seq_file *m) {struct drm_info_node *node = (struct drm_info_node *) m->private;struct drm_device *dev = node->minor->dev;
@@ -1066,6 +1066,86 @@ static int i915_drpc_info(struct seq_file *m, void *unused)return 0 ; } +static int gen6_drpc_info (struct seq_file *m) +{ + +struct drm_info_node *node = (struct drm_info_node *) m->private; +struct drm_device *dev = node->minor->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +u32 rpmodectl1, gt_core_status, rcctl1; +int count=0 , ret; + + ret =mutex_lock_interruptible (&dev->struct_mutex); +if (ret) +return ret; + +/* NB: we cannot use forcewake, else we read the wrong values */ +while (count++ <50 && (I915_READ_NOTRACE (FORCEWAKE_ACK ) &1 )) +udelay (10 ); + +if (count ==50 ) +DRM_INFO ("Couldn't get accurate RC information\n" ); + + gt_core_status =readl (dev_priv->regs +GEN6_GT_CORE_STATUS ); +trace_i915_reg_rw (false,GEN6_GT_CORE_STATUS , gt_core_status,4 ); + + rpmodectl1 =I915_READ (GEN6_RP_CONTROL ); + rcctl1 =I915_READ (GEN6_RC_CONTROL ); +mutex_unlock (&dev->struct_mutex); + +seq_printf (m,"Video Turbo Mode: %s\n" , +yesno (rpmodectl1 &GEN6_RP_MEDIA_TURBO )); +seq_printf (m,"HW control enabled: %s\n" , +yesno (rpmodectl1 &GEN6_RP_ENABLE )); +seq_printf (m,"SW control enabled: %s\n" , +yesno ((rpmodectl1 &GEN6_RP_MEDIA_MODE_MASK ) == +GEN6_RP_MEDIA_SW_MODE )); +seq_printf (m,"RC6 Enabled: %s\n" , +yesno (rcctl1 & GEN6_RC_CTL_RC1e_ENABLE)); +seq_printf (m,"RC6 Enabled: %s\n" , +yesno (rcctl1 &GEN6_RC_CTL_RC6_ENABLE )); +seq_printf (m,"Deep RC6 Enabled: %s\n" , +yesno (rcctl1 & GEN6_RC_CTL_RC6p_ENABLE)); +seq_printf (m,"Deepest RC6 Enabled: %s\n" , +yesno (rcctl1 & GEN6_RC_CTL_RC6pp_ENABLE)); +seq_printf (m,"Current RC state: " ); +switch (gt_core_status & GEN6_RCn_MASK) { +case GEN6_RC0 : +if (gt_core_status &GEN6_CORE_CPD_STATE_MASK ) +seq_printf (m,"Core Power Down\n" ); +else +seq_printf (m,"on\n" ); +break ; +case GEN6_RC3 : +seq_printf (m,"RC3\n" ); +break ; +case GEN6_RC6 : +seq_printf (m,"RC6\n" ); +break ; +case GEN6_RC7 : +seq_printf (m,"RC7\n" ); +break ; +default : +seq_printf (m,"Unknown\n" ); +break ; + } + +seq_printf (m,"Core Power Down: %s\n" , +yesno (gt_core_status &GEN6_CORE_CPD_STATE_MASK )); +return 0 ; +} + +static int i915_drpc_info (struct seq_file *m,void *unused) +{ +struct drm_info_node *node = (struct drm_info_node *) m->private; +struct drm_device *dev = node->minor->dev; + +if (IS_GEN6 (dev) ||IS_GEN7 (dev)) +return gen6_drpc_info (m); +else +return ironlake_drpc_info (m); +} +static int i915_fbc_status (struct seq_file *m,void *unused) {struct drm_info_node *node = (struct drm_info_node *) m->private;
drivers/gpu/drm/i915/i915_reg.h +12 -1
@@ -3449,8 +3449,11 @@# define GEN6_RCCUNIT_CLOCK_GATE_DISABLE (1 << 11)#define GEN6_RPNSWREQ 0xA008 +#define GEN6_GT_THREAD_P_REQ 0x13807C#define GEN6_TURBO_DISABLE (1<<31) -#define GEN6_FREQUENCY (x) ((x)<<25) +#define GEN6_FREQUENCY_SHIFT 25 +#define GEN6_FREQUENCY_MASK 0x3f +#define GEN6_FREQUENCY (x) ((x)<<GEN6_FREQUENCY_SHIFT)#define GEN6_OFFSET (x) ((x)<<19)#define GEN6_AGGRESSIVE_TURBO (0<<15)#define GEN6_RC_VIDEO_FREQ 0xA00C
@@ -3530,6 +3533,14 @@#define GEN6_PCODE_DATA 0x138128#define GEN6_PCODE_FREQ_IA_RATIO_SHIFT 8 +#define GEN6_GT_CORE_STATUS 0x138060 +#define GEN6_CORE_CPD_STATE_MASK (7<<4) +#define GEN6_RCn_MASK 7 +#define GEN6_RC0 0 +#define GEN6_RC3 2 +#define GEN6_RC6 3 +#define GEN6_RC7 4 +#define G4X_AUD_VID_DID 0x62020#define INTEL_AUDIO_DEVCL 0x808629FB#define INTEL_AUDIO_DEVBLC 0x80862801
Signature · 1 line
1.7.7.4
Re: [PATCH 2/2] drm/i915: drpc debugfs update for gen6
Quoted 8 lines · Ben Widawsky
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.
Quoted 4 lines
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42578
Cc Eugeni Dodonov <[email protected]>Signed-off-by Ben Widawsky <[email protected]>
For both patches:
Just one comment below.
drivers/gpu/drm/i915/i915_debugfs.c static int i915_drpc_info(struct seq_file *m, void *unused) · line 1087
Quoted 3 lines
drivers/gpu/drm/i915/i915_debugfs.c +2
-0+if (count ==50 ) +DRM_INFO ("Couldn't get accurate RC information\n" );
Maybe we should seq_printf() this as well? Like, for example:
seq_printf(m, "RC information accurate: %s\n", yesno(count != 50));
So the userspace consulting this file would know if it should rely on the values or retry the read..
Just an idea.
Signature · 2 lines
Eugeni Dodonov <http://eugeni.dodonov.net/>
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/2] drm/i915: drpc debugfs update for gen6
Quoted 25 lines · Eugeni Dodonov
Quoted 8 lines · Ben Widawsky
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.
Quoted 4 lines
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42578
Cc Eugeni Dodonov <[email protected]>Signed-off-by Ben Widawsky <[email protected]>For both patches:
Reviewed-by Eugeni Dodonov <[email protected]>Just one comment below.
drivers/gpu/drm/i915/i915_debugfs.c static int i915_drpc_info(struct seq_file *m, void *unused) · line 1087
Quoted 3 lines
drivers/gpu/drm/i915/i915_debugfs.c +2
-0+if (count ==50 ) +DRM_INFO ("Couldn't get accurate RC information\n" );
Quoted 8 lines
Maybe we should
seq_printf()this as well? Like, for example:
seq_printf(m, "RC information accurate: %s\n", yesno(count != 50));So the userspace consulting this file would know if it should rely on the values or retry the read..
Just an idea.
It's a good idea... I should almost definitely do that since the information is *almost* definitely incorrect (unless we got really lucky and the bit flipped after we gave up).
Also on second thought, I should probably check if user forcewake is set, in which case I can recommend they unset it before reading the value.
I'll redo this.
Thanks.
Ben