From: Zheng Yang Date: Thu, 21 May 2015 02:26:34 +0000 (+0800) Subject: HDMI: just list common format when edid is not valid. X-Git-Tag: firefly_0821_release~4143 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=48c8c2e11ac8ece705f89636dc85751cb663b4cf;p=firefly-linux-kernel-4.4.55.git HDMI: just list common format when edid is not valid. If EDID is not valid, list following common format: 1920x1080p-60 1920x1080p-50 1280x720p-60 1280x720p-50 720px576p-50 720px480p-60 Signed-off-by: Zheng Yang --- diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmi-lcdc.c b/drivers/video/rockchip/hdmi/rockchip-hdmi-lcdc.c index d737a852ae13..25f938f0c4b0 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmi-lcdc.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmi-lcdc.c @@ -528,7 +528,7 @@ int hdmi_ouputmode_select(struct hdmi *hdmi, int edid_ok) struct list_head *head = &hdmi->edid.modelist; struct fb_monspecs *specs = hdmi->edid.specs; struct fb_videomode *modedb = NULL, *mode = NULL; - int i, pixclock; + int i, pixclock, feature = hdmi->property->feature; if (edid_ok != HDMI_ERROR_SUCESS) { dev_err(hdmi->dev, "warning: EDID error, assume sink as HDMI !!!!"); @@ -580,12 +580,30 @@ int hdmi_ouputmode_select(struct hdmi *hdmi, int edid_ok) (mode->yres > modedb->yres)) continue; } else { - if (!(hdmi->property->feature & SUPPORT_4K) && - mode->xres >= 3840) - continue; - else if (mode->pixclock > 340000000) + /* If there is no valid information in EDID, + just list common hdmi foramt. */ + if (mode->xres > 3840 || + mode->refresh < 50 || + mode->vmode == FB_VMODE_INTERLACED) continue; } + if ((feature & SUPPORT_TMDS_600M) == 0 && + mode->pixclock > 340000000) + continue; + if ((feature & SUPPORT_4K) == 0 && + mode->xres >= 3840) + continue; + if ((feature & SUPPORT_4K_4096) == 0 && + mode->xres == 4096) + continue; + if ((feature & SUPPORT_1080I) == 0 && + mode->xres == 1920 && + mode->vmode == FB_VMODE_INTERLACED) + continue; + if ((feature & SUPPORT_480I_576I) == 0 && + mode->xres == 720 && + mode->vmode == FB_VMODE_INTERLACED) + continue; hdmi_add_videomode(mode, head); } } else {