aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_pm.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2014-01-21 04:24:25 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-01-27 11:16:45 -0500
commitd330a9530c97b8ee4704fdd7f228712029438ea9 (patch)
tree7e2c111e25a63e8d166d92cc31e8b57852e287ae /drivers/gpu/drm/i915/intel_pm.c
parent2b7e8082b258eebcff49acff040a9110ed6f2c09 (diff)
drm/i915: move module parameters into a struct, in a new file
With 20+ module parameters, I think referring to them via a struct improves clarity over just having a bunch of globals. While at it, move the parameter initialization and definitions into a new file i915_params.c to reduce clutter in i915_drv.c. Apart from the ill-named i915_enable_rc6, i915_enable_fbc and i915_enable_ppgtt parameters, for which we lose the "i915_" prefix internally, the module parameters now look the same both on the kernel command line and in code. For example, "i915.modeset". The downsides of the change are losing static on a couple of variables and not having the initialization and module_param_named() right next to each other. On the other hand, all module parameters are now defined in one place at i915_params.c. Plus you can do this to find all module parameter references: $ git grep "i915\." -- drivers/gpu/drm/i915 v2: - move the definitions into a new file - s/i915_params/i915/ - make i915_try_reset i915.reset, for consistency Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index d91d9acfc3ff..f38470f795d7 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -469,7 +469,7 @@ void intel_update_fbc(struct drm_device *dev)
469 return; 469 return;
470 } 470 }
471 471
472 if (!i915_powersave) { 472 if (!i915.powersave) {
473 if (set_no_fbc_reason(dev_priv, FBC_MODULE_PARAM)) 473 if (set_no_fbc_reason(dev_priv, FBC_MODULE_PARAM))
474 DRM_DEBUG_KMS("fbc disabled per module param\n"); 474 DRM_DEBUG_KMS("fbc disabled per module param\n");
475 return; 475 return;
@@ -508,13 +508,13 @@ void intel_update_fbc(struct drm_device *dev)
508 obj = intel_fb->obj; 508 obj = intel_fb->obj;
509 adjusted_mode = &intel_crtc->config.adjusted_mode; 509 adjusted_mode = &intel_crtc->config.adjusted_mode;
510 510
511 if (i915_enable_fbc < 0 && 511 if (i915.enable_fbc < 0 &&
512 INTEL_INFO(dev)->gen <= 7 && !IS_HASWELL(dev)) { 512 INTEL_INFO(dev)->gen <= 7 && !IS_HASWELL(dev)) {
513 if (set_no_fbc_reason(dev_priv, FBC_CHIP_DEFAULT)) 513 if (set_no_fbc_reason(dev_priv, FBC_CHIP_DEFAULT))
514 DRM_DEBUG_KMS("disabled per chip default\n"); 514 DRM_DEBUG_KMS("disabled per chip default\n");
515 goto out_disable; 515 goto out_disable;
516 } 516 }
517 if (!i915_enable_fbc) { 517 if (!i915.enable_fbc) {
518 if (set_no_fbc_reason(dev_priv, FBC_MODULE_PARAM)) 518 if (set_no_fbc_reason(dev_priv, FBC_MODULE_PARAM))
519 DRM_DEBUG_KMS("fbc disabled per module param\n"); 519 DRM_DEBUG_KMS("fbc disabled per module param\n");
520 goto out_disable; 520 goto out_disable;
@@ -3154,8 +3154,8 @@ int intel_enable_rc6(const struct drm_device *dev)
3154 return 0; 3154 return 0;
3155 3155
3156 /* Respect the kernel parameter if it is set */ 3156 /* Respect the kernel parameter if it is set */
3157 if (i915_enable_rc6 >= 0) 3157 if (i915.enable_rc6 >= 0)
3158 return i915_enable_rc6; 3158 return i915.enable_rc6;
3159 3159
3160 /* Disable RC6 on Ironlake */ 3160 /* Disable RC6 on Ironlake */
3161 if (INTEL_INFO(dev)->gen == 5) 3161 if (INTEL_INFO(dev)->gen == 5)
@@ -5279,7 +5279,7 @@ static void __intel_power_well_put(struct drm_device *dev,
5279 WARN_ON(!power_well->count); 5279 WARN_ON(!power_well->count);
5280 5280
5281 if (!--power_well->count && power_well->set && 5281 if (!--power_well->count && power_well->set &&
5282 i915_disable_power_well) { 5282 i915.disable_power_well) {
5283 power_well->set(dev, power_well, false); 5283 power_well->set(dev, power_well, false);
5284 hsw_enable_package_c8(dev_priv); 5284 hsw_enable_package_c8(dev_priv);
5285 } 5285 }