summaryrefslogtreecommitdiff
path: root/src/glamo-output.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2009-02-25 00:52:05 +0100
committerLars-Peter Clausen <lars@metafoo.de>2009-02-25 00:52:05 +0100
commit99b38c284e91efc45f9bc4c087e462abe98ae0a4 (patch)
tree69f93ee0ecdd650a5c1e4c3ae6b3738fd1dc34ca /src/glamo-output.c
parent703acea131caf72e71f04a0ad40f540fe236be89 (diff)
Make the path to the sysfs state file for the jbt6k47 display driver
configurable. It can either be set at configure time with --with-jbt6k47-state-path=PATH. Or at runtime in the xorg.conf device section. The option name is StatePath.
Diffstat (limited to 'src/glamo-output.c')
-rw-r--r--src/glamo-output.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/glamo-output.c b/src/glamo-output.c
index 57ce7c2..60ea902 100644
--- a/src/glamo-output.c
+++ b/src/glamo-output.c
@@ -39,9 +39,10 @@
#include "glamo.h"
-static const char *display_state_switch_path = "/sys/bus/spi/devices/spi2.0/state";
-static const char *display_state_vga = "normal";
-static const char *display_state_qvga = "qvga-normal";
+#ifdef JBT6K74_SET_STATE
+static const char jbt6k74_state_vga[] = "normal";
+static const char jbt6k74_state_qvga[] = "qvga-normal";
+#endif
typedef struct _GlamoOutput {
DisplayModePtr modes;
@@ -241,18 +242,21 @@ GlamoOutputModeSet(xf86OutputPtr output, DisplayModePtr mode,
static void
GlamoOutputCommit(xf86OutputPtr output) {
- int fd = open(display_state_switch_path, O_WRONLY);
+#ifdef JBT6K74_SET_STATE
+ GlamoPtr pGlamo = GlamoPTR(output->scrn);
+ int fd = open(pGlamo->jbt6k74_state_path, O_WRONLY);
if (fd != -1) {
if(output->crtc->mode.HDisplay == 240 && output->crtc->mode.VDisplay == 320)
- write(fd, display_state_qvga, strlen(display_state_qvga));
+ write(fd, jbt6k74_state_qvga, sizeof(jbt6k74_state_qvga));
else
- write(fd, display_state_vga, strlen(display_state_vga));
+ write(fd, jbt6k74_state_vga, sizeof(jbt6k74_state_vga));
close(fd);
} else {
xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
- "Couldn't open %s to change display resolution: %s\n",
- display_state_switch_path, strerror(errno));
+ "Couldn't open \"%s\" to change display resolution: %s\n",
+ pGlamo->jbt6k74_state_path, strerror(errno));
}
+#endif
}
static void GlamoOutputDestroy(xf86OutputPtr output) {