i915/kms/backlight-combo mode problem (was: Re: Linux 2.6.39-rc5)

Melchior FRANZ melchior.franz at gmail.com
Thu May 5 13:42:21 PDT 2011


* Takashi Iwai -- Thursday 05 May 2011:
> Try the fixed patch below.

> ---
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 456f404..4c6e187 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -332,6 +332,7 @@ typedef struct drm_i915_private {
>  	struct intel_overlay *overlay;
>  
>  	/* LVDS info */
> +	int backlight_combination_mode; /* 0=unknown, -1=no, 1=yes */
>  	int backlight_level;  /* restore backlight to this value */
>  	bool backlight_enabled;
>  	struct drm_display_mode *panel_fixed_mode;
> diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> index f8f86e5..5a6be04 100644
> --- a/drivers/gpu/drm/i915/intel_panel.c
> +++ b/drivers/gpu/drm/i915/intel_panel.c
> @@ -115,14 +115,24 @@ done:
>  static int is_backlight_combination_mode(struct drm_device *dev)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
> -
> -	if (INTEL_INFO(dev)->gen >= 4)
> -		return I915_READ(BLC_PWM_CTL2) & BLM_COMBINATION_MODE;
> -
> -	if (IS_GEN2(dev))
> -		return I915_READ(BLC_PWM_CTL) & BLM_LEGACY_MODE;
> -
> -	return 0;
> +	int combo_mode;
> +	u8 lbpc;
> +
> +	if (dev_priv->backlight_combination_mode)
> +		return dev_priv->backlight_combination_mode > 0;
> +
> +	pci_read_config_byte(dev->pdev, PCI_LBPC, &lbpc);
> +	if (!lbpc)
> +		combo_mode = 0;
> +	else if (INTEL_INFO(dev)->gen >= 4)
> +		combo_mode = I915_READ(BLC_PWM_CTL2) & BLM_COMBINATION_MODE;
> +	else if (IS_GEN2(dev))
> +		combo_mode = I915_READ(BLC_PWM_CTL) & BLM_LEGACY_MODE;
> +	else
> +		combo_mode = 0;
> +
> +	dev_priv->backlight_combination_mode = combo_mode ? 1 : -1;
> +	return combo_mode;
>  }
>  
>  static u32 i915_read_blc_pwm_ctl(struct drm_i915_private *dev_priv)

The first patch had a problem. Without the lbpc check for zero the backlight
still stayed off and could only be activated with the brightness-down key.
This revised patch works correctly for me. Thanks!

m.


More information about the dri-devel mailing list