summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/panel
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@free-electrons.com>2016-04-15 18:23:33 +0200
committerThierry Reding <treding@nvidia.com>2016-05-12 11:32:14 +0200
commitcda553725c92b9f908f6f69e9bc05de81384d817 (patch)
treea35ed614be92e6b02d51d97bbb4bbc29374ab44a /drivers/gpu/drm/panel
parentdrm/panel: simple: Add timings for the Olimex LCD-OLinuXino-4.3TS (diff)
downloadlinux-cda553725c92b9f908f6f69e9bc05de81384d817.tar.xz
linux-cda553725c92b9f908f6f69e9bc05de81384d817.zip
drm/panel: simple: Set appropriate mode type
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 command line. In some cases the user provided mode will be preferred over the simple panel ones, which might result in unpredictable behavior. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Reviewed-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com> [treding@nvidia.com: reshuffle some code for consistency] Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/panel')
-rw-r--r--drivers/gpu/drm/panel/panel-simple.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 847abee5ea36..a6d8a5dda424 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -117,6 +117,12 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
}
drm_display_mode_from_videomode(&vm, mode);
+
+ 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);
@@ -133,6 +139,11 @@ 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);