diff options
author | Sandor Yu <R01008@freescale.com> | 2014-03-13 05:44:41 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:58:00 -0400 |
commit | 2b5491d57d36176bd82036226c6c750f30ee1a27 (patch) | |
tree | 49ab11777c20f65ebbe5d8b91e138e6d385c5310 | |
parent | 3cfd01f4a0d055bf51095887bc1f43ce0a4e9898 (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 fa3ceda03556..d0916b440c68 100644 --- a/drivers/video/mxc/mxc_hdmi.c +++ b/drivers/video/mxc/mxc_hdmi.c | |||
@@ -173,7 +173,7 @@ struct mxc_hdmi { | |||
173 | bool irq_enabled; | 173 | bool irq_enabled; |
174 | spinlock_t irq_lock; | 174 | spinlock_t irq_lock; |
175 | bool phy_enabled; | 175 | bool phy_enabled; |
176 | struct fb_videomode previous_mode; | 176 | struct fb_videomode default_mode; |
177 | struct fb_videomode previous_non_vga_mode; | 177 | struct fb_videomode previous_non_vga_mode; |
178 | bool requesting_vga_for_initialization; | 178 | bool requesting_vga_for_initialization; |
179 | 179 | ||
@@ -1872,13 +1872,7 @@ static void mxc_hdmi_set_mode(struct mxc_hdmi *hdmi) | |||
1872 | 1872 | ||
1873 | /* Set the default mode only once. */ | 1873 | /* Set the default mode only once. */ |
1874 | if (!hdmi->dft_mode_set) { | 1874 | if (!hdmi->dft_mode_set) { |
1875 | dev_dbg(&hdmi->pdev->dev, "%s: setting to default=%s bpp=%d\n", | 1875 | fb_videomode_to_var(&var, &hdmi->default_mode); |
1876 | __func__, hdmi->dft_mode_str, hdmi->default_bpp); | ||
1877 | |||
1878 | fb_find_mode(&var, hdmi->fbi, | ||
1879 | hdmi->dft_mode_str, NULL, 0, NULL, | ||
1880 | hdmi->default_bpp); | ||
1881 | |||
1882 | hdmi->dft_mode_set = true; | 1876 | hdmi->dft_mode_set = true; |
1883 | } else | 1877 | } else |
1884 | fb_videomode_to_var(&var, &hdmi->previous_non_vga_mode); | 1878 | fb_videomode_to_var(&var, &hdmi->previous_non_vga_mode); |
@@ -2149,9 +2143,6 @@ static void mxc_hdmi_setup(struct mxc_hdmi *hdmi, unsigned long event) | |||
2149 | 2143 | ||
2150 | dev_dbg(&hdmi->pdev->dev, "%s - video mode changed\n", __func__); | 2144 | dev_dbg(&hdmi->pdev->dev, "%s - video mode changed\n", __func__); |
2151 | 2145 | ||
2152 | /* Save mode as 'previous_mode' so that we can know if mode changed. */ | ||
2153 | memcpy(&hdmi->previous_mode, &m, sizeof(struct fb_videomode)); | ||
2154 | |||
2155 | hdmi->vic = 0; | 2146 | hdmi->vic = 0; |
2156 | if (!hdmi->requesting_vga_for_initialization) { | 2147 | if (!hdmi->requesting_vga_for_initialization) { |
2157 | /* Save mode if this isn't the result of requesting | 2148 | /* Save mode if this isn't the result of requesting |
@@ -2162,6 +2153,8 @@ static void mxc_hdmi_setup(struct mxc_hdmi *hdmi, unsigned long event) | |||
2162 | edid_mode = fb_find_nearest_mode(&m, &hdmi->fbi->modelist); | 2153 | edid_mode = fb_find_nearest_mode(&m, &hdmi->fbi->modelist); |
2163 | pr_debug("edid mode "); | 2154 | pr_debug("edid mode "); |
2164 | dump_fb_videomode((struct fb_videomode *)edid_mode); | 2155 | dump_fb_videomode((struct fb_videomode *)edid_mode); |
2156 | /* update fbi mode */ | ||
2157 | hdmi->fbi->mode = (struct fb_videomode *)edid_mode; | ||
2165 | hdmi->vic = mxc_edid_mode_to_vic(edid_mode); | 2158 | hdmi->vic = mxc_edid_mode_to_vic(edid_mode); |
2166 | } | 2159 | } |
2167 | } | 2160 | } |
@@ -2470,8 +2463,6 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp, | |||
2470 | if (irq < 0) | 2463 | if (irq < 0) |
2471 | return -ENODEV; | 2464 | return -ENODEV; |
2472 | 2465 | ||
2473 | hdmi->dft_mode_set = false; | ||
2474 | |||
2475 | /* Setting HDMI default to blank state */ | 2466 | /* Setting HDMI default to blank state */ |
2476 | hdmi->blank = FB_BLANK_POWERDOWN; | 2467 | hdmi->blank = FB_BLANK_POWERDOWN; |
2477 | 2468 | ||
@@ -2570,6 +2561,10 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp, | |||
2570 | fb_var_to_videomode(&m, &hdmi->fbi->var); | 2561 | fb_var_to_videomode(&m, &hdmi->fbi->var); |
2571 | dump_fb_videomode(&m); | 2562 | dump_fb_videomode(&m); |
2572 | 2563 | ||
2564 | hdmi->dft_mode_set = false; | ||
2565 | /* Save default video mode */ | ||
2566 | memcpy(&hdmi->default_mode, &m, sizeof(struct fb_videomode)); | ||
2567 | |||
2573 | mode = fb_find_nearest_mode(&m, &hdmi->fbi->modelist); | 2568 | mode = fb_find_nearest_mode(&m, &hdmi->fbi->modelist); |
2574 | if (!mode) { | 2569 | if (!mode) { |
2575 | pr_err("%s: could not find mode in modelist\n", __func__); | 2570 | pr_err("%s: could not find mode in modelist\n", __func__); |
@@ -2578,6 +2573,9 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp, | |||
2578 | 2573 | ||
2579 | fb_videomode_to_var(&hdmi->fbi->var, mode); | 2574 | fb_videomode_to_var(&hdmi->fbi->var, mode); |
2580 | 2575 | ||
2576 | /* update fbi mode */ | ||
2577 | hdmi->fbi->mode = (struct fb_videomode *)mode; | ||
2578 | |||
2581 | /* Default setting HDMI working in HDMI mode*/ | 2579 | /* Default setting HDMI working in HDMI mode*/ |
2582 | hdmi->edid_cfg.hdmi_cap = true; | 2580 | hdmi->edid_cfg.hdmi_cap = true; |
2583 | 2581 | ||