aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2013-08-19 12:18:11 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-23 08:52:35 -0400
commit900587453219f6090a1e28db1bb790aa64820131 (patch)
tree8cb69c8d2fa1c06377894cf8cf1fb3119bf6ed18 /drivers/gpu/drm/i915
parent371db66add2ef701abd3f4295c4cd6bbc24cd5ca (diff)
drm/i915: add i915.pc8_timeout function
We currently only enter PC8+ after all its required conditions are met, there's no rendering, and we stay like that for at least 5 seconds. I chose "5 seconds" because this value is conservative and won't make us enter/leave PC8+ thousands of times after the screen is off: some desktop environments have applications that wake up and do rendering every 1-3 seconds, even when the screen is off and the machine is completely idle. But when I was testing my PC8+ patches I set the default value to 100ms so I could use the bad-behaving desktop environments to stress-test my patches. I also thought it would be a good idea to ask our power management team to test different values, but I'm pretty sure they would ask me for an easy way to change the timeout. So to help these 2 cases I decided to create an option that would make it easier to change the default value. I also expect people making specific products that use our driver could try to find the perfect timeout for them. Anyway, fixing the bad-behaving applications will always lead to better power savings than just changing the timeout value: you need to stop waking the Kernel, not quickly put it back to sleep again after you wake it for nothing. Bad sleep leads to bad mood! Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c4
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h1
-rw-r--r--drivers/gpu/drm/i915/intel_display.c2
3 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 84d48b82e3f1..6dc00a190669 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -145,6 +145,10 @@ int i915_enable_pc8 __read_mostly = 0;
145module_param_named(enable_pc8, i915_enable_pc8, int, 0600); 145module_param_named(enable_pc8, i915_enable_pc8, int, 0600);
146MODULE_PARM_DESC(enable_pc8, "Enable support for low power package C states (PC8+) (default: false)"); 146MODULE_PARM_DESC(enable_pc8, "Enable support for low power package C states (PC8+) (default: false)");
147 147
148int i915_pc8_timeout __read_mostly = 5000;
149module_param_named(pc8_timeout, i915_pc8_timeout, int, 0600);
150MODULE_PARM_DESC(pc8_timeout, "Number of msecs of idleness required to enter PC8+ (default: 5000)");
151
148bool i915_prefault_disable __read_mostly; 152bool i915_prefault_disable __read_mostly;
149module_param_named(prefault_disable, i915_prefault_disable, bool, 0600); 153module_param_named(prefault_disable, i915_prefault_disable, bool, 0600);
150MODULE_PARM_DESC(prefault_disable, 154MODULE_PARM_DESC(prefault_disable,
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 627c8216db1f..5f8a638c5145 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1707,6 +1707,7 @@ extern int i915_disable_power_well __read_mostly;
1707extern int i915_enable_ips __read_mostly; 1707extern int i915_enable_ips __read_mostly;
1708extern bool i915_fastboot __read_mostly; 1708extern bool i915_fastboot __read_mostly;
1709extern int i915_enable_pc8 __read_mostly; 1709extern int i915_enable_pc8 __read_mostly;
1710extern int i915_pc8_timeout __read_mostly;
1710extern bool i915_prefault_disable __read_mostly; 1711extern bool i915_prefault_disable __read_mostly;
1711 1712
1712extern int i915_suspend(struct drm_device *dev, pm_message_t state); 1713extern int i915_suspend(struct drm_device *dev, pm_message_t state);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1fad9de3d810..b29954ac6bfd 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6101,7 +6101,7 @@ static void __hsw_enable_package_c8(struct drm_i915_private *dev_priv)
6101 return; 6101 return;
6102 6102
6103 schedule_delayed_work(&dev_priv->pc8.enable_work, 6103 schedule_delayed_work(&dev_priv->pc8.enable_work,
6104 msecs_to_jiffies(5 * 1000)); 6104 msecs_to_jiffies(i915_pc8_timeout));
6105} 6105}
6106 6106
6107static void __hsw_disable_package_c8(struct drm_i915_private *dev_priv) 6107static void __hsw_disable_package_c8(struct drm_i915_private *dev_priv)