xf86-video-intel: src/i830_lvds.c

Jesse Barnes jbarnes at kemper.freedesktop.org
Thu Mar 6 13:58:16 PST 2008


 src/i830_lvds.c |   32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

New commits:
commit be08b61540e1edbb7673f0b6add0f1e32b136b3c
Author: Jesse Barnes <jbarnes at jbarnes-t61.(none)>
Date:   Thu Mar 6 13:55:13 2008 -0800

    Implement new get_property feature for backlight control
    
    This should keep the backlight value reported by xrandr --prop & xbacklight
    consistent with changes by other software in the system (like the hotkey driver
    or kernel backlight driver).

diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index ef8fa4a..8359e39 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -851,6 +851,35 @@ i830_lvds_set_property(xf86OutputPtr output, Atom property,
 }
 #endif /* RANDR_12_INTERFACE */
 
+#ifdef RANDR_13_INTERFACE
+static Bool
+i830_lvds_get_property(xf86OutputPtr output, Atom property)
+{
+    ScrnInfoPtr		    pScrn = output->scrn;
+    I830Ptr		    pI830 = I830PTR(pScrn);
+    I830OutputPrivatePtr    intel_output = output->driver_private;
+    struct i830_lvds_priv   *dev_priv = intel_output->dev_priv;
+    int ret;
+
+    /*
+     * Only need to update properties that might change out from under
+     * us.  The others will be cached by the randr core code.
+     */
+    if (property == backlight_atom) {
+	int val;
+	val = dev_priv->get_backlight(output);
+	dev_priv->backlight_duty_cycle = val;
+	ret = RRChangeOutputProperty(output->randr_output, backlight_atom,
+				     XA_INTEGER, 32, PropModeReplace, 1, &val,
+				     FALSE, TRUE);
+	if (ret != Success)
+	    return FALSE;
+    }
+
+    return TRUE;
+}
+#endif /* RANDR_13_INTERFACE */
+
 static const xf86OutputFuncsRec i830_lvds_output_funcs = {
     .create_resources = i830_lvds_create_resources,
     .dpms = i830_lvds_dpms,
@@ -866,6 +895,9 @@ static const xf86OutputFuncsRec i830_lvds_output_funcs = {
 #ifdef RANDR_12_INTERFACE
     .set_property = i830_lvds_set_property,
 #endif
+#ifdef RANDR_13_INTERFACE
+    .get_property = i830_lvds_get_property,
+#endif
     .destroy = i830_lvds_destroy
 };
 


More information about the xorg-commit mailing list