]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00174911 MX6x Setting HDMI default mode according bootload cmdline
authorSandor Yu <R01008@freescale.com>
Tue, 21 Feb 2012 09:26:28 +0000 (17:26 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:06 +0000 (08:34 +0200)
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 <R01008@freescale.com>
drivers/video/mxc_hdmi.c

index 9d95e94def822abafae6e14dedf154180051e2bc..c415042f204d52845799cecf95a516c011a8b3f5 100644 (file)
@@ -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);