xserver: Branch 'master'

Matthew Allum mallum at kemper.freedesktop.org
Thu Aug 31 09:19:06 PDT 2006


 hw/kdrive/fbdev/fbdev.c  |   16 +++++++++++-----
 hw/kdrive/fbdev/fbdev.h  |    1 +
 hw/kdrive/fbdev/fbinit.c |   21 +++++++++++++++++----
 3 files changed, 29 insertions(+), 9 deletions(-)

New commits:
diff-tree fd609956f27d76ee76ac8623787f0fc8633a5546 (from 2fb7b8795a9a36cce61f6449f6ca26ffd1b071f0)
Author: Matthew Allum <mallum at openedhand.com>
Date:   Thu Aug 31 17:18:57 2006 +0100

    Add framebuffer device command line switch for Xfbdev

diff --git a/hw/kdrive/fbdev/fbdev.c b/hw/kdrive/fbdev/fbdev.c
index 86384f0..904d5f3 100644
--- a/hw/kdrive/fbdev/fbdev.c
+++ b/hw/kdrive/fbdev/fbdev.c
@@ -38,11 +38,17 @@ fbdevInitialize (KdCardInfo *card, Fbdev
 {
     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) {
diff --git a/hw/kdrive/fbdev/fbdev.h b/hw/kdrive/fbdev/fbdev.h
index d37b995..b7951db 100644
--- a/hw/kdrive/fbdev/fbdev.h
+++ b/hw/kdrive/fbdev/fbdev.h
@@ -53,6 +53,7 @@ typedef struct _fbdevScrPriv {
 } FbdevScrPriv;
 
 extern KdCardFuncs  fbdevFuncs;
+extern char*        fbdevDevicePath;
 
 Bool
 fbdevInitialize (KdCardInfo *card, FbdevPriv *priv);
diff --git a/hw/kdrive/fbdev/fbinit.c b/hw/kdrive/fbdev/fbinit.c
index ba9d1c6..1a7e4bf 100644
--- a/hw/kdrive/fbdev/fbinit.c
+++ b/hw/kdrive/fbdev/fbinit.c
@@ -54,17 +54,30 @@ InitInput (int argc, char **argv)
 void
 ddxUseMsg (void)
 {
-    KdUseMsg();
+  KdUseMsg();
+  ErrorF("\nXfbdev Device Usage:\n");
+  ErrorF("-fb path         Framebuffer device to use. Defaults to /dev/fb0\n");
+  ErrorF("\n");
 }
 
 int
 ddxProcessArgument (int argc, char **argv, int i)
 {
-    return KdProcessArgument (argc, argv, i);
-}
-
+  if (!strcmp (argv[i], "-fb"))
+    {
+      if (i+1 < argc) 
+	{
+	  fbdevDevicePath = argv[i+1];
+	  return 2;
+	} 
+      UseMsg();
+      exit(1);
+    }
 
+  return KdProcessArgument (argc, argv, i);
+}
 
+char           *fbdevDevicePath = NULL;
 KdCardFuncs	fbdevFuncs = {
     fbdevCardInit,	    /* cardinit */
     fbdevScreenInit,	    /* scrinit */



More information about the xorg-commit mailing list