diff options
author | Robert Chiras <robert.chiras@nxp.com> | 2017-05-11 14:34:01 +0300 |
---|---|---|
committer | Anson Huang <Anson.Huang@nxp.com> | 2017-06-09 22:22:36 +0800 |
commit | 6221d7c336ee95ddec5ca014ce1e46d4630c5c1a (patch) | |
tree | eb32908bf616bc12eedfcb8f24d2d451a69ed16a /drivers/video/fbdev/mxc | |
parent | fb791d02a33e2fe143bd05a493583c9db5c6f9eb (diff) |
MLK-14857: mxc_hdmi: Set default mode a CEA mode
When using fb_find_mode from fbdev/core with a specified user more,
it will return a screeninfo structure with the pixclock corresponding to
a different refresh rate than the requested one. For example, for
1920x1080@60 it will return pixclock=5780. When we get the videmode for
this screeninfo, it will have a refresh of 59Hz, instead of 60Hz.
If we use this mode as default mode when EDID cannot be read, on a
monitor with fixed refresh rate of 60Hz, it won't work. Therefore, we
should save the default mode, the nearest mode from CEA modes defined by
our own driver (which will have the correct refresh rate and pixclock for
the requested resolution).
Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Diffstat (limited to 'drivers/video/fbdev/mxc')
-rw-r--r-- | drivers/video/fbdev/mxc/mxc_hdmi.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/video/fbdev/mxc/mxc_hdmi.c b/drivers/video/fbdev/mxc/mxc_hdmi.c index 467fe63c35db..ebec8d2dd8b8 100644 --- a/drivers/video/fbdev/mxc/mxc_hdmi.c +++ b/drivers/video/fbdev/mxc/mxc_hdmi.c @@ -222,7 +222,7 @@ static inline int cpu_is_imx6dl(struct mxc_hdmi *hdmi) return hdmi->cpu_type == IMX6DL_HDMI; } #ifdef DEBUG -static void dump_fb_videomode(struct fb_videomode *m) +static void dump_fb_videomode(const struct fb_videomode *m) { pr_debug("fb_videomode = %d %d %d %d %d %d %d %d %d %d %d %d %d\n", m->refresh, m->xres, m->yres, m->pixclock, m->left_margin, @@ -230,7 +230,7 @@ static void dump_fb_videomode(struct fb_videomode *m) m->hsync_len, m->vsync_len, m->sync, m->vmode, m->flag); } #else -static void dump_fb_videomode(struct fb_videomode *m) +static void dump_fb_videomode(const struct fb_videomode *m) {} #endif @@ -2598,17 +2598,16 @@ static int mxc_hdmi_disp_init(struct mxc_dispdrv_handle *disp, /* Find a nearest mode in default modelist */ 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__); return -1; } + dump_fb_videomode(mode); + /* Save default video mode */ + memcpy(&hdmi->default_mode, mode, sizeof(struct fb_videomode)); fb_videomode_to_var(&hdmi->fbi->var, mode); |