xf86-video-intel: Branch 'xf86-video-intel-2.2-branch' - 2 commits - src/i830.h src/i830_lvds.c

Jesse Barnes jbarnes at kemper.freedesktop.org
Wed Jan 9 09:54:20 PST 2008


 src/i830.h      |    2 ++
 src/i830_lvds.c |   22 +++++++++++++++++++---
 2 files changed, 21 insertions(+), 3 deletions(-)

New commits:
commit 7ce566c0005d9bb9394f7c730c38210e0ae7f00d
Author: Jesse Barnes <jbarnes at hobbes.virtuousgeek.org>
Date:   Thu Jan 3 11:16:15 2008 -0800

    Fix compilation error when not using DRI
    
    This patch complements 88f8b688e2316ae4a1f7485f0010ce90de54783a which
    added uint64_t typed variables to avoid unsigned long overflows in
    32-bit architectures but didn't include <stdint.h> with the required
    definition.
    
    When XF86DRI and _XF86DRI_SERVER_ are defined this header gets
    indirectly included through "i830_dri.h", thanks to "i830_common.h"
    which masquerades this problem as released in 2.1.0 and that manifests
    with :
    
    In file included from i810_driver.c:88:
    i830.h:137: error: expected specifier-qualifier-list before 'uint64_t'
    i830.h:240: error: expected specifier-qualifier-list before 'uint64_t'
    
    Patch from Carlo Marcelo Arenas Belon <carenas at sajinet.com.pe>

diff --git a/src/i830.h b/src/i830.h
index 8fea8c0..9adbaf7 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -40,6 +40,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define I830DEBUG
 #endif
 
+#include <stdint.h>
+
 #ifndef REMAP_RESERVED
 #define REMAP_RESERVED 0
 #endif
commit c8be857cc93aa9f4bd9315c2b0e5459625ef7a4b
Author: Jesse Barnes <jbarnes at hobbes.virtuousgeek.org>
Date:   Fri Jan 4 15:01:25 2008 -0800

    Don't modify low bit of BLC_PWM_CTL when using combo backlight control
    
    On some platforms, the low bit of BLC_PWM_CTL is wired as a 'max brightness'
    flag, rather than a regular part of the backlight duty cycle.  So when in the
    combo mode, divide the total number of backlight levels available by two
    (tossing one bit) and adjust the programming in the set_brightness routine.
    
    Note that platforms with this behavior may need quirks added so that they work
    by default.

diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index c58a7e0..cf0e345 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -234,6 +234,12 @@ i830_lvds_set_backlight_combo(xf86OutputPtr output, int level)
 #endif
     }
 
+    /*
+     * Don't set the lowest bit in combo configs since it can act as a flag for
+     * max brightness.
+     */
+    level <<= 1;
+
     blc_pwm_ctl = INREG(BLC_PWM_CTL);
     blc_pwm_ctl &= ~BACKLIGHT_DUTY_CYCLE_MASK;
     OUTREG(BLC_PWM_CTL, blc_pwm_ctl | (level << BACKLIGHT_DUTY_CYCLE_SHIFT));
@@ -248,7 +254,17 @@ i830_lvds_get_backlight_combo(xf86OutputPtr output)
 
     blc_pwm_ctl = INREG(BLC_PWM_CTL);
     blc_pwm_ctl &= BACKLIGHT_DUTY_CYCLE_MASK;
-    return blc_pwm_ctl;
+
+    /* Since we don't use the low bit when using combo, the value is halved */
+
+    return blc_pwm_ctl >> 1;
+}
+
+static int
+i830_lvds_get_backlight_max_combo(xf86OutputPtr output)
+{
+    /* Since we don't set the low bit when using combo, the range is halved */
+    return i830_lvds_get_backlight_max_native(output) >> 1;
 }
 
 /*
@@ -661,7 +677,7 @@ i830_lvds_set_backlight_control(xf86OutputPtr output)
 	dev_priv->set_backlight = i830_lvds_set_backlight_combo;
 	dev_priv->get_backlight = i830_lvds_get_backlight_combo;
 	dev_priv->backlight_max =
-	    i830_lvds_get_backlight_max_native(output);
+	    i830_lvds_get_backlight_max_combo(output);
 	break;
     case BCM_KERNEL:
 	dev_priv->set_backlight = i830_lvds_set_backlight_kernel;
@@ -1003,7 +1019,7 @@ i830_lvds_init(ScrnInfoPtr pScrn)
     case BCM_COMBO:
 	dev_priv->set_backlight = i830_lvds_set_backlight_combo;
 	dev_priv->get_backlight = i830_lvds_get_backlight_combo;
-	dev_priv->backlight_max = i830_lvds_get_backlight_max_native(output);
+	dev_priv->backlight_max = i830_lvds_get_backlight_max_combo(output);
 	break;
     case BCM_KERNEL:
 	dev_priv->set_backlight = i830_lvds_set_backlight_kernel;


More information about the xorg-commit mailing list