[Intel-gfx] [PATCH 1/2] drm/i915: i915.enable_backlight=0 disables intel_backlight

Kamal Mostafa kamal at canonical.com
Fri Apr 27 22:55:37 CEST 2012


On Thu, 2012-04-26 at 22:07 +0200, Daniel Vetter wrote:
> On Wed, Apr 25, 2012 at 10:28:41AM -0700, Kamal Mostafa wrote:
> > 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>
> 
> Ok, I've just gone through the fun of merging a set of backlight quirks a
> few weeks back. Then noticed that an awful lot of machines seem to be
> affected and later on read about a few interesting bits in the
> documentation. Turns out the hw is all good, it's just the driver totally
> mishandling the backlight.
> 
> To cut things short: This time around I want more justification for the
> quirk than just "this makes this one machine work somehow".


The enable_backlight modparam (this PATCH 1/2) would be generally useful
to have, whether or not we quirk-disable it for that particular machine.
Consider accepting this first patch 1/2 on its own?

 -Kamal


> > ---
> >  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
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 





More information about the Intel-gfx mailing list