Patch "drm/i915: try not to lose backlight CBLV precision" has been added to the 3.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/i915: try not to lose backlight CBLV precision

to the 3.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-i915-try-not-to-lose-backlight-cblv-precision.patch
and it can be found in the queue-3.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From fbeecda256bab53034d5a7f0c79c2f99219ce7c3 Mon Sep 17 00:00:00 2001
From: Jani Nikula <jani.nikula@xxxxxxxxx>
Date: Fri, 23 Aug 2013 10:50:39 +0300
Subject: drm/i915: try not to lose backlight CBLV precision

From: Jani Nikula <jani.nikula@xxxxxxxxx>

commit cac6a5ae0118832936eb162ec4cedb30f2422bcc upstream.

ACPI has _BCM and _BQC methods to set and query the backlight
brightness, respectively. The ACPI opregion has variables BCLP and CBLV
to hold the requested and current backlight brightness, respectively.

The BCLP variable has range 0..255 while the others have range
0..100. This means the _BCM method has to scale the brightness for BCLP,
and the gfx driver has to scale the requested value back for CBLV. If
the _BQC method uses the CBLV variable (apparently some implementations
do, some don't) for current backlight level reporting, there's room for
rounding errors.

Use DIV_ROUND_UP for scaling back to CBLV to get back to the same values
that were passed to _BCM, presuming the _BCM simply uses bclp = (in *
255) / 100 for scaling to BCLP.

Reference: https://gist.github.com/aaronlu/6314920
Reported-by: Aaron Lu <aaron.lu@xxxxxxxxx>
Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
Reviewed-by: Aaron Lu <aaron.lu@xxxxxxxxx>
Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
[bwh: Backported to 3.2:
 - Adjust context
 - ASLE region is treated as normal memory rather than __iomem]
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
Cc: Weng Meiling <wengmeiling.weng@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/gpu/drm/i915/intel_opregion.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -161,7 +161,7 @@ static u32 asle_set_backlight(struct drm
 
 	max = intel_panel_get_max_backlight(dev);
 	intel_panel_set_backlight(dev, bclp * max / 255);
-	asle->cblv = (bclp*0x64)/0xff | ASLE_CBLV_VALID;
+	asle->cblv = DIV_ROUND_UP(bclp * 100, 255) | ASLE_CBLV_VALID;
 
 	return 0;
 }


Patches currently in stable-queue which might be from jani.nikula@xxxxxxxxx are

queue-3.4/drm-i915-add-quirk-to-invert-brightness-on-emachines-g725.patch
queue-3.4/drm-i915-add-quirk_invert_brightness-for-ncr-machines.patch
queue-3.4/drm-i915-try-not-to-lose-backlight-cblv-precision.patch
queue-3.4/drm-i915-add-quirk-to-invert-brightness-on-emachines-e725.patch
queue-3.4/drm-i915-add-missing-n-to-uts_release-in-the-error_state.patch
queue-3.4/drm-i915-ensure-single-initialization-and-cleanup-of-backlight-device.patch
queue-3.4/drm-i915-sdvo-clean-up-connectors-on-intel_sdvo_init-failures.patch
queue-3.4/drm-i915-panel-invert-brightness-via-parameter.patch
queue-3.4/drm-i915-panel-invert-brightness-acer-aspire-5734z.patch
queue-3.4/drm-i915-panel-invert-brightness-via-quirk.patch
queue-3.4/drm-i915-add-quirk-to-invert-brightness-on-packard-bell-ncl20.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]