Commit 1ccbb32c authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab
Browse files

media: v4l: vsp1: Store pipeline pointer in vsp1_entity



Various types of objects subclassing vsp1_entity currently store a
pointer to the pipeline. Move the pointer to vsp1_entity to simplify the
code and avoid storing the pipeline in more entity subclasses later.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: default avatarKieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 7a781087
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ int vsp1_du_setup_lif(struct device *dev, unsigned int pipe_index,
			 * inputs.
			 */
			WARN_ON(list_empty(&rpf->entity.list_pipe));
			rpf->entity.pipe = NULL;
			list_del_init(&rpf->entity.list_pipe);
			pipe->inputs[i] = NULL;

@@ -536,8 +537,10 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index)
			continue;
		}

		if (list_empty(&rpf->entity.list_pipe))
		if (list_empty(&rpf->entity.list_pipe)) {
			rpf->entity.pipe = pipe;
			list_add_tail(&rpf->entity.list_pipe, &pipe->entities);
		}

		bru->inputs[i].rpf = rpf;
		rpf->bru_input = i;
@@ -562,6 +565,7 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned int pipe_index)
			vsp1_dl_list_write(dl, entity->route->reg,
					   VI6_DPR_NODE_UNUSED);

			entity->pipe = NULL;
			list_del_init(&entity->list_pipe);

			continue;
@@ -625,24 +629,28 @@ int vsp1_drm_init(struct vsp1_device *vsp1)

		vsp1_pipeline_init(pipe);

		pipe->frame_end = vsp1_du_pipeline_frame_end;

		/*
		 * The DRM pipeline is static, add entities manually. The first
		 * pipeline uses the BRU and the second pipeline the BRS.
		 */
		pipe->bru = i == 0 ? &vsp1->bru->entity : &vsp1->brs->entity;
		pipe->lif = &vsp1->lif[i]->entity;
		pipe->output = vsp1->wpf[i];
		pipe->output->pipe = pipe;
		pipe->frame_end = vsp1_du_pipeline_frame_end;
		pipe->lif = &vsp1->lif[i]->entity;

		pipe->bru->pipe = pipe;
		pipe->bru->sink = &pipe->output->entity;
		pipe->bru->sink_pad = 0;
		list_add_tail(&pipe->bru->list_pipe, &pipe->entities);

		pipe->output->entity.pipe = pipe;
		pipe->output->entity.sink = pipe->lif;
		pipe->output->entity.sink_pad = 0;
		list_add_tail(&pipe->output->entity.list_pipe, &pipe->entities);

		list_add_tail(&pipe->bru->list_pipe, &pipe->entities);
		pipe->lif->pipe = pipe;
		list_add_tail(&pipe->lif->list_pipe, &pipe->entities);
		list_add_tail(&pipe->output->entity.list_pipe, &pipe->entities);
	}

	/* Disable all RPFs initially. */
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ static irqreturn_t vsp1_irq_handler(int irq, void *data)
		vsp1_write(vsp1, VI6_WPF_IRQ_STA(i), ~status & mask);

		if (status & VI6_WFP_IRQ_STA_DFE) {
			vsp1_pipeline_frame_end(wpf->pipe);
			vsp1_pipeline_frame_end(wpf->entity.pipe);
			ret = IRQ_HANDLED;
		}
	}
+2 −0
Original line number Diff line number Diff line
@@ -106,6 +106,8 @@ struct vsp1_entity {
	unsigned int index;
	const struct vsp1_route *route;

	struct vsp1_pipeline *pipe;

	struct list_head list_dev;
	struct list_head list_pipe;

+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ void vsp1_histogram_buffer_complete(struct vsp1_histogram *histo,
				    struct vsp1_histogram_buffer *buf,
				    size_t size)
{
	struct vsp1_pipeline *pipe = histo->pipe;
	struct vsp1_pipeline *pipe = histo->entity.pipe;
	unsigned long flags;

	/*
+0 −3
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@
#include "vsp1_entity.h"

struct vsp1_device;
struct vsp1_pipeline;

#define HISTO_PAD_SINK				0
#define HISTO_PAD_SOURCE			1
@@ -37,8 +36,6 @@ struct vsp1_histogram_buffer {
};

struct vsp1_histogram {
	struct vsp1_pipeline *pipe;

	struct vsp1_entity entity;
	struct video_device video;
	struct media_pad pad;
Loading