aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandor Yu <R01008@freescale.com>2011-12-21 21:48:02 +0800
committerEric Miao <eric.miao@linaro.org>2012-01-11 21:39:36 +0800
commit2492cf1a2963900f46fbaba4e5e2df2146181d23 (patch)
tree15d6b72d92365741aa87bcea1fc905870ee471df
parent95dc3a0113076aaf7b0dd80568417903a3dec98f (diff)
downloadlinux-linaro-2492cf1a2963900f46fbaba4e5e2df2146181d23.tar.gz
ENGR00170800 mxc hdmi add more video mode to default modelist
Add all non-interlaced CEA mode to default modelist Add XGA and SXGA video mode to default modelist Signed-off-by: Sandor Yu <R01008@freescale.com>
-rw-r--r--drivers/video/mxc_hdmi.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/drivers/video/mxc_hdmi.c b/drivers/video/mxc_hdmi.c
index 7e3c8af7838..97547a90adc 100644
--- a/drivers/video/mxc_hdmi.c
+++ b/drivers/video/mxc_hdmi.c
@@ -96,6 +96,19 @@ static const struct fb_videomode vga_mode = {
FB_VMODE_NONINTERLACED | FB_VMODE_ASPECT_4_3, 0,
};
+static const struct fb_videomode xga_mode = {
+ /* 13 1024x768-60 VESA */
+ NULL, 60, 1024, 768, 15384, 160, 24, 29, 3, 136, 6,
+ 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA
+};
+
+static const struct fb_videomode sxga_mode = {
+ /* 20 1280x1024-60 VESA */
+ NULL, 60, 1280, 1024, 9259, 248, 48, 38, 1, 112, 3,
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA
+};
+
enum hdmi_datamap {
RGB444_8B = 0x01,
RGB444_10B = 0x03,
@@ -1553,11 +1566,13 @@ static void mxc_hdmi_default_modelist(struct mxc_hdmi *hdmi)
{
u32 i;
const struct fb_videomode *mode;
+ struct fb_videomode m;
dev_dbg(&hdmi->pdev->dev, "%s\n", __func__);
/* If not EDID data read, set up default modelist */
dev_info(&hdmi->pdev->dev, "No modes read from edid\n");
+ dev_info(&hdmi->pdev->dev, "create default modelist\n");
/* Set the default mode only once. */
if (!hdmi->dft_mode_set) {
@@ -1577,17 +1592,30 @@ static void mxc_hdmi_default_modelist(struct mxc_hdmi *hdmi)
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->xres == hdmi->fbi->var.xres) &&
- (mode->yres == hdmi->fbi->var.yres) &&
- !(mode->vmode & FB_VMODE_INTERLACED))
+ 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();
- mxc_hdmi_notify_fb(hdmi);
+ fb_var_to_videomode(&m, &hdmi->fbi->var);
+ dump_fb_videomode(&m);
+ mode = fb_find_nearest_mode(&m, &hdmi->fbi->modelist);
+ if (mode) {
+ fb_videomode_to_var(&hdmi->fbi->var, mode);
+ dump_fb_videomode((struct fb_videomode *)mode);
+ dev_warn(&hdmi->pdev->dev,
+ "Default modelist,the video mode may not support by monitor.\n");
+ mxc_hdmi_notify_fb(hdmi);
+ } else
+ pr_err("%s: could not find mode in default modelist\n", __func__);
}
static void mxc_hdmi_set_mode_to_vga_dvi(struct mxc_hdmi *hdmi)