diff mbox

[4/4] drm/i915: hsw backlight registers need transcoder instead of pipe

Message ID 3469fd948f856b5b1223731e3b57d69e50fb00d5.1365768957.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jani Nikula April 12, 2013, 12:18 p.m. UTC
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_panel.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Imre Deak April 25, 2013, 1:14 p.m. UTC | #1
On Fri, 2013-04-12 at 15:18 +0300, Jani Nikula wrote:
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_panel.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> index 5d3e9d7..0362f5c 100644
> --- a/drivers/gpu/drm/i915/intel_panel.c
> +++ b/drivers/gpu/drm/i915/intel_panel.c
> @@ -344,6 +344,8 @@ void intel_panel_enable_backlight(struct drm_device *dev,
>  				  enum pipe pipe)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
> +	enum transcoder cpu_transcoder =
> +		intel_pipe_to_cpu_transcoder(dev_priv, pipe);
>  	unsigned long flags;
>  
>  	spin_lock_irqsave(&dev_priv->backlight.lock, flags);
> @@ -374,7 +376,7 @@ void intel_panel_enable_backlight(struct drm_device *dev,
>  		else
>  			tmp &= ~BLM_PIPE_SELECT;
>  
> -		tmp |= BLM_PIPE(pipe);
> +		tmp |= BLM_PIPE(cpu_transcoder);

Imo BLM_PIPE would be clearer checking for TRANSCODER_EDP explicitly,
but the code works anyway, so:
Reviewed-by: Imre Deak <imre.deak@intel.com>

>  		tmp &= ~BLM_PWM_ENABLE;
>  
>  		I915_WRITE(reg, tmp);
Daniel Vetter April 25, 2013, 1:34 p.m. UTC | #2
On Thu, Apr 25, 2013 at 04:14:23PM +0300, Imre Deak wrote:
> On Fri, 2013-04-12 at 15:18 +0300, Jani Nikula wrote:
> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_panel.c |    4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> > index 5d3e9d7..0362f5c 100644
> > --- a/drivers/gpu/drm/i915/intel_panel.c
> > +++ b/drivers/gpu/drm/i915/intel_panel.c
> > @@ -344,6 +344,8 @@ void intel_panel_enable_backlight(struct drm_device *dev,
> >  				  enum pipe pipe)
> >  {
> >  	struct drm_i915_private *dev_priv = dev->dev_private;
> > +	enum transcoder cpu_transcoder =
> > +		intel_pipe_to_cpu_transcoder(dev_priv, pipe);
> >  	unsigned long flags;
> >  
> >  	spin_lock_irqsave(&dev_priv->backlight.lock, flags);
> > @@ -374,7 +376,7 @@ void intel_panel_enable_backlight(struct drm_device *dev,
> >  		else
> >  			tmp &= ~BLM_PIPE_SELECT;
> >  
> > -		tmp |= BLM_PIPE(pipe);
> > +		tmp |= BLM_PIPE(cpu_transcoder);
> 
> Imo BLM_PIPE would be clearer checking for TRANSCODER_EDP explicitly,
> but the code works anyway, so:
> Reviewed-by: Imre Deak <imre.deak@intel.com>

Atm all the difference between pipe and cpu_transcoder is about transcoder
edp. So this feels explicit enough for me.

Queued for -next, thanks for the patch.
-Daniel
Daniel Vetter April 25, 2013, 1:45 p.m. UTC | #3
On Thu, Apr 25, 2013 at 03:34:26PM +0200, Daniel Vetter wrote:
> On Thu, Apr 25, 2013 at 04:14:23PM +0300, Imre Deak wrote:
> > On Fri, 2013-04-12 at 15:18 +0300, Jani Nikula wrote:
> > > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/intel_panel.c |    4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> > > index 5d3e9d7..0362f5c 100644
> > > --- a/drivers/gpu/drm/i915/intel_panel.c
> > > +++ b/drivers/gpu/drm/i915/intel_panel.c
> > > @@ -344,6 +344,8 @@ void intel_panel_enable_backlight(struct drm_device *dev,
> > >  				  enum pipe pipe)
> > >  {
> > >  	struct drm_i915_private *dev_priv = dev->dev_private;
> > > +	enum transcoder cpu_transcoder =
> > > +		intel_pipe_to_cpu_transcoder(dev_priv, pipe);
> > >  	unsigned long flags;
> > >  
> > >  	spin_lock_irqsave(&dev_priv->backlight.lock, flags);
> > > @@ -374,7 +376,7 @@ void intel_panel_enable_backlight(struct drm_device *dev,
> > >  		else
> > >  			tmp &= ~BLM_PIPE_SELECT;
> > >  
> > > -		tmp |= BLM_PIPE(pipe);
> > > +		tmp |= BLM_PIPE(cpu_transcoder);
> > 
> > Imo BLM_PIPE would be clearer checking for TRANSCODER_EDP explicitly,
> > but the code works anyway, so:
> > Reviewed-by: Imre Deak <imre.deak@intel.com>
> 
> Atm all the difference between pipe and cpu_transcoder is about transcoder
> edp. So this feels explicit enough for me.

Imre pointed out that his concern is about the truncation, since for eDP
this evaluates to (0xf << 29). Which truncates to the right value, but I
agree it's a bit too much working-by-accident. Dropped the patch again.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 5d3e9d7..0362f5c 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -344,6 +344,8 @@  void intel_panel_enable_backlight(struct drm_device *dev,
 				  enum pipe pipe)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	enum transcoder cpu_transcoder =
+		intel_pipe_to_cpu_transcoder(dev_priv, pipe);
 	unsigned long flags;
 
 	spin_lock_irqsave(&dev_priv->backlight.lock, flags);
@@ -374,7 +376,7 @@  void intel_panel_enable_backlight(struct drm_device *dev,
 		else
 			tmp &= ~BLM_PIPE_SELECT;
 
-		tmp |= BLM_PIPE(pipe);
+		tmp |= BLM_PIPE(cpu_transcoder);
 		tmp &= ~BLM_PWM_ENABLE;
 
 		I915_WRITE(reg, tmp);