summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-01-10 02:11:14 +0400
committerAlejandro Mery <amery@geeks.cl>2013-01-14 14:36:05 +0400
commitf07b3f290ce4ba804990754663c3f3097972c2c1 (patch)
tree37662b3289eb77ebe1f1bcd71cb43ef5d2b2feb2
parentbc284ccd34c3073657f09e80909c7941a533486c (diff)
downloadlinux-sunxi-f07b3f290ce4ba804990754663c3f3097972c2c1.tar.xz
sunxi-hdmi: Don't overwrite the current timings when receiving new EDID
Besides that overwriting the current timings is just wrong, this also fixes a lot of "EDID mode used without valid EDID info" messages getting thrown and more nasty side effects when unplugging and replugging a monitor. What was happening is that the hdmi-edid code calls hdmi_edid_received, which updates the fb_dev mode-list, the fbdev core code responds to this by asking us what the current mode is, which ends up with a call to hdmi_get_video_timing(). which would fail in Hdmi_tv_mode_to_hdmi_mode because the Device_Support_VIC[HDMI_EDID] has been set to 0. After the fbdev core failed to get the current mode, it tries to set things to a new mode, which ends up doing a hdmi_get_video_timing() again (to save the current mode as a fallback in case the new mode fails), which fails, and things go downhill from there... This patches fixes all this by keeping the current timing info in place as *the* EDID mode when the current video_mode is HDMI_EDID. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--drivers/video/sunxi/hdmi/hdmi_edid.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/video/sunxi/hdmi/hdmi_edid.c b/drivers/video/sunxi/hdmi/hdmi_edid.c
index 5cee38399a48..68936c22511a 100644
--- a/drivers/video/sunxi/hdmi/hdmi_edid.c
+++ b/drivers/video/sunxi/hdmi/hdmi_edid.c
@@ -427,7 +427,14 @@ __s32 ParseEDID(void)
pr_info("ParseEDID\n");
- memset(Device_Support_VIC, 0, HDMI_DEVICE_SUPPORT_VIC_SIZE);
+ if (video_mode == HDMI_EDID) {
+ /* HDMI_DEVICE_SUPPORT_VIC_SIZE - 1 so as to not overwrite
+ the currently in use timings with a new preferred mode! */
+ memset(Device_Support_VIC, 0,
+ HDMI_DEVICE_SUPPORT_VIC_SIZE - 1);
+ } else {
+ memset(Device_Support_VIC, 0, HDMI_DEVICE_SUPPORT_VIC_SIZE);
+ }
memset(EDID_Buf, 0, sizeof(EDID_Buf));
DDC_Init();