[PATCH 3/3] xvfb: process command line arguments afterwards in InitOutput

Tiago Vignatti tiago.vignatti at nokia.com
Thu Apr 8 07:34:14 PDT 2010


ddxProcessArgument() is a misname here. It should just *get* command line
args, parse them, without start in fact the actual *processing* and execution.
A reasonable place to processing is inside InitOutput(), when mostly common
structure is already initialized.

This patch follow the behaviour mentioned, processing command line arguments
only after, in InitOutput()

Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
---
I need this commit to make MAXSCREENS in run time work properly. So I'm kindly
requesting for reviewers :)


 hw/vfb/InitOutput.c |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index 4e82aee..e15de33 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -305,8 +305,6 @@ vfbGetScreen(char *argv[], int i)
         FatalError("Invalid screen configuration %s for -screen %d\n",
            argv[i+2], vfbScreenNum);
     }
-
-	vfbProcessScreen();
 	return 3;
 }
 
@@ -328,7 +326,6 @@ vfbGetPixdepths(int argc, char *argv[], int i)
 		FatalError("Invalid pixmap depth %d passed to -pixdepths\n",
 			   vfbPixdepth);
 	    }
-		vfbProcessPixdepths();
 		return 2;
 	}
 	return 1;
@@ -355,7 +352,6 @@ static int
 vfbGetBlackpixel(char *argv[], int i)
 {
 	vfbBlackpix = atoi(argv[++i]);
-	vfbProcessBlackpixel();
     return 2;
 }
 
@@ -380,7 +376,6 @@ static int
 vfbGetWhitepixel(char *argv[], int i)
 {
 	vfbWhitePix = atoi(argv[++i]);
-	vfbProcessWhitepixel();
 	return 2;
 }
 
@@ -405,22 +400,12 @@ static int
 vfbGetLinebias(char *argv[], int i)
 {
 	vfbLinebias = atoi(argv[++i]);
-	vfbProcessLinebias();
 	return 2;
 }
 
 int
 ddxProcessArgument(int argc, char *argv[], int i)
 {
-    static Bool firstTime = TRUE;
-
-    if (firstTime)
-    {
-	vfbInitializeDefaultScreens();
-	vfbInitializePixmapDepths();
-        firstTime = FALSE;
-    }
-
 #define CHECK_FOR_REQUIRED_ARGUMENTS(num) \
     if (((i + num) >= argc) || (!argv[i + num])) {                      \
       ErrorF("Required argument to %s not specified\n", argv[i]);       \
@@ -1014,6 +999,20 @@ InitOutput(ScreenInfo *screenInfo, int argc, char **argv)
 {
     int i;
     int NumFormats = 0;
+    static Bool firstTime = TRUE;
+
+    vfbProcessScreen();
+    vfbProcessPixdepths();
+    vfbProcessBlackpixel();
+    vfbProcessWhitepixel();
+    vfbProcessLinebias();
+
+    if (firstTime)
+    {
+	vfbInitializeDefaultScreens();
+	vfbInitializePixmapDepths();
+        firstTime = FALSE;
+    }
 
     /* initialize pixmap formats */
 
-- 
1.6.0.4



More information about the xorg-devel mailing list