Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: keep backlight_level and backlight device brightness in sync
Date: Wed, 27 Mar 2013 21:06:37 +0100	[thread overview]
Message-ID: <20130327200637.GG2228@phenom.ffwll.local> (raw)
In-Reply-To: <87y5dbpri0.fsf@intel.com>

On Mon, Mar 25, 2013 at 02:56:39PM +0200, Jani Nikula wrote:
> 
> Any comments on these two patches?

Both queued for -next, thanks for the patches. That means though that
you're volunteered for more cleanup ;-)
-Daniel

> 
> BR,
> Jani.
> 
> 
> On Tue, 12 Mar 2013, Jani Nikula <jani.nikula@intel.com> wrote:
> > A single point of truth would be better than two, but achieving that would
> > require more abstractions for CONFIG_BACKLIGHT_CLASS_DEVICE=n with not a
> > whole lot of real benefits. Take the short route and just keep the
> > backlight levels in sync. In particular, update backlight device brightness
> > on opregion brightness changes.
> >
> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_panel.c |   11 +++++++++--
> >  1 file changed, 9 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> > index a3730e0..725d726 100644
> > --- a/drivers/gpu/drm/i915/intel_panel.c
> > +++ b/drivers/gpu/drm/i915/intel_panel.c
> > @@ -287,6 +287,9 @@ void intel_panel_set_backlight(struct drm_device *dev, u32 level)
> >  	struct drm_i915_private *dev_priv = dev->dev_private;
> >  
> >  	dev_priv->backlight_level = level;
> > +	if (dev_priv->backlight)
> > +		dev_priv->backlight->props.brightness = level;
> > +
> >  	if (dev_priv->backlight_enabled)
> >  		intel_panel_actually_set_backlight(dev, level);
> >  }
> > @@ -318,8 +321,12 @@ void intel_panel_enable_backlight(struct drm_device *dev,
> >  {
> >  	struct drm_i915_private *dev_priv = dev->dev_private;
> >  
> > -	if (dev_priv->backlight_level == 0)
> > +	if (dev_priv->backlight_level == 0) {
> >  		dev_priv->backlight_level = intel_panel_get_max_backlight(dev);
> > +		if (dev_priv->backlight)
> > +			dev_priv->backlight->props.brightness =
> > +				dev_priv->backlight_level;
> > +	}
> >  
> >  	dev_priv->backlight_enabled = true;
> >  	intel_panel_actually_set_backlight(dev, dev_priv->backlight_level);
> > @@ -427,6 +434,7 @@ int intel_panel_setup_backlight(struct drm_connector *connector)
> >  
> >  	memset(&props, 0, sizeof(props));
> >  	props.type = BACKLIGHT_RAW;
> > +	props.brightness = dev_priv->backlight_level;
> >  	props.max_brightness = _intel_panel_get_max_backlight(dev);
> >  	if (props.max_brightness == 0) {
> >  		DRM_DEBUG_DRIVER("Failed to get maximum backlight value\n");
> > @@ -443,7 +451,6 @@ int intel_panel_setup_backlight(struct drm_connector *connector)
> >  		dev_priv->backlight = NULL;
> >  		return -ENODEV;
> >  	}
> > -	dev_priv->backlight->props.brightness = intel_panel_get_backlight(dev);
> >  	return 0;
> >  }
> >  
> > -- 
> > 1.7.9.5
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

      reply	other threads:[~2013-03-27 20:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12  9:44 [PATCH 1/2] drm/i915: keep backlight_level and backlight device brightness in sync Jani Nikula
2013-03-12  9:44 ` [PATCH 2/2] drm/i915: return actual brightness to .get_brightness callback Jani Nikula
2013-03-25 12:56 ` [PATCH 1/2] drm/i915: keep backlight_level and backlight device brightness in sync Jani Nikula
2013-03-27 20:06   ` Daniel Vetter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130327200637.GG2228@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox