summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandor Yu <R01008@freescale.com>2012-02-21 17:26:28 +0800
committerFrank Li <Frank.Li@freescale.com>2012-02-22 11:41:06 +0800
commitb13829c7539ad708dc72aa84522015106d8699f7 (patch)
treebaa6971d0b6100a3f1ae3775809c64afa396bcb0
parent94bd15b4b0311d2c7445b72e22bc273b9ff110ab (diff)
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 <R01008@freescale.com>
-rw-r--r--drivers/video/mxc_hdmi.c25
1 files 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);