From 29a2921f87a339fd052c28e0b630758fc85b9330 Mon Sep 17 00:00:00 2001 From: Sandor Yu Date: Tue, 21 Feb 2012 17:26:28 +0800 Subject: [PATCH] ENGR00174911 MX6x Setting HDMI default mode according bootload cmdline Origin HDMI default video mode is setting to VGA. But the HDMI will change to the vide mode setting in bootloader command line when the first time HDMI cable plugin. It will cause GUI sometime can't not get correct FB video mode when system bootup without HDMI cable plugout. Signed-off-by: Sandor Yu --- drivers/video/mxc_hdmi.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/video/mxc_hdmi.c b/drivers/video/mxc_hdmi.c index 9d95e94def82..c415042f204d 100644 --- a/drivers/video/mxc_hdmi.c +++ b/drivers/video/mxc_hdmi.c @@ -2098,6 +2098,8 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp, struct mxc_dispdrv_setting *setting) { int ret = 0; + u32 i; + const struct fb_videomode *mode; struct mxc_hdmi *hdmi = mxc_dispdrv_getdata(disp); struct fsl_mxc_hdmi_platform_data *plat = hdmi->pdev->dev.platform_data; int irq = platform_get_irq(hdmi->pdev, 0); @@ -2186,8 +2188,27 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp, spin_lock_init(&hdmi->irq_lock); - fb_add_videomode(&vga_mode, &hdmi->fbi->modelist); - fb_videomode_to_var(&hdmi->fbi->var, &vga_mode); + /* Set the default mode and modelist when disp init. */ + fb_find_mode(&hdmi->fbi->var, hdmi->fbi, + hdmi->dft_mode_str, NULL, 0, NULL, + hdmi->default_bpp); + + console_lock(); + + fb_destroy_modelist(&hdmi->fbi->modelist); + + /*Add all no interlaced CEA mode to default modelist */ + for (i = 0; i < ARRAY_SIZE(mxc_cea_mode); i++) { + mode = &mxc_cea_mode[i]; + if (!(mode->vmode & FB_VMODE_INTERLACED) && (mode->xres != 0)) + fb_add_videomode(mode, &hdmi->fbi->modelist); + } + + /*Add XGA and SXGA to default modelist */ + fb_add_videomode(&xga_mode, &hdmi->fbi->modelist); + fb_add_videomode(&sxga_mode, &hdmi->fbi->modelist); + + console_unlock(); INIT_DELAYED_WORK(&hdmi->hotplug_work, hotplug_worker); -- 2.39.2