diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2017-08-15 07:20:11 -0400 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2017-12-04 06:04:11 -0500 |
commit | dd286a531461748ff1b1b3f1d7255389a131ed27 (patch) | |
tree | aadad0eaa17082f421e766d73819861133666214 | |
parent | cf05f74ef40ed608e554f635799e831995213215 (diff) |
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>
-rw-r--r-- | drivers/media/platform/vsp1/vsp1_drm.c | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c index 4dfbeac8f42c..7ce69f23f50a 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, | |||
84 | struct vsp1_drm_pipeline *drm_pipe; | 84 | struct vsp1_drm_pipeline *drm_pipe; |
85 | struct vsp1_pipeline *pipe; | 85 | struct vsp1_pipeline *pipe; |
86 | struct vsp1_bru *bru; | 86 | struct vsp1_bru *bru; |
87 | struct vsp1_entity *entity; | ||
88 | struct vsp1_entity *next; | ||
89 | struct vsp1_dl_list *dl; | ||
87 | struct v4l2_subdev_format format; | 90 | struct v4l2_subdev_format format; |
88 | const char *bru_name; | 91 | const char *bru_name; |
92 | unsigned long flags; | ||
89 | unsigned int i; | 93 | unsigned int i; |
90 | int ret; | 94 | int ret; |
91 | 95 | ||
@@ -250,6 +254,29 @@ int vsp1_du_setup_lif(struct device *dev, unsigned int pipe_index, | |||
250 | vsp1_write(vsp1, VI6_DISP_IRQ_STA, 0); | 254 | vsp1_write(vsp1, VI6_DISP_IRQ_STA, 0); |
251 | vsp1_write(vsp1, VI6_DISP_IRQ_ENB, 0); | 255 | vsp1_write(vsp1, VI6_DISP_IRQ_ENB, 0); |
252 | 256 | ||
257 | /* Configure all entities in the pipeline. */ | ||
258 | dl = vsp1_dl_list_get(pipe->output->dlm); | ||
259 | |||
260 | list_for_each_entry_safe(entity, next, &pipe->entities, list_pipe) { | ||
261 | vsp1_entity_route_setup(entity, pipe, dl); | ||
262 | |||
263 | if (entity->ops->configure) { | ||
264 | entity->ops->configure(entity, pipe, dl, | ||
265 | VSP1_ENTITY_PARAMS_INIT); | ||
266 | entity->ops->configure(entity, pipe, dl, | ||
267 | VSP1_ENTITY_PARAMS_RUNTIME); | ||
268 | entity->ops->configure(entity, pipe, dl, | ||
269 | VSP1_ENTITY_PARAMS_PARTITION); | ||
270 | } | ||
271 | } | ||
272 | |||
273 | vsp1_dl_list_commit(dl); | ||
274 | |||
275 | /* Start the pipeline. */ | ||
276 | spin_lock_irqsave(&pipe->irqlock, flags); | ||
277 | vsp1_pipeline_run(pipe); | ||
278 | spin_unlock_irqrestore(&pipe->irqlock, flags); | ||
279 | |||
253 | dev_dbg(vsp1->dev, "%s: pipeline enabled\n", __func__); | 280 | dev_dbg(vsp1->dev, "%s: pipeline enabled\n", __func__); |
254 | 281 | ||
255 | return 0; | 282 | return 0; |
@@ -488,7 +515,6 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index) | |||
488 | struct vsp1_entity *next; | 515 | struct vsp1_entity *next; |
489 | struct vsp1_dl_list *dl; | 516 | struct vsp1_dl_list *dl; |
490 | const char *bru_name; | 517 | const char *bru_name; |
491 | unsigned long flags; | ||
492 | unsigned int i; | 518 | unsigned int i; |
493 | int ret; | 519 | int ret; |
494 | 520 | ||
@@ -570,15 +596,6 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index) | |||
570 | } | 596 | } |
571 | 597 | ||
572 | vsp1_dl_list_commit(dl); | 598 | vsp1_dl_list_commit(dl); |
573 | |||
574 | /* Start or stop the pipeline if needed. */ | ||
575 | if (!drm_pipe->enabled && pipe->num_inputs) { | ||
576 | spin_lock_irqsave(&pipe->irqlock, flags); | ||
577 | vsp1_pipeline_run(pipe); | ||
578 | spin_unlock_irqrestore(&pipe->irqlock, flags); | ||
579 | } else if (drm_pipe->enabled && !pipe->num_inputs) { | ||
580 | vsp1_pipeline_stop(pipe); | ||
581 | } | ||
582 | } | 599 | } |
583 | EXPORT_SYMBOL_GPL(vsp1_du_atomic_flush); | 600 | EXPORT_SYMBOL_GPL(vsp1_du_atomic_flush); |
584 | 601 | ||