Commit 8c1ac08b authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Paul Mundt

fbdev: sh-mobile: retrieve and propagate display sizes from EDID

Monitor EDID contains information about physical display sizes. Retrieve
it and propagate to the framebuffer driver.
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent e0b9fb26
...@@ -787,6 +787,9 @@ static int sh_hdmi_read_edid(struct sh_hdmi *hdmi) ...@@ -787,6 +787,9 @@ static int sh_hdmi_read_edid(struct sh_hdmi *hdmi)
found_rate_error = rate_error; found_rate_error = rate_error;
} }
hdmi->var.width = hdmi->monspec.max_x * 10;
hdmi->var.height = hdmi->monspec.max_y * 10;
/* /*
* TODO 1: if no ->info is present, postpone running the config until * TODO 1: if no ->info is present, postpone running the config until
* after ->info first gets registered. * after ->info first gets registered.
...@@ -960,8 +963,12 @@ static bool sh_hdmi_must_reconfigure(struct sh_hdmi *hdmi) ...@@ -960,8 +963,12 @@ static bool sh_hdmi_must_reconfigure(struct sh_hdmi *hdmi)
dev_dbg(info->dev, "Old %ux%u, new %ux%u\n", dev_dbg(info->dev, "Old %ux%u, new %ux%u\n",
mode1.xres, mode1.yres, mode2.xres, mode2.yres); mode1.xres, mode1.yres, mode2.xres, mode2.yres);
if (fb_mode_is_equal(&mode1, &mode2)) if (fb_mode_is_equal(&mode1, &mode2)) {
/* It can be a different monitor with an equal video-mode */
old_var->width = new_var->width;
old_var->height = new_var->height;
return false; return false;
}
dev_dbg(info->dev, "Switching %u -> %u lines\n", dev_dbg(info->dev, "Switching %u -> %u lines\n",
mode1.yres, mode2.yres); mode1.yres, mode2.yres);
...@@ -1057,8 +1064,11 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) ...@@ -1057,8 +1064,11 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
* on, if we run a resume here, the logo disappears * on, if we run a resume here, the logo disappears
*/ */
if (lock_fb_info(hdmi->info)) { if (lock_fb_info(hdmi->info)) {
sh_hdmi_display_on(hdmi, hdmi->info); struct fb_info *info = hdmi->info;
unlock_fb_info(hdmi->info); info->var.width = hdmi->var.width;
info->var.height = hdmi->var.height;
sh_hdmi_display_on(hdmi, info);
unlock_fb_info(info);
} }
} else { } else {
/* New monitor or have to wake up */ /* New monitor or have to wake up */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment