Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322831
b: refs/heads/master
c: 28dcc2d
h: refs/heads/master
i:
  322829: c33c704
  322827: 68b6e39
  322823: c47925e
  322815: 377639e
v: v3
  • Loading branch information
Jani Nikula authored and Daniel Vetter committed Sep 3, 2012
1 parent a18d5d8 commit 2e16fe5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fcbc50da7753b210b4442ca9abc4efbd4e481f6e
refs/heads/master: 28dcc2d60cb570d9f549c329b2f51400553412a1
31 changes: 22 additions & 9 deletions trunk/drivers/gpu/drm/i915/intel_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,12 @@ static u32 i915_read_blc_pwm_ctl(struct drm_i915_private *dev_priv)
return val;
}

u32 intel_panel_get_max_backlight(struct drm_device *dev)
static u32 _intel_panel_get_max_backlight(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
u32 max;

max = i915_read_blc_pwm_ctl(dev_priv);
if (max == 0) {
/* XXX add code here to query mode clock or hardware clock
* and program max PWM appropriately.
*/
pr_warn_once("fixme: max PWM is zero\n");
return 1;
}

if (HAS_PCH_SPLIT(dev)) {
max >>= 16;
Expand All @@ -188,6 +181,22 @@ u32 intel_panel_get_max_backlight(struct drm_device *dev)
max *= 0xff;
}

return max;
}

u32 intel_panel_get_max_backlight(struct drm_device *dev)
{
u32 max;

max = _intel_panel_get_max_backlight(dev);
if (max == 0) {
/* XXX add code here to query mode clock or hardware clock
* and program max PWM appropriately.
*/
pr_warn_once("fixme: max PWM is zero\n");
return 1;
}

DRM_DEBUG_DRIVER("max backlight PWM = %d\n", max);
return max;
}
Expand Down Expand Up @@ -424,7 +433,11 @@ int intel_panel_setup_backlight(struct drm_device *dev)

memset(&props, 0, sizeof(props));
props.type = BACKLIGHT_RAW;
props.max_brightness = intel_panel_get_max_backlight(dev);
props.max_brightness = _intel_panel_get_max_backlight(dev);
if (props.max_brightness == 0) {
DRM_ERROR("Failed to get maximum backlight value\n");
return -ENODEV;
}
dev_priv->backlight =
backlight_device_register("intel_backlight",
&connector->kdev, dev,
Expand Down

0 comments on commit 2e16fe5

Please sign in to comment.