Commit 4a999d25 authored by Jani Nikula's avatar Jani Nikula Committed by Daniel Vetter

drm/i915: don't hard code vlv backlight frequency if unset

Fall back to VBT based backlight modulation frequency if it's not
set. Do not hard code.

This could be a problem if there is no VBT.

Cc: Clint Taylor <clinton.a.taylor@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Tested-by: default avatarClint Taylor <Clinton.A.Taylor@intel.com>
Reviewed-by: default avatarClint Taylor <Clinton.A.Taylor@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent aa17cdb4
...@@ -1532,21 +1532,8 @@ static int vlv_setup_backlight(struct intel_connector *connector, enum pipe pipe ...@@ -1532,21 +1532,8 @@ static int vlv_setup_backlight(struct intel_connector *connector, enum pipe pipe
struct drm_device *dev = connector->base.dev; struct drm_device *dev = connector->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_panel *panel = &connector->panel; struct intel_panel *panel = &connector->panel;
enum pipe p;
u32 ctl, ctl2, val; u32 ctl, ctl2, val;
for_each_pipe(dev_priv, p) {
u32 cur_val = I915_READ(VLV_BLC_PWM_CTL(p));
/* Skip if the modulation freq is already set */
if (cur_val & ~BACKLIGHT_DUTY_CYCLE_MASK)
continue;
cur_val &= BACKLIGHT_DUTY_CYCLE_MASK;
I915_WRITE(VLV_BLC_PWM_CTL(p), (0xf42 << 16) |
cur_val);
}
if (WARN_ON(pipe != PIPE_A && pipe != PIPE_B)) if (WARN_ON(pipe != PIPE_A && pipe != PIPE_B))
return -ENODEV; return -ENODEV;
......
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