Add power feature debugfs disabling
Subsystems (2)
cover Add power feature debugfs disabling
From: Jeff McGee <[email protected]>
This series has recently been accepted into the Haswell Android kernel and helps with debugging and profiling these power features. I would like it to be considered for upstream incorporation. The patches here have been rebased (minimal changes required) and compile-tested only.
Broad device support is provided, accept for RPS and RC6 with Broadwell and Valleyview. Both of these were somewhat of a moving target and I didn't have devices to work with. Support can of course be added with help from appropriate folks.
The hooks introduce some amount of overhead as an additional check is often needed to determine whether the feature is on or off - similar to the module parameters that already exist. I felt that the overhead was minimal enough and didn't want to ugly up the code with CONFIG_DEBUG_FS compile conditionals. But I'm open to the list's thoughts on this.
IGT tests of these new interfaces can certainly be added. I wanted to make sure there was sufficient interest in having these interfaces before starting on the tests. So please provide feedback.
Thanks,
Jeff
Jeff McGee (5):
drm/i915: Add RPS debugfs manual mode
drm/i915: Add RC6 debugfs disabling
drm/i915: Add IPS debugfs disabling
drm/i915: Add FBC debugfs disabling
drm/i915: Add CxSR debugfs disabling
drivers/gpu/drm/i915/i915_debugfs.c | 300 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_drv.h | 14 ++ drivers/gpu/drm/i915/i915_irq.c | 6 + drivers/gpu/drm/i915/intel_display.c | 4 + drivers/gpu/drm/i915/intel_pm.c | 125 +++++++++++---- 5 files changed, 420 insertions(+), 29 deletions(-)
Signature · 1 line
1.8.5.2
PATCH 1/5 drm/i915: Add RPS debugfs manual mode
From: Jeff McGee <[email protected]>
RPS manual mode disables/ignores load-based inputs and allows render performance state to be controlled externally. The enabling of manual mode and setting of desired frequency is done through debugfs.
i915_rps_manual:
'0' - RPS controlled normally using load metrics. '1' - RPS controlled manually via i915_cur_freq writes.
i915_cur_freq:
u64 - Value is the current gpu frequency request in MHz. Writes
accepted only if i915_rps_manual = 1.
Supports Gen6+ except Valleyview and Broadwell.
--- drivers/gpu/drm/i915/i915_debugfs.c | 111 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_drv.h | 2 + drivers/gpu/drm/i915/i915_irq.c | 6 ++ drivers/gpu/drm/i915/intel_pm.c | 42 ++++++++++++-- 4 files changed, 156 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +111 -0
@@ -3322,6 +3322,115 @@ DEFINE_SIMPLE_ATTRIBUTE(i915_min_freq_fops, i915_min_freq_get, i915_min_freq_set, "%llu\n"); +static int i915_cur_freq_get (void *data,u64 *val) +{ +struct drm_device *dev = data; +drm_i915_private_t *dev_priv = dev->dev_private; + +if ((INTEL_INFO (dev)->gen <6 ) || +IS_VALLEYVIEW (dev) || +IS_BROADWELL (dev)) +return -ENODEV ; + +flush_delayed_work (&dev_priv->rps.delayed_resume_work); + + *val = dev_priv->rps.cur_delay *GT_FREQUENCY_MULTIPLIER ; + +return 0 ; +} + +static int i915_cur_freq_set (void *data,u64 val) +{ +struct drm_device *dev = data; +struct drm_i915_private *dev_priv = dev->dev_private; +u64 freq = val; +int ret; + +if ((INTEL_INFO (dev)->gen <6 ) || +IS_VALLEYVIEW (dev) || +IS_BROADWELL (dev)) +return -ENODEV ; + +flush_delayed_work (&dev_priv->rps.delayed_resume_work); + + ret =mutex_lock_interruptible (&dev_priv->rps.hw_lock); +if (ret) +return ret; + +/* Must be in manual mode to guarantee setting will persist. */ +if (!dev_priv->rps.manual_mode) { +mutex_unlock (&dev_priv->rps.hw_lock); +return -EINVAL ; + } + +do_div (val,GT_FREQUENCY_MULTIPLIER ); + +if (val < dev_priv->rps.min_delay || val > dev_priv->rps.max_delay) { +mutex_unlock (&dev_priv->rps.hw_lock); +return -EINVAL ; + } + +DRM_DEBUG_DRIVER ("Setting current freq to %llu\n" , freq); + +gen6_set_rps (dev, val); + +mutex_unlock (&dev_priv->rps.hw_lock); + +return 0 ; +} + +DEFINE_SIMPLE_ATTRIBUTE (i915_cur_freq_fops, + i915_cur_freq_get, i915_cur_freq_set, +"%llu\n" ); + +static int i915_rps_manual_get (void *data,u64 *val) +{ +struct drm_device *dev = data; +drm_i915_private_t *dev_priv = dev->dev_private; + +if ((INTEL_INFO (dev)->gen <6 ) || +IS_VALLEYVIEW (dev) || +IS_BROADWELL (dev)) +return -ENODEV ; + +flush_delayed_work (&dev_priv->rps.delayed_resume_work); + + *val = dev_priv->rps.manual_mode; + +return 0 ; +} + +static int i915_rps_manual_set (void *data,u64 val) +{ +struct drm_device *dev = data; +struct drm_i915_private *dev_priv = dev->dev_private; +int ret; + +if ((INTEL_INFO (dev)->gen <6 ) || +IS_VALLEYVIEW (dev) || +IS_BROADWELL (dev)) +return -ENODEV ; + +flush_delayed_work (&dev_priv->rps.delayed_resume_work); + +DRM_DEBUG_DRIVER ("Setting RPS mode to %s\n" , + val ?"manual" :"normal" ); + + ret =mutex_lock_interruptible (&dev_priv->rps.hw_lock); +if (ret) +return ret; + +gen6_set_rps_mode (dev, val); + +mutex_unlock (&dev_priv->rps.hw_lock); + +return 0 ; +} + +DEFINE_SIMPLE_ATTRIBUTE (i915_rps_manual_fops, + i915_rps_manual_get, i915_rps_manual_set, +"%llu\n" ); +static int i915_cache_sharing_get (void *data,u64 *val) {
@@ -3496,6 +3605,8 @@ static const struct i915_debugfs_files { {"i915_wedged", &i915_wedged_fops}, {"i915_max_freq", &i915_max_freq_fops}, {"i915_min_freq", &i915_min_freq_fops}, + {"i915_cur_freq", &i915_cur_freq_fops}, + {"i915_rps_manual", &i915_rps_manual_fops}, {"i915_cache_sharing", &i915_cache_sharing_fops}, {"i915_ring_stop", &i915_ring_stop_fops}, {"i915_ring_missed_irq", &i915_ring_missed_irq_fops},
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -968,6 +968,7 @@ struct intel_gen6_power_mgmt {int last_adj;enum {LOW_POWER ,BETWEEN ,HIGH_POWER } power; +bool manual_mode;bool enabled;struct delayed_work delayed_resume_work;
@@ -2536,6 +2537,7 @@ extern bool intel_fbc_enabled(struct drm_device *dev);extern void intel_disable_fbc (struct drm_device *dev);extern bool ironlake_set_drps (struct drm_device *dev,u8 val);extern void intel_init_pch_refclk (struct drm_device *dev); +extern void gen6_set_rps_mode (struct drm_device *dev,bool manual);extern void gen6_set_rps (struct drm_device *dev,u8 val);extern void valleyview_set_rps (struct drm_device *dev,u8 val);extern int valleyview_rps_max_freq (struct drm_i915_private *dev_priv);
drivers/gpu/drm/i915/i915_irq.c +6 -0
@@ -1045,6 +1045,12 @@ static void gen6_pm_rps_work(struct work_struct *work)mutex_lock (&dev_priv->rps.hw_lock); +/* May have just entered manual mode. */ +if (dev_priv->rps.manual_mode) { +mutex_unlock (&dev_priv->rps.hw_lock); +return ; + } + adj = dev_priv->rps.last_adj;if (pm_iir &GEN6_PM_RP_UP_THRESHOLD ) {if (adj >0 )
drivers/gpu/drm/i915/intel_pm.c +37 -5
71 lines not on this page · raw message
Signature · 1 line
1.8.5.2
Re: [PATCH 1/5] drm/i915: Add RPS debugfs manual mode
Quoted 10 lines · On Fri, Jan 31, 2014 at 03:42:48PM -0600, [email protected] wrote:
From: Jeff McGee <[email protected]>
RPS manual mode disables/ignores load-based inputs and allows render performance state to be controlled externally. The enabling of manual mode and setting of desired frequency is done through debugfs.
i915_rps_manual:
'0' - RPS controlled normally using load metrics. '1' - RPS controlled manually viai915_cur_freqwrites.
Quoted 7 lines
i915_cur_freq:
u64 - Value is the current gpu frequency request in MHz. Writes
accepted only ifi915_rps_manual= 1.Supports Gen6+ except Valleyview and Broadwell.
Signed-off-by Jeff McGee <[email protected]>
Hm, can't we fake this by setting min/max to the same values? -Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Re: [PATCH 1/5] drm/i915: Add RPS debugfs manual mode
Quoted 15 lines · Daniel Vetter
Quoted 14 lines · On Fri, Jan 31, 2014 at 03:42:48PM -0600, [email protected] wrote:
From: Jeff McGee <[email protected]>
RPS manual mode disables/ignores load-based inputs and allows render performance state to be controlled externally. The enabling of manual mode and setting of desired frequency is done through debugfs.
i915_rps_manual:
'0' - RPS controlled normally using load metrics. '1' - RPS controlled manually viai915_cur_freqwrites.
i915_cur_freq:
u64 - Value is the current gpu frequency request in MHz. Writes
accepted only ifi915_rps_manual= 1.
Quoted 5 lines
Quoted 3 lines
Supports Gen6+ except Valleyview and Broadwell.
Signed-off-by Jeff McGee <[email protected]>Hm, can't we fake this by setting min/max to the same values?
This is one where we can reconfigure the hardware if explicitly set to disabled. Or maybe we should just put the smarts in to detect min == max and disable the interrupt generation (as opposed to just masking at the various points along the path).
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Re: [PATCH 1/5] drm/i915: Add RPS debugfs manual mode
Quoted 20 lines · Chris Wilson
Quoted 19 lines · Daniel Vetter
Quoted 17 lines · On Fri, Jan 31, 2014 at 03:42:48PM -0600, [email protected] wrote:
From: Jeff McGee <[email protected]>
RPS manual mode disables/ignores load-based inputs and allows render performance state to be controlled externally. The enabling of manual mode and setting of desired frequency is done through debugfs.
i915_rps_manual:
'0' - RPS controlled normally using load metrics. '1' - RPS controlled manually viai915_cur_freqwrites.
i915_cur_freq:
u64 - Value is the current gpu frequency request in MHz. Writes
accepted only ifi915_rps_manual= 1.Supports Gen6+ except Valleyview and Broadwell.
Signed-off-by Jeff McGee <[email protected]>
Quoted 7 lines
Quoted 1 line
Hm, can't we fake this by setting min/max to the same values?
This is one where we can reconfigure the hardware if explicitly set to disabled. Or maybe we should just put the smarts in to detect min == max and disable the interrupt generation (as opposed to just masking at the various points along the path).
-Chris
Yes, it is possible to achieve this functionality by coercing the frequency with min and max. That seemed less clean to me and adds extra steps to test code. Also the hardware will still be processing RPS logic unless we add the min==max smarts as Chris mentions.
-Jeff
PATCH 2/5 drm/i915: Add RC6 debugfs disabling
In reply to [email protected]From: Jeff McGee <[email protected]>
i915_rc6_disable:
'0' - RC6 states used normally per device and settings. '1' - RC6 states explicitly disabled.
Supports Gen6+ except Valleyview and Broadwell.
--- drivers/gpu/drm/i915/i915_debugfs.c | 49 +++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_drv.h | 5 ++++ drivers/gpu/drm/i915/intel_pm.c | 31 ++++++++++++++++++++--- 3 files changed, 81 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +49 -0
@@ -3431,6 +3431,54 @@ DEFINE_SIMPLE_ATTRIBUTE(i915_rps_manual_fops, i915_rps_manual_get, i915_rps_manual_set, "%llu\n"); +static int i915_rc6_disable_get (void *data,u64 *val) +{ +struct drm_device *dev = data; +drm_i915_private_t *dev_priv = dev->dev_private; + +if ((INTEL_INFO (dev)->gen <6 ) || +IS_VALLEYVIEW (dev) || +IS_BROADWELL (dev)) +return -ENODEV ; + +flush_delayed_work (&dev_priv->rps.delayed_resume_work); + + *val = dev_priv->rps.rc6_disable; + +return 0 ; +} + +static int i915_rc6_disable_set (void *data,u64 val) +{ +struct drm_device *dev = data; +struct drm_i915_private *dev_priv = dev->dev_private; +int ret; + +if ((INTEL_INFO (dev)->gen <6 ) || +IS_VALLEYVIEW (dev) || +IS_BROADWELL (dev)) +return -ENODEV ; + +flush_delayed_work (&dev_priv->rps.delayed_resume_work); + +DRM_DEBUG_DRIVER ("Setting RC6 disable %s\n" , + val ?"true" :"false" ); + + ret =mutex_lock_interruptible (&dev_priv->rps.hw_lock); +if (ret) +return ret; + +gen6_set_rc6_mode (dev, val); + +mutex_unlock (&dev_priv->rps.hw_lock); + +return 0 ; +} + +DEFINE_SIMPLE_ATTRIBUTE (i915_rc6_disable_fops, + i915_rc6_disable_get, i915_rc6_disable_set, +"%llu\n" ); +static int i915_cache_sharing_get (void *data,u64 *val) {
@@ -3607,6 +3655,7 @@ static const struct i915_debugfs_files { {"i915_min_freq", &i915_min_freq_fops}, {"i915_cur_freq", &i915_cur_freq_fops}, {"i915_rps_manual", &i915_rps_manual_fops}, + {"i915_rc6_disable", &i915_rc6_disable_fops}, {"i915_cache_sharing", &i915_cache_sharing_fops}, {"i915_ring_stop", &i915_ring_stop_fops}, {"i915_ring_missed_irq", &i915_ring_missed_irq_fops},
drivers/gpu/drm/i915/i915_drv.h +5 -0
@@ -970,6 +970,10 @@ struct intel_gen6_power_mgmt {bool manual_mode;bool enabled; + +u32 rc6_mask; +bool rc6_disable; +struct delayed_work delayed_resume_work;/*
@@ -2537,6 +2541,7 @@ extern bool intel_fbc_enabled(struct drm_device *dev);extern void intel_disable_fbc (struct drm_device *dev);extern bool ironlake_set_drps (struct drm_device *dev,u8 val);extern void intel_init_pch_refclk (struct drm_device *dev); +extern void gen6_set_rc6_mode (struct drm_device *dev,bool disable);extern void gen6_set_rps_mode (struct drm_device *dev,bool manual);extern void gen6_set_rps (struct drm_device *dev,u8 val);extern void valleyview_set_rps (struct drm_device *dev,u8 val);
drivers/gpu/drm/i915/intel_pm.c +27 -4
@@ -3071,6 +3071,30 @@ void gen6_set_rps_mode(struct drm_device *dev, bool manual)gen6_set_rps (dev, delay); } +void gen6_set_rc6_mode (struct drm_device *dev,bool disable) +{ +struct drm_i915_private *dev_priv = dev->dev_private; + +if ((INTEL_INFO (dev)->gen <6 ) || +IS_VALLEYVIEW (dev) || +IS_BROADWELL (dev)) { +DRM_DEBUG_DRIVER ("RC6 disable not supported\n" ); +return ; + } + +WARN_ON (!mutex_is_locked (&dev_priv->rps.hw_lock)); + + dev_priv->rps.rc6_disable = disable; + +if (disable) +I915_WRITE (GEN6_RC_CONTROL ,0 ); +else +I915_WRITE (GEN6_RC_CONTROL , + dev_priv->rps.rc6_mask | +GEN6_RC_CTL_EI_MODE (1 ) | +GEN6_RC_CTL_HW_ENABLE ); +} +void gen6_rps_idle (struct drm_i915_private *dev_priv) {struct drm_device *dev = dev_priv->dev;
@@ -3376,10 +3400,9 @@ static void gen6_enable_rps(struct drm_device *dev)intel_print_rc6_info (dev, rc6_mask); -I915_WRITE (GEN6_RC_CONTROL , - rc6_mask | -GEN6_RC_CTL_EI_MODE (1 ) | -GEN6_RC_CTL_HW_ENABLE ); + dev_priv->rps.rc6_mask = rc6_mask; + +gen6_set_rc6_mode (dev, dev_priv->rps.rc6_disable);/* Power down if completely idle for over 50ms */ I915_WRITE (GEN6_RP_DOWN_TIMEOUT ,50000 );
Signature · 1 line
1.8.5.2
PATCH 3/5 drm/i915: Add IPS debugfs disabling
In reply to [email protected]From: Jeff McGee <[email protected]>
i915_ips_disable:
'0' - IPS enabled normally per device and settings. '1' - IPS explicitly disabled.
--- drivers/gpu/drm/i915/i915_debugfs.c | 47 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/intel_display.c | 4 +++ 3 files changed, 53 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +47 -0
@@ -1413,6 +1413,52 @@ static int i915_ips_status(struct seq_file *m, void *unused)return 0 ; } +static int i915_ips_disable_get (void *data,u64 *val) +{ +struct drm_device *dev = data; +drm_i915_private_t *dev_priv = dev->dev_private; + +if (!HAS_IPS (dev)) +return -ENODEV ; + + *val = dev_priv->ips_disable; + +return 0 ; +} + +static int i915_ips_disable_set (void *data,u64 val) +{ +struct drm_device *dev = data; +drm_i915_private_t *dev_priv = dev->dev_private; +struct drm_crtc *crtc; + +if (!HAS_IPS (dev)) +return -ENODEV ; + +if (dev_priv->ips_disable == (bool )val) +return 0 ; + +drm_modeset_lock_all (dev); + +DRM_DEBUG_DRIVER ("Setting IPS disable %s\n" , + val ?"true" :"false" ); + + dev_priv->ips_disable = (bool )val; + +/* Reset enabled crtc to force IPS state update */ +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) +if (crtc->enabled) +intel_crtc_restore_mode (crtc); + +drm_modeset_unlock_all (dev); + +return 0 ; +} + +DEFINE_SIMPLE_ATTRIBUTE (i915_ips_disable_fops, + i915_ips_disable_get, i915_ips_disable_set, +"%llu\n" ); +static int i915_sr_status (struct seq_file *m,void *unused) {struct drm_info_node *node = (struct drm_info_node *) m->private;
@@ -3656,6 +3702,7 @@ static const struct i915_debugfs_files { {"i915_cur_freq", &i915_cur_freq_fops}, {"i915_rps_manual", &i915_rps_manual_fops}, {"i915_rc6_disable", &i915_rc6_disable_fops}, + {"i915_ips_disable", &i915_ips_disable_fops}, {"i915_cache_sharing", &i915_cache_sharing_fops}, {"i915_ring_stop", &i915_ring_stop_fops}, {"i915_ring_missed_irq", &i915_ring_missed_irq_fops},
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -1532,6 +1532,8 @@ typedef struct drm_i915_private {* mchdev_lock in intel_pm.c */ struct intel_ilk_power_mgmt ips; +bool ips_disable; +struct i915_power_domains power_domains;struct i915_psr psr;
drivers/gpu/drm/i915/intel_display.c +4 -0
@@ -4580,7 +4580,11 @@ retry:static void hsw_compute_ips_config (struct intel_crtc *crtc,struct intel_crtc_config *pipe_config) { +struct drm_device *dev = crtc->base.dev; +struct drm_i915_private *dev_priv = dev->dev_private; + pipe_config->ips_enabled = i915.enable_ips && + !dev_priv->ips_disable &&hsw_crtc_supports_ips (crtc) && pipe_config->pipe_bpp <=24 ; }
Signature · 1 line
1.8.5.2
PATCH 4/5 drm/i915: Add FBC debugfs disabling
In reply to [email protected]From: Jeff McGee <[email protected]>
i915_fbc_disable:
'0' - FBC enabled normally per device and settings. '1' - FBC explicitly disabled.
--- drivers/gpu/drm/i915/i915_debugfs.c | 50 +++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_drv.h | 3 +++ drivers/gpu/drm/i915/intel_pm.c | 5 ++++ 3 files changed, 58 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +50 -0
@@ -1386,6 +1386,9 @@ static int i915_fbc_status(struct seq_file *m, void *unused)case FBC_CHIP_DEFAULT :seq_puts (m,"disabled per chip default" );break ; +case FBC_DEBUG_FS : +seq_puts (m,"disabled per debugfs" ); +break ;default :seq_puts (m,"unknown reason" ); }
@@ -1394,6 +1397,52 @@ static int i915_fbc_status(struct seq_file *m, void *unused)return 0 ; } +static int i915_fbc_disable_get (void *data,u64 *val) +{ +struct drm_device *dev = data; +drm_i915_private_t *dev_priv = dev->dev_private; + +if (!HAS_FBC (dev)) +return -ENODEV ; + + *val = dev_priv->fbc.disable; + +return 0 ; +} + +static int i915_fbc_disable_set (void *data,u64 val) +{ +struct drm_device *dev = data; +drm_i915_private_t *dev_priv = dev->dev_private; +struct drm_crtc *crtc; + +if (!HAS_FBC (dev)) +return -ENODEV ; + +if (dev_priv->fbc.disable == (bool )val) +return 0 ; + +drm_modeset_lock_all (dev); + +DRM_DEBUG_DRIVER ("Setting FBC disable %s\n" , + val ?"true" :"false" ); + + dev_priv->fbc.disable = (bool )val; + +/* Reset enabled crtc to force FBC state update */ +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) +if (crtc->enabled) +intel_crtc_restore_mode (crtc); + +drm_modeset_unlock_all (dev); + +return 0 ; +} + +DEFINE_SIMPLE_ATTRIBUTE (i915_fbc_disable_fops, + i915_fbc_disable_get, i915_fbc_disable_set, +"%llu\n" ); +static int i915_ips_status (struct seq_file *m,void *unused) {struct drm_info_node *node = (struct drm_info_node *) m->private;
@@ -3703,6 +3752,7 @@ static const struct i915_debugfs_files { {"i915_rps_manual", &i915_rps_manual_fops}, {"i915_rc6_disable", &i915_rc6_disable_fops}, {"i915_ips_disable", &i915_ips_disable_fops}, + {"i915_fbc_disable", &i915_fbc_disable_fops}, {"i915_cache_sharing", &i915_cache_sharing_fops}, {"i915_ring_stop", &i915_ring_stop_fops}, {"i915_ring_missed_irq", &i915_ring_missed_irq_fops},
drivers/gpu/drm/i915/i915_drv.h +3 -0
@@ -763,7 +763,10 @@ struct i915_fbc {FBC_MULTIPLE_PIPES ,/* more than one pipe active */ FBC_MODULE_PARAM ,FBC_CHIP_DEFAULT ,/* disabled by default on this chip */ +FBC_DEBUG_FS ,/* user requests disabling through debugfs */ } no_fbc_reason; + +bool disable; }; struct i915_psr {
drivers/gpu/drm/i915/intel_pm.c +5 -0
@@ -519,6 +519,11 @@ void intel_update_fbc(struct drm_device *dev)DRM_DEBUG_KMS ("fbc disabled per module param\n" ); goto out_disable; } +if (dev_priv->fbc.disable) { +if (set_no_fbc_reason (dev_priv,FBC_DEBUG_FS )) +DRM_DEBUG_KMS ("fbc disabled per debugfs\n" ); + goto out_disable; + }if ((adjusted_mode->flags &DRM_MODE_FLAG_INTERLACE ) || (adjusted_mode->flags &DRM_MODE_FLAG_DBLSCAN )) {if (set_no_fbc_reason (dev_priv,FBC_UNSUPPORTED_MODE ))
Signature · 1 line
1.8.5.2
PATCH 5/5 drm/i915: Add CxSR debugfs disabling
In reply to [email protected]From: Jeff McGee <[email protected]>
i915_sr_disable:
'0' - CxSR enabled normally per device and settings. '1' - CxSR explicitly disabled.
--- drivers/gpu/drm/i915/i915_debugfs.c | 43 +++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/intel_pm.c | 47 +++++++++++++++++++++---------------- 3 files changed, 72 insertions(+), 20 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +43 -0
@@ -1523,6 +1523,8 @@ static int i915_sr_status(struct seq_file *m, void *unused) sr_enabled =I915_READ (INSTPM ) &INSTPM_SELF_EN ; else if (IS_PINEVIEW(dev)) sr_enabled =I915_READ (DSPFW3 ) &PINEVIEW_SELF_REFRESH_EN ; + else if (IS_VALLEYVIEW(dev)) + sr_enabled =I915_READ (FW_BLC_SELF_VLV ) &FW_CSPWRDWNEN ;seq_printf (m,"self-refresh: %s\n" , sr_enabled ?"enabled" :"disabled" );
@@ -1530,6 +1532,46 @@ static int i915_sr_status(struct seq_file *m, void *unused)return 0 ; } +static int i915_sr_disable_get (void *data,u64 *val) +{ +struct drm_device *dev = data; +drm_i915_private_t *dev_priv = dev->dev_private; + + *val = dev_priv->sr_disable; + +return 0 ; +} + +static int i915_sr_disable_set (void *data,u64 val) +{ +struct drm_device *dev = data; +drm_i915_private_t *dev_priv = dev->dev_private; +struct drm_crtc *crtc; + +if (dev_priv->sr_disable == (bool )val) +return 0 ; + +drm_modeset_lock_all (dev); + +DRM_DEBUG_DRIVER ("Setting CxSR disable %s\n" , + val ?"true" :"false" ); + + dev_priv->sr_disable = (bool )val; + +/* Reset enabled crtc to force CxSR state update */ +list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) +if (crtc->enabled) +intel_crtc_restore_mode (crtc); + +drm_modeset_unlock_all (dev); + +return 0 ; +} + +DEFINE_SIMPLE_ATTRIBUTE (i915_sr_disable_fops, + i915_sr_disable_get, i915_sr_disable_set, +"%llu\n" ); +static int i915_emon_status (struct seq_file *m,void *unused) {struct drm_info_node *node = (struct drm_info_node *) m->private;
@@ -3753,6 +3795,7 @@ static const struct i915_debugfs_files { {"i915_rc6_disable", &i915_rc6_disable_fops}, {"i915_ips_disable", &i915_ips_disable_fops}, {"i915_fbc_disable", &i915_fbc_disable_fops}, + {"i915_sr_disable", &i915_sr_disable_fops}, {"i915_cache_sharing", &i915_cache_sharing_fops}, {"i915_ring_stop", &i915_ring_stop_fops}, {"i915_ring_missed_irq", &i915_ring_missed_irq_fops},
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -1537,6 +1537,8 @@ typedef struct drm_i915_private {bool ips_disable; +bool sr_disable; +struct i915_power_domains power_domains;struct i915_psr psr;
drivers/gpu/drm/i915/intel_pm.c +27 -20
95 lines not on this page · raw message
Signature · 1 line
1.8.5.2
Quoted 18 lines · On Fri, Jan 31, 2014 at 03:42:47PM -0600, [email protected] wrote:
From: Jeff McGee <[email protected]>
This series has recently been accepted into the Haswell Android kernel and helps with debugging and profiling these power features. I would like it to be considered for upstream incorporation. The patches here have been rebased (minimal changes required) and compile-tested only.
Broad device support is provided, accept for RPS and RC6 with Broadwell and Valleyview. Both of these were somewhat of a moving target and I didn't have devices to work with. Support can of course be added with help from appropriate folks.
The hooks introduce some amount of overhead as an additional check is often needed to determine whether the feature is on or off - similar to the module parameters that already exist. I felt that the overhead was minimal enough and didn't want to ugly up the code with
CONFIG_DEBUG_FScompile conditionals. But I'm open to the list's thoughts on this.
Quoted 3 lines
IGT tests of these new interfaces can certainly be added. I wanted to make sure there was sufficient interest in having these interfaces before starting on the tests. So please provide feedback.
I can see the value of adding this for power testing and the code looks quite neat and self-contained. (The one bikeshed I have is that I would like the parameter check and debug.disable check combined into a single function call, similar to intel_enable_rc6() so that all the similar logic is together, well commented and easy to verify, and hard for callers to get wrong.) Longer term, should we not consider this for our /sys/drm/card0/power API? i.e. do we see value beyond debugging and testing?
In the RPS autoadjust disabling code, it looks like you could go much further and shutdown the interrupts entirely saving wakeups and power. And put the restart logic into a single function (it requires too much inner knowledge of the RPS logic to spread around).
I think the rest looked ok - but I did have a moment of puzzlement that IPS did not turn off intel_ips ;-)
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Quoted 23 lines · Chris Wilson
Quoted 18 lines · On Fri, Jan 31, 2014 at 03:42:47PM -0600, [email protected] wrote:
From: Jeff McGee <[email protected]>
This series has recently been accepted into the Haswell Android kernel and helps with debugging and profiling these power features. I would like it to be considered for upstream incorporation. The patches here have been rebased (minimal changes required) and compile-tested only.
Broad device support is provided, accept for RPS and RC6 with Broadwell and Valleyview. Both of these were somewhat of a moving target and I didn't have devices to work with. Support can of course be added with help from appropriate folks.
The hooks introduce some amount of overhead as an additional check is often needed to determine whether the feature is on or off - similar to the module parameters that already exist. I felt that the overhead was minimal enough and didn't want to ugly up the code with
CONFIG_DEBUG_FScompile conditionals. But I'm open to the list's thoughts on this.Quoted 3 lines
IGT tests of these new interfaces can certainly be added. I wanted to make sure there was sufficient interest in having these interfaces before starting on the tests. So please provide feedback.
Quoted 8 lines
I can see the value of adding this for power testing and the code looks quite neat and self-contained. (The one bikeshed I have is that I would like the parameter check and debug.disable check combined into a single function call, similar to
intel_enable_rc6()so that all the similar logic is together, well commented and easy to verify, and hard for callers to get wrong.) Longer term, should we not consider this for our/sys/drm/card0/powerAPI? i.e. do we see value beyond debugging and testing?
For fbc/psr/ips I'd even use a connector/crtc property if we really need to frob this. Would be a good excuse for some better kms cmdline utilities ...
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Quoted 18 lines · On Fri, Jan 31, 2014 at 03:42:47PM -0600, [email protected] wrote:
From: Jeff McGee <[email protected]>
This series has recently been accepted into the Haswell Android kernel and helps with debugging and profiling these power features. I would like it to be considered for upstream incorporation. The patches here have been rebased (minimal changes required) and compile-tested only.
Broad device support is provided, accept for RPS and RC6 with Broadwell and Valleyview. Both of these were somewhat of a moving target and I didn't have devices to work with. Support can of course be added with help from appropriate folks.
The hooks introduce some amount of overhead as an additional check is often needed to determine whether the feature is on or off - similar to the module parameters that already exist. I felt that the overhead was minimal enough and didn't want to ugly up the code with
CONFIG_DEBUG_FScompile conditionals. But I'm open to the list's thoughts on this.
Quoted 3 lines
IGT tests of these new interfaces can certainly be added. I wanted to make sure there was sufficient interest in having these interfaces before starting on the tests. So please provide feedback.
debugfs doesn't have any abi guarantees and hence requirements are much lower. Generally I only want a testcase for new debugfs if it is complex infrastructure and other testcases rely on its functionality, like the CRC stuff. Simple on/off knobs imo don't need testcases really.
Still even debugfs code has a bit of cost, so I'll hold off until someone says that "yep, this is useful for developing stuff, I'll review it" or some i-g-ts show up.
Cheers, Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Quoted 23 lines · Daniel Vetter
Quoted 18 lines · On Fri, Jan 31, 2014 at 03:42:47PM -0600, [email protected] wrote:
From: Jeff McGee <[email protected]>
This series has recently been accepted into the Haswell Android kernel and helps with debugging and profiling these power features. I would like it to be considered for upstream incorporation. The patches here have been rebased (minimal changes required) and compile-tested only.
Broad device support is provided, accept for RPS and RC6 with Broadwell and Valleyview. Both of these were somewhat of a moving target and I didn't have devices to work with. Support can of course be added with help from appropriate folks.
The hooks introduce some amount of overhead as an additional check is often needed to determine whether the feature is on or off - similar to the module parameters that already exist. I felt that the overhead was minimal enough and didn't want to ugly up the code with
CONFIG_DEBUG_FScompile conditionals. But I'm open to the list's thoughts on this.Quoted 3 lines
IGT tests of these new interfaces can certainly be added. I wanted to make sure there was sufficient interest in having these interfaces before starting on the tests. So please provide feedback.
Quoted 8 lines
debugfs doesn't have any abi guarantees and hence requirements are much lower. Generally I only want a testcase for new debugfs if it is complex infrastructure and other testcases rely on its functionality, like the CRC stuff. Simple on/off knobs imo don't need testcases really.
Still even debugfs code has a bit of cost, so I'll hold off until someone says that "yep, this is useful for developing stuff, I'll review it" or some i-g-ts show up.
Our Android system validation tests are expecting these interfaces. That's not igt, I know, but is supporting downstream test suites a priority? I can get our val guys on the list to +1 the need for these patches. Likewise I can request a developer from my team to review these patches. Or are you looking specifically for someone outside our downstream product to 2nd the need-for and quality of the patches?
-Jeff
Quoted 6 lines · Jeff McGee
Our Android system validation tests are expecting these interfaces. That's not igt, I know, but is supporting downstream test suites a priority? I can get our val guys on the list to +1 the need for these patches. Likewise I can request a developer from my team to review these patches. Or are you looking specifically for someone outside our downstream product to 2nd the need-for and quality of the patches?
I don't mind if something is only used in one product - if it's useful sooner or later other product teams will pick up on in. So upstreaming is the right thing. But if you add a debugfs for tests I also want to have the tests upstreamed for the following reasons:
- If a product team deems it useful to test something, our upstream QA should probably do the same.
- Without testcases actually using these on upstream there's a good chance that we'll break them. Which means forward-rolling to new forklifts will be more of a pain than strictly needed. We already have our issues with upstream collaboration, no need to make it more ugly.
- For interfaces used in tests/scripts I also want to do a bit of api review, which is best done by looking at the actual users. Ofc debugfs doesn't have strict abi guarantees imposed by the linux community like ioctls/sysfs which we're essentially never allowed to break. But change the interfaces still has its costs.
Cheers, Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Quoted 21 lines · Daniel Vetter
Quoted 6 lines · Jeff McGee
Our Android system validation tests are expecting these interfaces. That's not igt, I know, but is supporting downstream test suites a priority? I can get our val guys on the list to +1 the need for these patches. Likewise I can request a developer from my team to review these patches. Or are you looking specifically for someone outside our downstream product to 2nd the need-for and quality of the patches?
I don't mind if something is only used in one product - if it's useful sooner or later other product teams will pick up on in. So upstreaming is the right thing. But if you add a debugfs for tests I also want to have the tests upstreamed for the following reasons:
- If a product team deems it useful to test something, our upstream QA should probably do the same.
- Without testcases actually using these on upstream there's a good chance that we'll break them. Which means forward-rolling to new forklifts will be more of a pain than strictly needed. We already have our issues with upstream collaboration, no need to make it more ugly.
Quoted 7 lines
- For interfaces used in tests/scripts I also want to do a bit of api review, which is best done by looking at the actual users. Ofc debugfs doesn't have strict abi guarantees imposed by the linux community like ioctls/sysfs which we're essentially never allowed to break. But change the interfaces still has its costs.
Cheers, Daniel
Thanks for the clarification. I think there is a willingness from our Android teams, both dev and val, to invest in igt as we've just started to do. I don't know the history well, but we obvious have a lot invested in our own test suites, and so bridging those with igt will take time and may occur on the back burner while the focus has to be on Android product. -Jeff