Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306963
b: refs/heads/master
c: 7bd9090
h: refs/heads/master
i:
  306961: 3739b9b
  306959: 92b5bf6
v: v3
  • Loading branch information
Carsten Emde authored and Daniel Vetter committed Mar 18, 2012
1 parent 8f8d8f5 commit 55bf57f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f01db988ef6f6c70a6cc36ee71e4a98a68901229
refs/heads/master: 7bd90909bbf9ce7c40e1da3d72b97b93839c188a
9 changes: 9 additions & 0 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
i8k.restricted [HW] Allow controlling fans only if SYS_ADMIN
capability is set.

i915.invert_brightness
[DRM] Invert the sense of the variable that is used to
set the brightness of the panel backlight. Normally a
value of 0 indicates backlight switched off, and the
maximum value sets the backlight to maximum brightness.
If this parameter is specified, a value of 0 sets the
backlight to maximum brightness, and the maximum value
switches the backlight off.

icn= [HW,ISDN]
Format: <io>[,<membase>[,<icn_id>[,<icn_id2>]]]

Expand Down
17 changes: 17 additions & 0 deletions trunk/drivers/gpu/drm/i915/intel_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* Chris Wilson <chris@chris-wilson.co.uk>
*/

#include <linux/moduleparam.h>
#include "intel_drv.h"

#define PCI_LBPC 0xf4 /* legacy/combination backlight modes */
Expand Down Expand Up @@ -191,6 +192,20 @@ u32 intel_panel_get_max_backlight(struct drm_device *dev)
return max;
}

static bool i915_panel_invert_brightness;
MODULE_PARM_DESC(invert_brightness, "Invert backlight brightness, please "
"report PCI device ID, subsystem vendor and subsystem device ID "
"to dri-devel@lists.freedesktop.org, if your machine needs it. "
"It will then be included in an upcoming module version.");
module_param_named(invert_brightness, i915_panel_invert_brightness, bool, 0600);
static u32 intel_panel_compute_brightness(struct drm_device *dev, u32 val)
{
if (i915_panel_invert_brightness)
return intel_panel_get_max_backlight(dev) - val;

return val;
}

u32 intel_panel_get_backlight(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
Expand All @@ -211,6 +226,7 @@ u32 intel_panel_get_backlight(struct drm_device *dev)
}
}

val = intel_panel_compute_brightness(dev, val);
DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val);
return val;
}
Expand All @@ -228,6 +244,7 @@ static void intel_panel_actually_set_backlight(struct drm_device *dev, u32 level
u32 tmp;

DRM_DEBUG_DRIVER("set backlight PWM = %d\n", level);
level = intel_panel_compute_brightness(dev, level);

if (HAS_PCH_SPLIT(dev))
return intel_pch_panel_set_backlight(dev, level);
Expand Down

0 comments on commit 55bf57f

Please sign in to comment.