Commit 72b60335 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab
Browse files

media: mc: entity: Add media_entity_pipeline() to access the media pipeline



Replace direct access to the pipe field in drivers with a new helper
function. This will allow easier refactoring of media pipeline handling
in the MC core behind the scenes without affecting drivers.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 612589a3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -994,6 +994,12 @@ int media_entity_get_fwnode_pad(struct media_entity *entity,
}
EXPORT_SYMBOL_GPL(media_entity_get_fwnode_pad);

struct media_pipeline *media_entity_pipeline(struct media_entity *entity)
{
	return entity->pipe;
}
EXPORT_SYMBOL_GPL(media_entity_pipeline);

static void media_interface_init(struct media_device *mdev,
				 struct media_interface *intf,
				 u32 gobj_type,
+2 −3
Original line number Diff line number Diff line
@@ -786,9 +786,8 @@ static int rvin_csi2_link_notify(struct media_link *link, u32 flags,
		return 0;

	/*
	 * Don't allow link changes if any entity in the graph is
	 * streaming, modifying the CHSEL register fields can disrupt
	 * running streams.
	 * Don't allow link changes if any stream in the graph is active as
	 * modifying the CHSEL register fields can disrupt running streams.
	 */
	media_device_for_each_entity(entity, &group->mdev)
		if (media_entity_is_streaming(entity))
+1 −1
Original line number Diff line number Diff line
@@ -1281,7 +1281,7 @@ static int rvin_set_stream(struct rvin_dev *vin, int on)
	 */
	mdev = vin->vdev.entity.graph_obj.mdev;
	mutex_lock(&mdev->graph_mutex);
	pipe = sd->entity.pipe ? sd->entity.pipe : &vin->vdev.pipe;
	pipe = media_entity_pipeline(&sd->entity) ? : &vin->vdev.pipe;
	ret = __media_pipeline_start(&vin->vdev.entity, pipe);
	mutex_unlock(&mdev->graph_mutex);
	if (ret)
+1 −3
Original line number Diff line number Diff line
@@ -937,10 +937,8 @@ static int isp_pipeline_is_last(struct media_entity *me)
	struct isp_pipeline *pipe;
	struct media_pad *pad;

	if (!me->pipe)
		return 0;
	pipe = to_isp_pipeline(me);
	if (pipe->stream_state == ISP_PIPELINE_STREAM_STOPPED)
	if (!pipe || pipe->stream_state == ISP_PIPELINE_STREAM_STOPPED)
		return 0;
	pad = media_pad_remote_pad_first(&pipe->output->pad);
	return pad->entity == me;
+1 −2
Original line number Diff line number Diff line
@@ -1093,8 +1093,7 @@ isp_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
	/* Start streaming on the pipeline. No link touching an entity in the
	 * pipeline can be activated or deactivated once streaming is started.
	 */
	pipe = video->video.entity.pipe
	     ? to_isp_pipeline(&video->video.entity) : &video->pipe;
	pipe = to_isp_pipeline(&video->video.entity) ? : &video->pipe;

	ret = media_entity_enum_init(&pipe->ent_enum, &video->isp->media_dev);
	if (ret)
Loading