[Intel-gfx] [PATCH 3/5] drm/i915: Add IPS debugfs disabling
jeff.mcgee at intel.com
jeff.mcgee at intel.com
Fri Jan 31 22:42:50 CET 2014
From: Jeff McGee <jeff.mcgee at intel.com>
i915_ips_disable:
'0' - IPS enabled normally per device and settings.
'1' - IPS explicitly disabled.
Signed-off-by: Jeff McGee <jeff.mcgee at intel.com>
---
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(+)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index a51c357..949c6a4 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -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},
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 9893451..93e1547 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -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;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 4d4a0d9..5af41ce 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -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;
}
--
1.8.5.2
More information about the Intel-gfx
mailing list