blob: 3ba56b81c448ed493f4a9b3743294bf9c9dac75d [file] [log] [blame]
From c062161d4e59f646a0a5ca2ef38022fe89a693c8 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Date: Tue, 15 Aug 2017 14:20:11 +0300
Subject: [PATCH 0517/1795] v4l: vsp1: Start and stop DRM pipeline
independently of planes
The KMS API supports enabling a CRTC without any plane. To enable that
use case, we need to start the pipeline when configuring the LIF,
instead of when enabling the first plane.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Acked-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit dd286a531461748ff1b1b3f1d7255389a131ed27)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/media/platform/vsp1/vsp1_drm.c | 37 +++++++++++++++++++-------
1 file changed, 27 insertions(+), 10 deletions(-)
diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c
index d3cd57f6ba52..ac85942162c1 100644
--- a/drivers/media/platform/vsp1/vsp1_drm.c
+++ b/drivers/media/platform/vsp1/vsp1_drm.c
@@ -84,8 +84,12 @@ int vsp1_du_setup_lif(struct device *dev, unsigned int pipe_index,
struct vsp1_drm_pipeline *drm_pipe;
struct vsp1_pipeline *pipe;
struct vsp1_bru *bru;
+ struct vsp1_entity *entity;
+ struct vsp1_entity *next;
+ struct vsp1_dl_list *dl;
struct v4l2_subdev_format format;
const char *bru_name;
+ unsigned long flags;
unsigned int i;
int ret;
@@ -250,6 +254,29 @@ int vsp1_du_setup_lif(struct device *dev, unsigned int pipe_index,
vsp1_write(vsp1, VI6_DISP_IRQ_STA, 0);
vsp1_write(vsp1, VI6_DISP_IRQ_ENB, 0);
+ /* Configure all entities in the pipeline. */
+ dl = vsp1_dl_list_get(pipe->output->dlm);
+
+ list_for_each_entry_safe(entity, next, &pipe->entities, list_pipe) {
+ vsp1_entity_route_setup(entity, pipe, dl);
+
+ if (entity->ops->configure) {
+ entity->ops->configure(entity, pipe, dl,
+ VSP1_ENTITY_PARAMS_INIT);
+ entity->ops->configure(entity, pipe, dl,
+ VSP1_ENTITY_PARAMS_RUNTIME);
+ entity->ops->configure(entity, pipe, dl,
+ VSP1_ENTITY_PARAMS_PARTITION);
+ }
+ }
+
+ vsp1_dl_list_commit(dl);
+
+ /* Start the pipeline. */
+ spin_lock_irqsave(&pipe->irqlock, flags);
+ vsp1_pipeline_run(pipe);
+ spin_unlock_irqrestore(&pipe->irqlock, flags);
+
dev_dbg(vsp1->dev, "%s: pipeline enabled\n", __func__);
return 0;
@@ -488,7 +515,6 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index)
struct vsp1_entity *next;
struct vsp1_dl_list *dl;
const char *bru_name;
- unsigned long flags;
unsigned int i;
int ret;
@@ -579,15 +605,6 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index)
}
vsp1_dl_list_commit(dl);
-
- /* Start or stop the pipeline if needed. */
- if (!drm_pipe->enabled && pipe->num_inputs) {
- spin_lock_irqsave(&pipe->irqlock, flags);
- vsp1_pipeline_run(pipe);
- spin_unlock_irqrestore(&pipe->irqlock, flags);
- } else if (drm_pipe->enabled && !pipe->num_inputs) {
- vsp1_pipeline_stop(pipe);
- }
}
EXPORT_SYMBOL_GPL(vsp1_du_atomic_flush);
--
2.19.0