Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754134AbbDTF1h (ORCPT ); Mon, 20 Apr 2015 01:27:37 -0400 Received: from mail-wg0-f51.google.com ([74.125.82.51]:33088 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753487AbbDTF1f (ORCPT ); Mon, 20 Apr 2015 01:27:35 -0400 From: Radek Dostal To: airlied@linux.ie Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Radek Dostal Subject: [PATCHv2] drm: fb_helper: prefer to use mode, which is not DRM_MODE_TYPE_USERDEF Date: Mon, 20 Apr 2015 07:26:33 +0200 Message-Id: <1429507593-21172-1-git-send-email-rd@radekdostal.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429477553-10294-1-git-send-email-rd@radekdostal.com> References: <1429477553-10294-1-git-send-email-rd@radekdostal.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2480 Lines: 73 commit eaf99c749d43 ("drm: Perform cmdline mode parsing during connector initialisation") breaks HDMI output on BeagleBone Black with LG TV (model 19LS4R-ZA) when "video=HDMI-A-1:1280x720@60" is specified on the command line. The reason is newly added mode '"1280x720" 60 74440 1280 1336 1472 1664 720 721 724 746 0x20 0x6' , which is added by function drm_helper_probe_add_cmdline_mode (introduced in above mentioned commit). This mode causes TV to go black and show "No signal" message. When cmdline_mode is set, it is preferred to use matching mode obtained from EDID, than mode calculated by function drm_mode_create_from_cmdline_mode Signed-off-by: Radek Dostal --- v2: fixed if (prefer_non_userdef) condition, which was causing infinite loop before. drivers/gpu/drm/drm_fb_helper.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index cac4229..fac425e 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1284,6 +1284,7 @@ struct drm_display_mode *drm_pick_cmdline_mode(struct drm_fb_helper_connector *f { struct drm_cmdline_mode *cmdline_mode; struct drm_display_mode *mode; + bool prefer_non_userdef; bool prefer_non_interlace; cmdline_mode = &fb_helper_conn->connector->cmdline_mode; @@ -1296,6 +1297,7 @@ struct drm_display_mode *drm_pick_cmdline_mode(struct drm_fb_helper_connector *f if (cmdline_mode->rb || cmdline_mode->margins) goto create_mode; + prefer_non_userdef = true; prefer_non_interlace = !cmdline_mode->interlace; again: list_for_each_entry(mode, &fb_helper_conn->connector->modes, head) { @@ -1312,6 +1314,9 @@ again: if (cmdline_mode->interlace) { if (!(mode->flags & DRM_MODE_FLAG_INTERLACE)) continue; + } else if (prefer_non_userdef) { + if (mode->type & DRM_MODE_TYPE_USERDEF) + continue; } else if (prefer_non_interlace) { if (mode->flags & DRM_MODE_FLAG_INTERLACE) continue; @@ -1319,6 +1324,11 @@ again: return mode; } + if (prefer_non_userdef) { + prefer_non_userdef = false; + goto again; + } + if (prefer_non_interlace) { prefer_non_interlace = false; goto again; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/