public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: panel: simple-panel: set appropriate mode type
@ 2015-04-30 14:39 Boris Brezillon
  2015-04-30 14:46 ` Nicolas Ferre
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Boris Brezillon @ 2015-04-30 14:39 UTC (permalink / raw)
  To: Thierry Reding, dri-devel
  Cc: David Airlie, Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Alexandre Belloni, linux-kernel, Boris Brezillon

All modes exposed by simple panels should be tagged as driver defined
modes.
Moreover, if a panel supports only one mode, this mode is obviously the
preferred one.

Doing this also fix a problem occurring when a 'video=' parameter is passed
on the kernel cmdline. In some cases the user provided mode is preferred
over the simple panel ones, which might result in unpredictable behavior.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
---
 drivers/gpu/drm/panel/panel-simple.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index d14b904..95ae390 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -111,6 +111,10 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
 			continue;
 		}
 
+		mode->type |= DRM_MODE_TYPE_DRIVER;
+		if (panel->desc->num_modes == 1)
+			mode->type |= DRM_MODE_TYPE_PREFERRED;
+
 		drm_display_mode_from_videomode(&vm, mode);
 
 		drm_mode_probed_add(connector, mode);
@@ -127,6 +131,10 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
 			continue;
 		}
 
+		mode->type |= DRM_MODE_TYPE_DRIVER;
+		if (panel->desc->num_modes == 1)
+			mode->type |= DRM_MODE_TYPE_PREFERRED;
+
 		drm_mode_set_name(mode);
 
 		drm_mode_probed_add(connector, mode);
-- 
1.9.1


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

end of thread, other threads:[~2016-04-18  7:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-30 14:39 [PATCH] drm: panel: simple-panel: set appropriate mode type Boris Brezillon
2015-04-30 14:46 ` Nicolas Ferre
2015-05-28 14:25 ` Boris Brezillon
2016-04-15 16:04   ` Nicolas Ferre
2016-04-15 16:23 ` [RESEND PATCH] drm/panel: " Nicolas Ferre
2016-04-18  7:05   ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox