The combination/legacy mode was first removed in commit 951f3512dba5bd44cda3e5ee22b4b522e4bb09fb Author: Indan Zupancic <indan at nul.nu> Date: Thu Feb 17 02:41:49 2011 +0100 drm/i915: Do not handle backlight combination mode specially which was subsequently reverted due to regression in commit ba3820ade317ee36e496b9b40d2ec3987dd4aef0 Author: Takashi Iwai <tiwai at suse.de> Date: Thu Mar 10 14:02:12 2011 +0100 drm/i915: Revive combination mode for backlight control It seems that on some machines the combination mode was necessary because it reset the LBPC register value on resume. Since the driver now saves and restores the register over suspend, the combination mode no longer needs to be treated specially, and the driver doesn't need to modify the LBPC register at all. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53153 CC: Indan Zupancic <indan at nul.nu> CC: Takashi Iwai <tiwai at suse.de> Signed-off-by: Jani Nikula <jani.nikula at intel.com> --- drivers/gpu/drm/i915/intel_panel.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 9546f97..0a7f47a 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -115,19 +115,6 @@ done: dev_priv->pch_pf_size = (width << 16) | height; } -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; -} - static u32 i915_read_blc_pwm_ctl(struct drm_i915_private *dev_priv) { u32 val; @@ -181,9 +168,6 @@ u32 intel_panel_get_max_backlight(struct drm_device *dev) max >>= 17; else max >>= 16; - - if (is_backlight_combination_mode(dev)) - max *= 0xff; } DRM_DEBUG_DRIVER("max backlight PWM = %d\n", max); @@ -222,13 +206,6 @@ static u32 intel_panel_get_backlight(struct drm_device *dev) val = I915_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; if (INTEL_INFO(dev)->gen < 4) val >>= 1; - - if (is_backlight_combination_mode(dev)) { - u8 lbpc; - - pci_read_config_byte(dev->pdev, PCI_LBPC, &lbpc); - val *= lbpc; - } } val = intel_panel_compute_brightness(dev, val); @@ -254,15 +231,6 @@ static void intel_panel_actually_set_backlight(struct drm_device *dev, u32 level if (HAS_PCH_SPLIT(dev)) return intel_pch_panel_set_backlight(dev, level); - if (is_backlight_combination_mode(dev)) { - u32 max = intel_panel_get_max_backlight(dev); - u8 lbpc; - - lbpc = level * 0xfe / max + 1; - level /= lbpc; - pci_write_config_byte(dev->pdev, PCI_LBPC, lbpc); - } - tmp = I915_READ(BLC_PWM_CTL); if (INTEL_INFO(dev)->gen < 4) level <<= 1; -- 1.7.9.5