public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: use backlight legacy combination mode also for i945gm
@ 2014-02-25  9:14 Jani Nikula
  2014-02-25 10:47 ` Ville Syrjälä
  0 siblings, 1 reply; 5+ messages in thread
From: Jani Nikula @ 2014-02-25  9:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, luiorpe1

i945gm also seems to use and need the legacy combination mode bit in
BLC_PWM_CTL.

Reported-and-tested-by: Luis Ortega <luiorpe1@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75001
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

---

My scarce gen3 specs do not say anything about bit 16 of
BLC_PWM_CTL. Bits 31:17 are similar to gen2, which does have bit 16
specified as legacy mode.

Per the bug, we clearly should interpret bit 16 as legacy mode also for
I945GM, but how about other gen3 hardware? Thoughts?

I'm inclined to go with this, and fix others if they are reported.
---
 drivers/gpu/drm/i915/intel_panel.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 5bc3f6ea1014..b3df5b90f79f 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -689,7 +689,7 @@ static void i9xx_enable_backlight(struct intel_connector *connector)
 		freq /= 0xff;
 
 	ctl = freq << 17;
-	if (IS_GEN2(dev) && panel->backlight.combination_mode)
+	if (panel->backlight.combination_mode)
 		ctl |= BLM_LEGACY_MODE;
 	if (IS_PINEVIEW(dev) && panel->backlight.active_low_pwm)
 		ctl |= BLM_POLARITY_PNV;
@@ -970,7 +970,7 @@ static int i9xx_setup_backlight(struct intel_connector *connector)
 
 	ctl = I915_READ(BLC_PWM_CTL);
 
-	if (IS_GEN2(dev))
+	if (IS_GEN2(dev) || IS_I945GM(dev))
 		panel->backlight.combination_mode = ctl & BLM_LEGACY_MODE;
 
 	if (IS_PINEVIEW(dev))
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/i915: use backlight legacy combination mode also for i945gm
  2014-02-25  9:14 [PATCH] drm/i915: use backlight legacy combination mode also for i945gm Jani Nikula
@ 2014-02-25 10:47 ` Ville Syrjälä
  2014-02-25 11:11   ` [PATCH] drm/i915: use backlight legacy combination mode also for i915gm/i945gm Jani Nikula
  0 siblings, 1 reply; 5+ messages in thread
From: Ville Syrjälä @ 2014-02-25 10:47 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, luiorpe1

On Tue, Feb 25, 2014 at 11:14:56AM +0200, Jani Nikula wrote:
> i945gm also seems to use and need the legacy combination mode bit in
> BLC_PWM_CTL.
> 
> Reported-and-tested-by: Luis Ortega <luiorpe1@gmail.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75001
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> 
> ---
> 
> My scarce gen3 specs do not say anything about bit 16 of
> BLC_PWM_CTL. Bits 31:17 are similar to gen2, which does have bit 16
> specified as legacy mode.

The spec is funny. It looks like the bit just fell off by accident.

> 
> Per the bug, we clearly should interpret bit 16 as legacy mode also for
> I945GM, but how about other gen3 hardware? Thoughts?

In that case I would expect 915 to be the same as chronologically it
sits between gen2 and 945. PNV might be different.

So based on that reasoning the check could be reduced to just
!IS_PINEVIEW.

> 
> I'm inclined to go with this, and fix others if they are reported.
> ---
>  drivers/gpu/drm/i915/intel_panel.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> index 5bc3f6ea1014..b3df5b90f79f 100644
> --- a/drivers/gpu/drm/i915/intel_panel.c
> +++ b/drivers/gpu/drm/i915/intel_panel.c
> @@ -689,7 +689,7 @@ static void i9xx_enable_backlight(struct intel_connector *connector)
>  		freq /= 0xff;
>  
>  	ctl = freq << 17;
> -	if (IS_GEN2(dev) && panel->backlight.combination_mode)
> +	if (panel->backlight.combination_mode)
>  		ctl |= BLM_LEGACY_MODE;
>  	if (IS_PINEVIEW(dev) && panel->backlight.active_low_pwm)
>  		ctl |= BLM_POLARITY_PNV;
> @@ -970,7 +970,7 @@ static int i9xx_setup_backlight(struct intel_connector *connector)
>  
>  	ctl = I915_READ(BLC_PWM_CTL);
>  
> -	if (IS_GEN2(dev))
> +	if (IS_GEN2(dev) || IS_I945GM(dev))
>  		panel->backlight.combination_mode = ctl & BLM_LEGACY_MODE;
>  
>  	if (IS_PINEVIEW(dev))
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] drm/i915: use backlight legacy combination mode also for i915gm/i945gm
  2014-02-25 10:47 ` Ville Syrjälä
@ 2014-02-25 11:11   ` Jani Nikula
  2014-02-26 13:20     ` Ville Syrjälä
  0 siblings, 1 reply; 5+ messages in thread
From: Jani Nikula @ 2014-02-25 11:11 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, luiorpe1

i915gm and i945gm also seem to use and need the legacy combination mode
bit in BLC_PWM_CTL.

v2: Also do this for i915gm (Ville).

Reported-and-tested-by: Luis Ortega <luiorpe1@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75001
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_panel.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 5bc3f6ea1014..cb058408c70e 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -689,7 +689,7 @@ static void i9xx_enable_backlight(struct intel_connector *connector)
 		freq /= 0xff;
 
 	ctl = freq << 17;
-	if (IS_GEN2(dev) && panel->backlight.combination_mode)
+	if (panel->backlight.combination_mode)
 		ctl |= BLM_LEGACY_MODE;
 	if (IS_PINEVIEW(dev) && panel->backlight.active_low_pwm)
 		ctl |= BLM_POLARITY_PNV;
@@ -970,7 +970,7 @@ static int i9xx_setup_backlight(struct intel_connector *connector)
 
 	ctl = I915_READ(BLC_PWM_CTL);
 
-	if (IS_GEN2(dev))
+	if (IS_GEN2(dev) || IS_I915GM(dev) || IS_I945GM(dev))
 		panel->backlight.combination_mode = ctl & BLM_LEGACY_MODE;
 
 	if (IS_PINEVIEW(dev))
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/i915: use backlight legacy combination mode also for i915gm/i945gm
  2014-02-25 11:11   ` [PATCH] drm/i915: use backlight legacy combination mode also for i915gm/i945gm Jani Nikula
@ 2014-02-26 13:20     ` Ville Syrjälä
  2014-02-27  8:59       ` Jani Nikula
  0 siblings, 1 reply; 5+ messages in thread
From: Ville Syrjälä @ 2014-02-26 13:20 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, luiorpe1

On Tue, Feb 25, 2014 at 01:11:47PM +0200, Jani Nikula wrote:
> i915gm and i945gm also seem to use and need the legacy combination mode
> bit in BLC_PWM_CTL.
> 
> v2: Also do this for i915gm (Ville).
> 
> Reported-and-tested-by: Luis Ortega <luiorpe1@gmail.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75001
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Looks sane enough for me.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_panel.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> index 5bc3f6ea1014..cb058408c70e 100644
> --- a/drivers/gpu/drm/i915/intel_panel.c
> +++ b/drivers/gpu/drm/i915/intel_panel.c
> @@ -689,7 +689,7 @@ static void i9xx_enable_backlight(struct intel_connector *connector)
>  		freq /= 0xff;
>  
>  	ctl = freq << 17;
> -	if (IS_GEN2(dev) && panel->backlight.combination_mode)
> +	if (panel->backlight.combination_mode)
>  		ctl |= BLM_LEGACY_MODE;
>  	if (IS_PINEVIEW(dev) && panel->backlight.active_low_pwm)
>  		ctl |= BLM_POLARITY_PNV;
> @@ -970,7 +970,7 @@ static int i9xx_setup_backlight(struct intel_connector *connector)
>  
>  	ctl = I915_READ(BLC_PWM_CTL);
>  
> -	if (IS_GEN2(dev))
> +	if (IS_GEN2(dev) || IS_I915GM(dev) || IS_I945GM(dev))
>  		panel->backlight.combination_mode = ctl & BLM_LEGACY_MODE;
>  
>  	if (IS_PINEVIEW(dev))
> -- 
> 1.7.9.5

-- 
Ville Syrjälä
Intel OTC

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/i915: use backlight legacy combination mode also for i915gm/i945gm
  2014-02-26 13:20     ` Ville Syrjälä
@ 2014-02-27  8:59       ` Jani Nikula
  0 siblings, 0 replies; 5+ messages in thread
From: Jani Nikula @ 2014-02-27  8:59 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx, luiorpe1

On Wed, 26 Feb 2014, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Tue, Feb 25, 2014 at 01:11:47PM +0200, Jani Nikula wrote:
>> i915gm and i945gm also seem to use and need the legacy combination mode
>> bit in BLC_PWM_CTL.
>> 
>> v2: Also do this for i915gm (Ville).
>> 
>> Reported-and-tested-by: Luis Ortega <luiorpe1@gmail.com>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75001
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Looks sane enough for me.
>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Pushed to -fixes, thanks for the review.

Jani.


>
>> ---
>>  drivers/gpu/drm/i915/intel_panel.c |    4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
>> index 5bc3f6ea1014..cb058408c70e 100644
>> --- a/drivers/gpu/drm/i915/intel_panel.c
>> +++ b/drivers/gpu/drm/i915/intel_panel.c
>> @@ -689,7 +689,7 @@ static void i9xx_enable_backlight(struct intel_connector *connector)
>>  		freq /= 0xff;
>>  
>>  	ctl = freq << 17;
>> -	if (IS_GEN2(dev) && panel->backlight.combination_mode)
>> +	if (panel->backlight.combination_mode)
>>  		ctl |= BLM_LEGACY_MODE;
>>  	if (IS_PINEVIEW(dev) && panel->backlight.active_low_pwm)
>>  		ctl |= BLM_POLARITY_PNV;
>> @@ -970,7 +970,7 @@ static int i9xx_setup_backlight(struct intel_connector *connector)
>>  
>>  	ctl = I915_READ(BLC_PWM_CTL);
>>  
>> -	if (IS_GEN2(dev))
>> +	if (IS_GEN2(dev) || IS_I915GM(dev) || IS_I945GM(dev))
>>  		panel->backlight.combination_mode = ctl & BLM_LEGACY_MODE;
>>  
>>  	if (IS_PINEVIEW(dev))
>> -- 
>> 1.7.9.5
>
> -- 
> Ville Syrjälä
> Intel OTC

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-27  8:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-25  9:14 [PATCH] drm/i915: use backlight legacy combination mode also for i945gm Jani Nikula
2014-02-25 10:47 ` Ville Syrjälä
2014-02-25 11:11   ` [PATCH] drm/i915: use backlight legacy combination mode also for i915gm/i945gm Jani Nikula
2014-02-26 13:20     ` Ville Syrjälä
2014-02-27  8:59       ` Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox