summaryrefslogtreecommitdiff
path: root/hw/kdrive/fbdev/fbdev.c
diff options
context:
space:
mode:
authorMatthew Allum <mallum@openedhand.com>2006-08-31 17:18:57 +0100
committerMatthew Allum <mallum@openedhand.com>2006-08-31 17:18:57 +0100
commitfd609956f27d76ee76ac8623787f0fc8633a5546 (patch)
treee11b93267602df7f81f6f409867f420021116ca6 /hw/kdrive/fbdev/fbdev.c
parent2fb7b8795a9a36cce61f6449f6ca26ffd1b071f0 (diff)
Add framebuffer device command line switch for Xfbdev
Diffstat (limited to 'hw/kdrive/fbdev/fbdev.c')
-rw-r--r--hw/kdrive/fbdev/fbdev.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/hw/kdrive/fbdev/fbdev.c b/hw/kdrive/fbdev/fbdev.c
index 86384f0a4..904d5f315 100644
--- a/hw/kdrive/fbdev/fbdev.c
+++ b/hw/kdrive/fbdev/fbdev.c
@@ -38,11 +38,17 @@ fbdevInitialize (KdCardInfo *card, FbdevPriv *priv)
{
int k;
unsigned long off;
- if ((priv->fd = open("/dev/fb0", O_RDWR)) < 0 && \
- (priv->fd = open("/dev/fb/0", O_RDWR)) < 0) {
- perror("Error opening /dev/fb0");
- return FALSE;
- }
+
+ if (fbdevDevicePath == NULL)
+ fbdevDevicePath = "/dev/fb0";
+
+ if ((priv->fd = open(fbdevDevicePath, O_RDWR)) < 0)
+ {
+ ErrorF("Error opening framebuffer %s: %s\n",
+ fbdevDevicePath, strerror(errno));
+ return FALSE;
+ }
+
/* quiet valgrind */
memset (&priv->fix, '\0', sizeof (priv->fix));
if ((k=ioctl(priv->fd, FBIOGET_FSCREENINFO, &priv->fix)) < 0) {