From ff8fb56b6f7edafc1bcba8ef008b3f368cabe60d Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Tue, 2 Jul 2013 00:04:05 +0200 Subject: video: consolidate splash screen alignment code Code for checking "splashpos" environment variable is duplicated in drivers, move it to the common function. Call this function also in the bmp display command to consider "splashpos" settings. Signed-off-by: Anatolij Gustschin Acked-by: Otavio Salvador --- drivers/video/cfb_console.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'drivers/video/cfb_console.c') diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 785bbcf..e384b71 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -222,11 +222,7 @@ #if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN) #include #include - -#ifdef CONFIG_SPLASH_SCREEN_ALIGN -#define BMP_ALIGN_CENTER 0x7FFF -#endif - +#include #endif /* @@ -1976,23 +1972,7 @@ static void *video_logo(void) __maybe_unused ulong addr; __maybe_unused char *s; -#ifdef CONFIG_SPLASH_SCREEN_ALIGN - s = getenv("splashpos"); - if (s != NULL) { - if (s[0] == 'm') - video_logo_xpos = BMP_ALIGN_CENTER; - else - video_logo_xpos = simple_strtol(s, NULL, 0); - - s = strchr(s + 1, ','); - if (s != NULL) { - if (s[1] == 'm') - video_logo_ypos = BMP_ALIGN_CENTER; - else - video_logo_ypos = simple_strtol(s + 1, NULL, 0); - } - } -#endif /* CONFIG_SPLASH_SCREEN_ALIGN */ + splash_get_pos(&video_logo_xpos, &video_logo_ypos); #ifdef CONFIG_SPLASH_SCREEN s = getenv("splashimage"); -- cgit v1.1