aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-06-08 08:59:31 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2018-09-03 09:13:30 -0400
commita730ce996ce4da09979bac884ddb62daf413b79e (patch)
tree62d7105bd0f1c3208ed2d51de5316bb2b23ae7ce
parent96fc64c775370b18bbf53732ad5130a6662cf1a2 (diff)
drm/omap: venc: Fixup video mode in .check_timings() operation
The VENC encoder modifies the requested video mode to match the NTSC or PAL timings (or reject the video mode completely) in the .set_timings() operation. This should be performed in the .check_timings() operation instead. Move the fixup. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/gpu/drm/omapdrm/dss/venc.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c
index 09ec8b0eafee..126efbf89898 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -452,7 +452,7 @@ static void venc_runtime_put(struct venc_device *venc)
452 WARN_ON(r < 0 && r != -ENOSYS); 452 WARN_ON(r < 0 && r != -ENOSYS);
453} 453}
454 454
455static const struct venc_config *venc_timings_to_config(struct videomode *vm) 455static const struct venc_config *venc_timings_to_config(const struct videomode *vm)
456{ 456{
457 switch (venc_get_videomode(vm)) { 457 switch (venc_get_videomode(vm)) {
458 default: 458 default:
@@ -582,28 +582,16 @@ static void venc_set_timings(struct omap_dss_device *dssdev,
582 const struct videomode *vm) 582 const struct videomode *vm)
583{ 583{
584 struct venc_device *venc = dssdev_to_venc(dssdev); 584 struct venc_device *venc = dssdev_to_venc(dssdev);
585 struct videomode actual_vm;
586 585
587 DSSDBG("venc_set_timings\n"); 586 DSSDBG("venc_set_timings\n");
588 587
589 mutex_lock(&venc->venc_lock); 588 mutex_lock(&venc->venc_lock);
590 589
591 switch (venc_get_videomode(vm)) {
592 default:
593 WARN_ON_ONCE(1);
594 case VENC_MODE_PAL:
595 actual_vm = omap_dss_pal_vm;
596 break;
597 case VENC_MODE_NTSC:
598 actual_vm = omap_dss_ntsc_vm;
599 break;
600 }
601
602 /* Reset WSS data when the TV standard changes. */ 590 /* Reset WSS data when the TV standard changes. */
603 if (memcmp(&venc->vm, &actual_vm, sizeof(actual_vm))) 591 if (memcmp(&venc->vm, vm, sizeof(*vm)))
604 venc->wss_data = 0; 592 venc->wss_data = 0;
605 593
606 venc->vm = actual_vm; 594 venc->vm = *vm;
607 595
608 dispc_set_tv_pclk(venc->dss->dispc, 13500000); 596 dispc_set_tv_pclk(venc->dss->dispc, 13500000);
609 597
@@ -617,8 +605,13 @@ static int venc_check_timings(struct omap_dss_device *dssdev,
617 605
618 switch (venc_get_videomode(vm)) { 606 switch (venc_get_videomode(vm)) {
619 case VENC_MODE_PAL: 607 case VENC_MODE_PAL:
608 *vm = omap_dss_pal_vm;
609 return 0;
610
620 case VENC_MODE_NTSC: 611 case VENC_MODE_NTSC:
612 *vm = omap_dss_ntsc_vm;
621 return 0; 613 return 0;
614
622 default: 615 default:
623 return -EINVAL; 616 return -EINVAL;
624 } 617 }