All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: fb_helper: prefer to use mode, which is not DRM_MODE_TYPE_USERDEF
@ 2015-04-19 21:05 Radek Dostal
  2015-04-20  5:26 ` [PATCHv2] " Radek Dostal
  0 siblings, 1 reply; 54+ messages in thread
From: Radek Dostal @ 2015-04-19 21:05 UTC (permalink / raw)
  To: airlied; +Cc: dri-devel, linux-kernel, Radek Dostal

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 <rd@radekdostal.com>
---
 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..72d6ed0 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 = true;
+		goto again;
+	}
+
 	if (prefer_non_interlace) {
 		prefer_non_interlace = false;
 		goto again;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2016-06-02 13:12 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-19 21:05 [PATCH] drm: fb_helper: prefer to use mode, which is not DRM_MODE_TYPE_USERDEF Radek Dostal
2015-04-20  5:26 ` [PATCHv2] " Radek Dostal
2015-04-20  9:09   ` Chris Wilson
2015-04-20  9:09     ` Chris Wilson
2015-04-20  9:36     ` Radek Dostál
2015-04-20  9:46       ` Chris Wilson
2015-04-20  9:58         ` Chris Wilson
2015-04-20  9:58           ` Chris Wilson
2015-04-20 10:38           ` Radek Dostál
2015-04-20 10:48             ` Chris Wilson
2015-04-20 10:48               ` Chris Wilson
2015-04-20 10:57               ` Radek Dostál
2015-04-20 11:00                 ` Chris Wilson
2015-04-20 11:20                   ` Radek Dostál
2015-04-20 11:44                     ` Chris Wilson
2015-04-20 12:00                       ` Radek Dostál
2015-04-20 12:26   ` [PATCH] drm: Only create a cmdline mode if no probed modes match Chris Wilson
2015-04-20 13:06     ` Radek Dostál
2015-04-20 13:16       ` Chris Wilson
2015-04-20 13:28       ` [PATCH v2] " Chris Wilson
2015-04-20 13:41         ` Radek Dostál
2015-05-21 15:36           ` Chris Wilson
2015-05-21 15:36             ` Chris Wilson
2015-05-22  6:22         ` Jani Nikula
2015-05-22  6:22           ` Jani Nikula
2015-05-22  9:03         ` Ville Syrjälä
2015-05-22  9:03           ` Ville Syrjälä
2015-05-22  9:54           ` Chris Wilson
2015-05-22  9:54             ` Chris Wilson
2015-05-22 11:30             ` Ville Syrjälä
2015-05-22 11:30               ` Ville Syrjälä
2016-06-01  9:34     ` [PATCH v3] " Chris Wilson
2016-06-01  9:34       ` Chris Wilson
2016-06-01  9:43       ` Ville Syrjälä
2016-06-01  9:43         ` Ville Syrjälä
2016-06-01  9:46         ` Chris Wilson
2016-06-01  9:46           ` Chris Wilson
2016-06-01  9:47         ` Chris Wilson
2016-06-01  9:47           ` Chris Wilson
2016-06-01  9:56           ` Ville Syrjälä
2016-06-01  9:56             ` Ville Syrjälä
2016-06-01  9:50         ` [PATCH v4] " Chris Wilson
2016-06-01  9:50           ` Chris Wilson
2016-06-01 13:19           ` Alex Deucher
2016-06-01 13:19             ` Alex Deucher
2016-06-02  9:38           ` Radek Dostál
2016-06-02 10:52             ` Chris Wilson
2016-06-02 10:52               ` Chris Wilson
2016-06-02 11:30               ` Ville Syrjälä
2016-06-02 11:30                 ` Ville Syrjälä
2016-06-02 11:35                 ` Radek Dostál
2016-06-02 11:35                   ` Radek Dostál
2016-06-02 13:12                 ` Daniel Vetter
2016-06-02 13:12                   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.