aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/dss
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-09-12 17:39:01 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2019-03-18 05:42:12 -0400
commit40e5f937d50fce297db3ee5c75e30bf4e1518f3b (patch)
treec144d91a73191aef9f68ee7d3d18cc1640546211 /drivers/gpu/drm/omapdrm/dss
parent46b3847d7f680d51a29384a5ee9e1d54e6739f5d (diff)
drm/omap: venc: List both PAL and NTSC modes
The TV encoder supports both PAL and NTSC modes, but when queried for the list of modes it supports, only the currently selected mode is reported. Fix it and report the two modes unconditionally. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/venc.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c
index f1abb4195a76..638cfd69ccf6 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -551,14 +551,27 @@ static void venc_display_disable(struct omap_dss_device *dssdev)
551static int venc_get_modes(struct omap_dss_device *dssdev, 551static int venc_get_modes(struct omap_dss_device *dssdev,
552 struct drm_connector *connector) 552 struct drm_connector *connector)
553{ 553{
554 struct venc_device *venc = dssdev_to_venc(dssdev); 554 static const struct videomode *modes[] = {
555 int r; 555 &omap_dss_pal_vm,
556 &omap_dss_ntsc_vm,
557 };
558 unsigned int i;
556 559
557 mutex_lock(&venc->venc_lock); 560 for (i = 0; i < ARRAY_SIZE(modes); ++i) {
558 r = omapdss_display_get_modes(connector, &venc->vm); 561 struct drm_display_mode *mode;
559 mutex_unlock(&venc->venc_lock);
560 562
561 return r; 563 mode = drm_mode_create(connector->dev);
564 if (!mode)
565 return i;
566
567 drm_display_mode_from_videomode(modes[i], mode);
568
569 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
570 drm_mode_set_name(mode);
571 drm_mode_probed_add(connector, mode);
572 }
573
574 return ARRAY_SIZE(modes);
562} 575}
563 576
564static void venc_set_timings(struct omap_dss_device *dssdev, 577static void venc_set_timings(struct omap_dss_device *dssdev,