diff options
author | Sandor Yu <R01008@freescale.com> | 2014-03-13 17:44:41 +0800 |
---|---|---|
committer | Sandor Yu <R01008@freescale.com> | 2014-03-17 13:59:13 +0800 |
commit | c855e1c0e648efffef6968a78cd565c7d863e749 (patch) | |
tree | bfba33b0b6dfa297fac0ec6159d19b79195ea643 | |
parent | 94d23e328368bfabd9545236d50b1374246c4789 (diff) |
ENGR00303308 hdmi:update default video mode setting required by xserver
xserver will read default video mode in command line by sysfs node
/sys/class/graphics/fb0/mode, but the sysfs node is not initialized
when system bootup without hdmi cable plugin
or frame buffer register in blank state.
Fixed:
- Remove unused previous_mode
- Add default_mode, initialize in disp_init function.
- Initialize fbi->mode in disp_init function and hdmi_setup function.
Signed-off-by: Sandor Yu <R01008@freescale.com>
-rw-r--r-- | drivers/video/mxc/mxc_hdmi.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/video/mxc/mxc_hdmi.c b/drivers/video/mxc/mxc_hdmi.c index bf20720d1452..127bfb659f44 100644 --- a/drivers/video/mxc/mxc_hdmi.c +++ b/drivers/video/mxc/mxc_hdmi.c @@ -173,7 +173,7 @@ struct mxc_hdmi { bool irq_enabled; spinlock_t irq_lock; bool phy_enabled; - struct fb_videomode previous_mode; + struct fb_videomode default_mode; struct fb_videomode previous_non_vga_mode; bool requesting_vga_for_initialization; @@ -1872,13 +1872,7 @@ static void mxc_hdmi_set_mode(struct mxc_hdmi *hdmi) /* Set the default mode only once. */ if (!hdmi->dft_mode_set) { - dev_dbg(&hdmi->pdev->dev, "%s: setting to default=%s bpp=%d\n", - __func__, hdmi->dft_mode_str, hdmi->default_bpp); - - fb_find_mode(&var, hdmi->fbi, - hdmi->dft_mode_str, NULL, 0, NULL, - hdmi->default_bpp); - + fb_videomode_to_var(&var, &hdmi->default_mode); hdmi->dft_mode_set = true; } else fb_videomode_to_var(&var, &hdmi->previous_non_vga_mode); @@ -2147,9 +2141,6 @@ static void mxc_hdmi_setup(struct mxc_hdmi *hdmi, unsigned long event) dev_dbg(&hdmi->pdev->dev, "%s - video mode changed\n", __func__); - /* Save mode as 'previous_mode' so that we can know if mode changed. */ - memcpy(&hdmi->previous_mode, &m, sizeof(struct fb_videomode)); - hdmi->vic = 0; if (!hdmi->requesting_vga_for_initialization) { /* Save mode if this isn't the result of requesting @@ -2160,6 +2151,8 @@ static void mxc_hdmi_setup(struct mxc_hdmi *hdmi, unsigned long event) edid_mode = fb_find_nearest_mode(&m, &hdmi->fbi->modelist); pr_debug("edid mode "); dump_fb_videomode((struct fb_videomode *)edid_mode); + /* update fbi mode */ + hdmi->fbi->mode = (struct fb_videomode *)edid_mode; hdmi->vic = mxc_edid_mode_to_vic(edid_mode); } } @@ -2468,8 +2461,6 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp, if (irq < 0) return -ENODEV; - hdmi->dft_mode_set = false; - /* Setting HDMI default to blank state */ hdmi->blank = FB_BLANK_POWERDOWN; @@ -2565,6 +2556,10 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp, fb_var_to_videomode(&m, &hdmi->fbi->var); dump_fb_videomode(&m); + hdmi->dft_mode_set = false; + /* Save default video mode */ + memcpy(&hdmi->default_mode, &m, sizeof(struct fb_videomode)); + mode = fb_find_nearest_mode(&m, &hdmi->fbi->modelist); if (!mode) { pr_err("%s: could not find mode in modelist\n", __func__); @@ -2573,6 +2568,9 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp, fb_videomode_to_var(&hdmi->fbi->var, mode); + /* update fbi mode */ + hdmi->fbi->mode = (struct fb_videomode *)mode; + /* Default setting HDMI working in HDMI mode*/ hdmi->edid_cfg.hdmi_cap = true; |