Commit 1cb1d6a5 authored by Jani Nikula's avatar Jani Nikula Committed by Luis Henriques

drm/i915: fix backlight after resume on 855gm

commit 2059ac3b upstream.

Some 855gm models (at least ThinkPad X40) regressed because of

commit b0cd324f
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Wed Nov 12 16:25:43 2014 +0200

    drm/i915: don't save/restore backlight hist ctl registers

which tried to make our driver more robust by not blindly saving and
restoring registers, but it failed to take into account

commit 0eb96d6e
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Wed Oct 14 12:33:41 2009 -0700

    drm/i915: save/restore BLC histogram control reg across suspend/resume

Fix the regression by enabling hist ctl on gen2.

v2: Improved the comment.

v3: Improved the comment, again.
Reported-and-tested-by: default avatarPhilipp Gesang <phg@phi-gamma.net>
References: http://mid.gmane.org/20150623222648.GD12335@acheron
Fixes: b0cd324f ("drm/i915: don't save/restore backlight hist ctl registers")
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 3e14cadc
...@@ -2898,6 +2898,7 @@ enum punit_power_well { ...@@ -2898,6 +2898,7 @@ enum punit_power_well {
#define BLM_POLARITY_PNV (1 << 0) /* pnv only */ #define BLM_POLARITY_PNV (1 << 0) /* pnv only */
#define BLC_HIST_CTL (dev_priv->info.display_mmio_offset + 0x61260) #define BLC_HIST_CTL (dev_priv->info.display_mmio_offset + 0x61260)
#define BLM_HISTOGRAM_ENABLE (1 << 31)
/* New registers for PCH-split platforms. Safe where new bits show up, the /* New registers for PCH-split platforms. Safe where new bits show up, the
* register layout machtes with gen4 BLC_PWM_CTL[12]. */ * register layout machtes with gen4 BLC_PWM_CTL[12]. */
......
...@@ -774,6 +774,14 @@ static void i9xx_enable_backlight(struct intel_connector *connector) ...@@ -774,6 +774,14 @@ static void i9xx_enable_backlight(struct intel_connector *connector)
/* XXX: combine this into above write? */ /* XXX: combine this into above write? */
intel_panel_actually_set_backlight(connector, panel->backlight.level); intel_panel_actually_set_backlight(connector, panel->backlight.level);
/*
* Needed to enable backlight on some 855gm models. BLC_HIST_CTL is
* 855gm only, but checking for gen2 is safe, as 855gm is the only gen2
* that has backlight.
*/
if (IS_GEN2(dev))
I915_WRITE(BLC_HIST_CTL, BLM_HISTOGRAM_ENABLE);
} }
static void i965_enable_backlight(struct intel_connector *connector) static void i965_enable_backlight(struct intel_connector *connector)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment