[PATCH] fbset: added timing and sync polarity settings

Michael Grzeschik m.grzeschik at pengutronix.de
Tue Jan 19 14:59:53 UTC 2010


With this patch it is possible to set more parameters from the busybox
userspace fbset utility, like timings, margins and sync polarity.
Without this patch the parameters can be specified but wouldn't be set
for the ioctl call.

Signed-off-by: Michael Grzeschik <m.grzeschik at pengutronix.de>
---
 util-linux/fbset.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 6e497c6..5e74a4a 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -267,6 +267,25 @@ static void setfbmode(struct fb_var_screeninfo *base,
 		base->yres_virtual = set->yres_virtual;
 	if ((int32_t) set->bits_per_pixel > 0)
 		base->bits_per_pixel = set->bits_per_pixel;
+	if ((int32_t) set->pixclock > 0)
+		base->pixclock = set->pixclock;
+	if ((int32_t) set->left_margin > 0)
+		base->left_margin = set->left_margin;
+	if ((int32_t) set->right_margin > 0)
+		base->right_margin = set->right_margin;
+	if ((int32_t) set->upper_margin > 0)
+		base->upper_margin = set->upper_margin;
+	if ((int32_t) set->lower_margin > 0)
+		base->lower_margin = set->lower_margin;
+	if ((int32_t) set->hsync_len > 0)
+		base->hsync_len = set->hsync_len;
+	if ((int32_t) set->vsync_len > 0)
+		base->vsync_len = set->vsync_len;
+	if ((int32_t) set->sync > 0)
+		base->sync = set->sync;
+	if ((int32_t) set->vmode > 0)
+		base->vmode = set->vmode;
+
 }
 
 static NOINLINE void showmode(struct fb_var_screeninfo *v)
@@ -357,6 +376,14 @@ int fbset_main(int argc, char **argv)
 				varset.hsync_len = xatou32(argv[6]);
 				varset.vsync_len = xatou32(argv[7]);
 				break;
+			case CMD_ACCEL:
+				break;
+			case CMD_HSYNC:
+				varset.sync |= FB_SYNC_HOR_HIGH_ACT;
+				break;
+			case CMD_VSYNC:
+				varset.sync |= FB_SYNC_VERT_HIGH_ACT;
+				break;
 #if ENABLE_FEATURE_FBSET_FANCY
 			case CMD_XRES:
 				varset.xres = xatou32(argv[1]);
-- 
1.6.6



More information about the busybox mailing list