i915.enable_backlight=0 can be used to disable i915 backlight control and the /sys/class/backlight/intel_backlight interface -- useful for systems where intel_backight conflicts with BIOS backlight control. BugLink: https://launchpad.net/bugs/954661 Signed-off-by: Kamal Mostafa <kamal at canonical.com> --- drivers/gpu/drm/i915/i915_drv.c | 6 ++++++ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_panel.c | 12 ++++++++++++ 3 files changed, 19 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index ae8a64f..ddb947b 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -112,6 +112,12 @@ module_param_named(i915_enable_ppgtt, i915_enable_ppgtt, int, 0600); MODULE_PARM_DESC(i915_enable_ppgtt, "Enable PPGTT (default: true)"); +int i915_enable_backlight __read_mostly = -1; +module_param_named(enable_backlight, i915_enable_backlight, int, 0644); +MODULE_PARM_DESC(enable_backlight, + "Enable backlight control and the intel_backlight interface. " + "(default: -1 (auto))"); + static struct drm_driver driver; extern int intel_agp_enabled; diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 5fabc6c..6e52a42 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1087,6 +1087,7 @@ extern int i915_enable_rc6 __read_mostly; extern int i915_enable_fbc __read_mostly; extern bool i915_enable_hangcheck __read_mostly; extern int i915_enable_ppgtt __read_mostly; +extern int i915_enable_backlight __read_mostly; extern int i915_suspend(struct drm_device *dev, pm_message_t state); extern int i915_resume(struct drm_device *dev); diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 48177ec..fcecbd2 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -259,6 +259,9 @@ void intel_panel_disable_backlight(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; + if (!i915_enable_backlight) + return; + dev_priv->backlight_enabled = false; intel_panel_actually_set_backlight(dev, 0); } @@ -267,6 +270,9 @@ void intel_panel_enable_backlight(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; + if (!i915_enable_backlight) + return; + if (dev_priv->backlight_level == 0) dev_priv->backlight_level = intel_panel_get_max_backlight(dev); @@ -333,6 +339,9 @@ int intel_panel_setup_backlight(struct drm_device *dev) struct backlight_properties props; struct drm_connector *connector; + if (!i915_enable_backlight) + return 0; + intel_panel_init_backlight(dev); if (dev_priv->int_lvds_connector) @@ -368,6 +377,9 @@ void intel_panel_destroy_backlight(struct drm_device *dev) #else int intel_panel_setup_backlight(struct drm_device *dev) { + if (!i915_enable_backlight) + return; + intel_panel_init_backlight(dev); return 0; } -- 1.7.5.4