[OpenBIOS] [commit] r1208 - in trunk/openbios-devel: drivers libopenbios

repository service svn at openbios.org
Mon Aug 19 09:40:11 CEST 2013


Author: mcayland
Date: Mon Aug 19 09:40:10 2013
New Revision: 1208
URL: http://tracker.coreboot.org/trac/openbios/changeset/1208

Log:
vga: move initialisation of screen-#columns/screen-#rows to setup_video()

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>

Modified:
   trunk/openbios-devel/drivers/vga_vbe.c
   trunk/openbios-devel/libopenbios/video_common.c

Modified: trunk/openbios-devel/drivers/vga_vbe.c
==============================================================================
--- trunk/openbios-devel/drivers/vga_vbe.c	Mon Aug 19 09:40:07 2013	(r1207)
+++ trunk/openbios-devel/drivers/vga_vbe.c	Mon Aug 19 09:40:10 2013	(r1208)
@@ -55,8 +55,7 @@
                   unsigned long rom, uint32_t rom_size)
 {
 	phys_addr_t phys;
-	phandle_t ph, chosen, aliases, options;
-	char buf[6];
+	phandle_t ph, chosen, aliases;
 	int size;
 
 	phys = fb;
@@ -82,12 +81,6 @@
 	aliases = find_dev("/aliases");
 	set_property(aliases, "screen", path, strlen(path) + 1);
 
-	options = find_dev("/options");
-	snprintf(buf, sizeof(buf), FMT_ucell, VIDEO_DICT_VALUE(video.w) / FONT_WIDTH);
-	set_property(options, "screen-#columns", buf, strlen(buf) + 1);
-	snprintf(buf, sizeof(buf), FMT_ucell, VIDEO_DICT_VALUE(video.h) / FONT_HEIGHT);
-	set_property(options, "screen-#rows", buf, strlen(buf) + 1);
-
 	if (rom_size >= 8) {
                 const char *p;
 

Modified: trunk/openbios-devel/libopenbios/video_common.c
==============================================================================
--- trunk/openbios-devel/libopenbios/video_common.c	Mon Aug 19 09:40:07 2013	(r1207)
+++ trunk/openbios-devel/libopenbios/video_common.c	Mon Aug 19 09:40:10 2013	(r1208)
@@ -15,6 +15,7 @@
  */
 
 #include "config.h"
+#include "libc/vsprintf.h"
 #include "libopenbios/bindings.h"
 #include "libopenbios/fontdata.h"
 #include "libopenbios/ofmem.h"
@@ -218,6 +219,8 @@
 	/* Make everything inside the video_info structure point to the
 	   values in the Forth dictionary. Hence everything is always in
 	   sync. */
+	phandle_t options;
+	char buf[6];
 
 	video.mphys = phys;
 
@@ -277,4 +280,11 @@
 		VIDEO_DICT_VALUE(video.rb) = (w * ((d + 7) / 8));
 	}
 #endif
+
+	/* Setup screen-#rows/screen-#columns */
+	options = find_dev("/options");
+	snprintf(buf, sizeof(buf), FMT_ucell, VIDEO_DICT_VALUE(video.w) / FONT_WIDTH);
+	set_property(options, "screen-#columns", buf, strlen(buf) + 1);
+	snprintf(buf, sizeof(buf), FMT_ucell, VIDEO_DICT_VALUE(video.h) / FONT_HEIGHT);
+	set_property(options, "screen-#rows", buf, strlen(buf) + 1);
 }



More information about the OpenBIOS mailing list