xf86-video-intel: src/backlight.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Feb 18 20:04:43 CET 2014


 src/backlight.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit c91af569ee90a832899c9038badd84921e9a87fc
Author: Mark Kettenis <mark.kettenis at xs4all.nl>
Date:   Tue Feb 18 19:02:14 2014 +0000

    backlight: Build fixes for OpenBSD
    
    Chris would like to humbly apologise for making these changes to the
    OpenBSD code blind, and to thank Mark and Jonathan for their support
    and understanding.

diff --git a/src/backlight.c b/src/backlight.c
index 688819d..6b74a21 100644
--- a/src/backlight.c
+++ b/src/backlight.c
@@ -32,6 +32,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
+#include <sys/ioctl.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -66,18 +67,21 @@
  * So we're left with spawning a helper child which gets levels to set written
  * to it through a pipe. This turns the blocking forever problem from a hung
  * machine problem into a simple backlight control not working problem.
+ *
+ * If only things were as simple as on OpenBSD! :)
  */
 
 #ifdef __OpenBSD__
 
 #include <dev/wscons/wsconsio.h>
+#include <xf86Priv.h>
 
 int backlight_set(struct backlight *b, int level)
 {
 	struct wsdisplay_param param;
 
 	if (b->iface == NULL)
-		return;
+		return -1;
 
 	if ((unsigned)level > b->max)
 		level = b->max;
@@ -129,6 +133,14 @@ int backlight_open(struct backlight *b, char *iface)
 	return param.curval;
 }
 
+enum backlight_type backlight_exists(const char *iface)
+{
+	if (iface != NULL)
+		return BL_NONE;
+
+	return BL_PLATFORM;
+}
+
 #else
 
 static int


More information about the xorg-commit mailing list