All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v8 32/55] [media] media: use macros to check for V4L2 subdev entities
Date: Mon, 12 Oct 2015 16:00:13 +0000	[thread overview]
Message-ID: <20151012130013.5b7dcbb0@recife.lan> (raw)
In-Reply-To: <20151012153504.GL26916@valkosipuli.retiisi.org.uk>

Em Mon, 12 Oct 2015 18:35:05 +0300
Sakari Ailus <sakari.ailus@iki.fi> escreveu:

> Hi Mauro,
> 
> On Sun, Oct 11, 2015 at 09:56:25PM -0300, Mauro Carvalho Chehab wrote:
> > Em Mon, 12 Oct 2015 00:07:52 +0300
> > Sakari Ailus <sakari.ailus@iki.fi> escreveu:
> > 
> > > Hi Mauro,
> > > 
> > > On Sun, Aug 30, 2015 at 12:06:43AM -0300, Mauro Carvalho Chehab wrote:
> > > > Instead of relying on media subtype, use the new macros to detect
> > > > if an entity is a subdev or an A/V DMA entity.
> > > > 
> > > > Please note that most drivers assume that there's just AV_DMA or
> > > > V4L2 subdevs. This is not true anymore, as we've added MC support
> > > > for DVB, and there are plans to add support for ALSA and FB/DRM
> > > > too.
> > > > 
> > > > Ok, on the current pipelines supported by those drivers, just V4L
> > > > stuff are there, but, assuming that some day a pipeline that also
> > > > works with other subsystems will ever added, it is better to add
> > > > explicit checks for the AV_DMA stuff.
> > > > 
> > > > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> > > > 
> > > > diff --git a/drivers/media/platform/exynos4-is/common.c b/drivers/media/platform/exynos4-is/common.c
> > > > index 0eb34ecb8ee4..8c9a29e0e294 100644
> > > > --- a/drivers/media/platform/exynos4-is/common.c
> > > > +++ b/drivers/media/platform/exynos4-is/common.c
> > > > @@ -22,8 +22,7 @@ struct v4l2_subdev *fimc_find_remote_sensor(struct media_entity *entity)
> > > >  	while (pad->flags & MEDIA_PAD_FL_SINK) {
> > > >  		/* source pad */
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad = NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > > diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c
> > > > index 0627a93b2f3b..e9810fee4c30 100644
> > > > --- a/drivers/media/platform/exynos4-is/fimc-capture.c
> > > > +++ b/drivers/media/platform/exynos4-is/fimc-capture.c
> > > > @@ -1141,8 +1141,7 @@ static int fimc_pipeline_validate(struct fimc_dev *fimc)
> > > >  			}
> > > >  		}
> > > >  
> > > > -		if (src_pad = NULL ||
> > > > -		    media_entity_type(src_pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!src_pad || !is_media_entity_v4l2_subdev(src_pad->entity))
> > > >  			break;
> > > >  
> > > >  		/* Don't call FIMC subdev operation to avoid nested locking */
> > > > @@ -1397,7 +1396,7 @@ static int fimc_link_setup(struct media_entity *entity,
> > > >  	struct fimc_vid_cap *vc = &fimc->vid_cap;
> > > >  	struct v4l2_subdev *sensor;
> > > >  
> > > > -	if (media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return -EINVAL;
> > > >  
> > > >  	if (WARN_ON(fimc = NULL))
> > > > diff --git a/drivers/media/platform/exynos4-is/fimc-isp-video.c b/drivers/media/platform/exynos4-is/fimc-isp-video.c
> > > > index 3d9ccbf5f10f..5fbaf5e39903 100644
> > > > --- a/drivers/media/platform/exynos4-is/fimc-isp-video.c
> > > > +++ b/drivers/media/platform/exynos4-is/fimc-isp-video.c
> > > > @@ -467,8 +467,7 @@ static int isp_video_pipeline_validate(struct fimc_isp *isp)
> > > >  
> > > >  		/* Retrieve format at the source pad */
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad = NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > > diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
> > > > index b2607da4ad14..c2327147b360 100644
> > > > --- a/drivers/media/platform/exynos4-is/fimc-lite.c
> > > > +++ b/drivers/media/platform/exynos4-is/fimc-lite.c
> > > > @@ -814,8 +814,7 @@ static int fimc_pipeline_validate(struct fimc_lite *fimc)
> > > >  		}
> > > >  		/* Retrieve format at the source pad */
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad = NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > > @@ -988,7 +987,6 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  {
> > > >  	struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity);
> > > >  	struct fimc_lite *fimc = v4l2_get_subdevdata(sd);
> > > > -	unsigned int remote_ent_type = media_entity_type(remote->entity);
> > > >  	int ret = 0;
> > > >  
> > > >  	if (WARN_ON(fimc = NULL))
> > > > @@ -1000,7 +998,7 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  
> > > >  	switch (local->index) {
> > > >  	case FLITE_SD_PAD_SINK:
> > > > -		if (remote_ent_type != MEDIA_ENT_T_V4L2_SUBDEV) {
> > > > +		if (!is_media_entity_v4l2_subdev(remote->entity)) {
> > > >  			ret = -EINVAL;
> > > >  			break;
> > > >  		}
> > > > @@ -1018,7 +1016,7 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  	case FLITE_SD_PAD_SOURCE_DMA:
> > > >  		if (!(flags & MEDIA_LNK_FL_ENABLED))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_NONE);
> > > > -		else if (remote_ent_type = MEDIA_ENT_T_DEVNODE)
> > > > +		else if (is_media_entity_v4l2_io(remote->entity))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_DMA);
> > > >  		else
> > > >  			ret = -EINVAL;
> > > > @@ -1027,7 +1025,7 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  	case FLITE_SD_PAD_SOURCE_ISP:
> > > >  		if (!(flags & MEDIA_LNK_FL_ENABLED))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_NONE);
> > > > -		else if (remote_ent_type = MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		else if (is_media_entity_v4l2_subdev(remote->entity))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_ISP);
> > > >  		else
> > > >  			ret = -EINVAL;
> > > > diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c
> > > > index 92dbade2fffc..4a25df9dd869 100644
> > > > --- a/drivers/media/platform/exynos4-is/media-dev.c
> > > > +++ b/drivers/media/platform/exynos4-is/media-dev.c
> > > > @@ -88,8 +88,7 @@ static void fimc_pipeline_prepare(struct fimc_pipeline *p,
> > > >  				break;
> > > >  		}
> > > >  
> > > > -		if (pad = NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > >  
> > > > @@ -1062,7 +1061,7 @@ static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity))
> > > >  			continue;
> > > >  
> > > >  		ret  = __fimc_md_modify_pipeline(entity, enable);
> > > > @@ -1076,7 +1075,7 @@ static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable)
> > > >  	media_entity_graph_walk_start(&graph, entity_err);
> > > >  
> > > >  	while ((entity_err = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity_err) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity_err))
> > > >  			continue;
> > > >  
> > > >  		__fimc_md_modify_pipeline(entity_err, !enable);
> > > > diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
> > > > index 69e7733d36cd..cb8ac90086c1 100644
> > > > --- a/drivers/media/platform/omap3isp/isp.c
> > > > +++ b/drivers/media/platform/omap3isp/isp.c
> > > > @@ -691,7 +691,7 @@ static int isp_pipeline_pm_use_count(struct media_entity *entity)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity) = MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_io(entity))
> > > >  			use += entity->use_count;
> > > >  	}
> > > >  
> > > > @@ -714,7 +714,7 @@ static int isp_pipeline_pm_power_one(struct media_entity *entity, int change)
> > > >  	struct v4l2_subdev *subdev;
> > > >  	int ret;
> > > >  
> > > > -	subdev = media_entity_type(entity) = MEDIA_ENT_T_V4L2_SUBDEV
> > > > +	subdev = is_media_entity_v4l2_subdev(entity)
> > > >  	       ? media_entity_to_v4l2_subdev(entity) : NULL;
> > > >  
> > > >  	if (entity->use_count = 0 && change > 0 && subdev != NULL) {
> > > > @@ -754,7 +754,7 @@ static int isp_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while (!ret && (entity = media_entity_graph_walk_next(&graph)))
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(entity))
> > > >  			ret = isp_pipeline_pm_power_one(entity, change);
> > > >  
> > > >  	if (!ret)
> > > > @@ -764,7 +764,7 @@ static int isp_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  
> > > >  	while ((first = media_entity_graph_walk_next(&graph))
> > > >  	       && first != entity)
> > > > -		if (media_entity_type(first) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(first))
> > > >  			isp_pipeline_pm_power_one(first, -change);
> > > >  
> > > >  	return ret;
> > > > @@ -897,8 +897,7 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe,
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad = NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > @@ -988,8 +987,7 @@ static int isp_pipeline_disable(struct isp_pipeline *pipe)
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad = NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
> > > > index 4c367352b1f7..52843ac2a9ca 100644
> > > > --- a/drivers/media/platform/omap3isp/ispvideo.c
> > > > +++ b/drivers/media/platform/omap3isp/ispvideo.c
> > > > @@ -210,8 +210,7 @@ isp_video_remote_subdev(struct isp_video *video, u32 *pad)
> > > >  
> > > >  	remote = media_entity_remote_pad(&video->pad);
> > > >  
> > > > -	if (remote = NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -243,7 +242,7 @@ static int isp_video_get_graph_data(struct isp_video *video,
> > > >  		if (entity = &video->video.entity)
> > > >  			continue;
> > > >  
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity))
> > > >  			continue;
> > > >  
> > > >  		__video = to_isp_video(media_entity_to_video_device(entity));
> > > > @@ -917,7 +916,7 @@ static int isp_video_check_external_subdevs(struct isp_video *video,
> > > >  		return -EINVAL;
> > > >  	}
> > > >  
> > > > -	if (media_entity_type(source) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!is_media_entity_v4l2_subdev(source))
> > > >  		return 0;
> > > >  
> > > >  	pipe->external = media_entity_to_v4l2_subdev(source);
> > > > diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c
> > > > index eae667eab1b9..fb5b016cc0a1 100644
> > > > --- a/drivers/media/platform/s3c-camif/camif-capture.c
> > > > +++ b/drivers/media/platform/s3c-camif/camif-capture.c
> > > > @@ -837,7 +837,7 @@ static int camif_pipeline_validate(struct camif_dev *camif)
> > > >  
> > > >  	/* Retrieve format at the sensor subdev source pad */
> > > >  	pad = media_entity_remote_pad(&camif->pads[0]);
> > > > -	if (!pad || media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  		return -EPIPE;
> > > >  
> > > >  	src_fmt.pad = pad->index;
> > > > diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
> > > > index 1f94c1a54e00..f74158224b93 100644
> > > > --- a/drivers/media/platform/vsp1/vsp1_video.c
> > > > +++ b/drivers/media/platform/vsp1/vsp1_video.c
> > > > @@ -160,8 +160,7 @@ vsp1_video_remote_subdev(struct media_pad *local, u32 *pad)
> > > >  	struct media_pad *remote;
> > > >  
> > > >  	remote = media_entity_remote_pad(local);
> > > > -	if (remote = NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -326,7 +325,7 @@ static int vsp1_pipeline_validate_branch(struct vsp1_pipeline *pipe,
> > > >  			return -EPIPE;
> > > >  
> > > >  		/* We've reached a video node, that shouldn't have happened. */
> > > > -		if (media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!is_media_entity_v4l2_subdev(pad->entity))
> > > >  			return -EPIPE;
> > > >  
> > > >  		entity = to_vsp1_entity(media_entity_to_v4l2_subdev(pad->entity));
> > > > @@ -423,7 +422,7 @@ static int vsp1_pipeline_validate(struct vsp1_pipeline *pipe,
> > > >  		struct vsp1_rwpf *rwpf;
> > > >  		struct vsp1_entity *e;
> > > >  
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_V4L2_SUBDEV) {
> > > > +		if (is_media_entity_v4l2_io(entity)) {
> > > >  			pipe->num_video++;
> > > >  			continue;
> > > >  		}
> > > > @@ -692,7 +691,7 @@ void vsp1_pipeline_propagate_alpha(struct vsp1_pipeline *pipe,
> > > >  	pad = media_entity_remote_pad(&input->pads[RWPF_PAD_SOURCE]);
> > > >  
> > > >  	while (pad) {
> > > > -		if (media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = to_vsp1_entity(media_entity_to_v4l2_subdev(pad->entity));
> > > > diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c
> > > > index 88cd789cdaf7..8e14841bf445 100644
> > > > --- a/drivers/media/platform/xilinx/xilinx-dma.c
> > > > +++ b/drivers/media/platform/xilinx/xilinx-dma.c
> > > > @@ -49,8 +49,7 @@ xvip_dma_remote_subdev(struct media_pad *local, u32 *pad)
> > > >  	struct media_pad *remote;
> > > >  
> > > >  	remote = media_entity_remote_pad(local);
> > > > -	if (remote = NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -113,8 +112,7 @@ static int xvip_pipeline_start_stop(struct xvip_pipeline *pipe, bool start)
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad = NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
> > > > index e6e1115d8215..60da43772de9 100644
> > > > --- a/drivers/media/v4l2-core/v4l2-subdev.c
> > > > +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> > > > @@ -526,7 +526,7 @@ static int
> > > >  v4l2_subdev_link_validate_get_format(struct media_pad *pad,
> > > >  				     struct v4l2_subdev_format *fmt)
> > > >  {
> > > > -	if (media_entity_type(pad->entity) = MEDIA_ENT_T_V4L2_SUBDEV) {
> > > > +	if (is_media_entity_v4l2_subdev(pad->entity)) {
> > > >  		struct v4l2_subdev *sd > > > >  			media_entity_to_v4l2_subdev(pad->entity);
> > > >  
> > > > diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c
> > > > index 92573fa852a9..16763e0831f2 100644
> > > > --- a/drivers/staging/media/davinci_vpfe/vpfe_video.c
> > > > +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c
> > > > @@ -148,7 +148,7 @@ static void vpfe_prepare_pipeline(struct vpfe_video_device *video)
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > >  		if (entity = &video->video_dev.entity)
> > > >  			continue;
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if ((!is_media_entity_v4l2_io(remote->entity))
> > > >  			continue;
> > > >  		far_end = to_vpfe_video(media_entity_to_video_device(entity));
> > > >  		if (far_end->type = V4L2_BUF_TYPE_VIDEO_OUTPUT)
> > > > @@ -293,7 +293,7 @@ static int vpfe_pipeline_enable(struct vpfe_pipeline *pipe)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > >  
> > > > -		if (media_entity_type(entity) = MEDIA_ENT_T_DEVNODE)
> > > > +		if !is_media_entity_v4l2_subdev(entity))
> > > >  			continue;
> > > >  		subdev = media_entity_to_v4l2_subdev(entity);
> > > >  		ret = v4l2_subdev_call(subdev, video, s_stream, 1);
> > > > @@ -334,7 +334,7 @@ static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe)
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > >  
> > > > -		if (media_entity_type(entity) = MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_subdev(entity))
> > > >  			continue;
> > > >  		subdev = media_entity_to_v4l2_subdev(entity);
> > > >  		ret = v4l2_subdev_call(subdev, video, s_stream, 0);
> > > > diff --git a/drivers/staging/media/omap4iss/iss.c b/drivers/staging/media/omap4iss/iss.c
> > > > index 40591963b42b..44b88ff3ba83 100644
> > > > --- a/drivers/staging/media/omap4iss/iss.c
> > > > +++ b/drivers/staging/media/omap4iss/iss.c
> > > > @@ -397,7 +397,7 @@ static int iss_pipeline_pm_use_count(struct media_entity *entity)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity) = MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_io(entity))
> > > >  			use += entity->use_count;
> > > >  	}
> > > >  
> > > > @@ -419,7 +419,7 @@ static int iss_pipeline_pm_power_one(struct media_entity *entity, int change)
> > > >  {
> > > >  	struct v4l2_subdev *subdev;
> > > >  
> > > > -	subdev = media_entity_type(entity) = MEDIA_ENT_T_V4L2_SUBDEV
> > > > +	subdev = is_media_entity_v4l2_subdev(entity)
> > > >  	       ? media_entity_to_v4l2_subdev(entity) : NULL;
> > > >  
> > > >  	if (entity->use_count = 0 && change > 0 && subdev != NULL) {
> > > > @@ -461,7 +461,7 @@ static int iss_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while (!ret && (entity = media_entity_graph_walk_next(&graph)))
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(entity))
> > > >  			ret = iss_pipeline_pm_power_one(entity, change);
> > > >  
> > > >  	if (!ret)
> > > > @@ -471,7 +471,7 @@ static int iss_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  
> > > >  	while ((first = media_entity_graph_walk_next(&graph))
> > > >  	       && first != entity)
> > > > -		if (media_entity_type(first) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(first))
> > > >  			iss_pipeline_pm_power_one(first, -change);
> > > >  
> > > >  	return ret;
> > > > @@ -590,8 +590,7 @@ static int iss_pipeline_disable(struct iss_pipeline *pipe,
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad = NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > @@ -658,8 +657,7 @@ static int iss_pipeline_enable(struct iss_pipeline *pipe,
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad = NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > diff --git a/drivers/staging/media/omap4iss/iss_video.c b/drivers/staging/media/omap4iss/iss_video.c
> > > > index 45a3f2d778fc..cbe5783735dc 100644
> > > > --- a/drivers/staging/media/omap4iss/iss_video.c
> > > > +++ b/drivers/staging/media/omap4iss/iss_video.c
> > > > @@ -191,8 +191,7 @@ iss_video_remote_subdev(struct iss_video *video, u32 *pad)
> > > >  
> > > >  	remote = media_entity_remote_pad(&video->pad);
> > > >  
> > > > -	if (remote = NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -217,7 +216,7 @@ iss_video_far_end(struct iss_video *video)
> > > >  		if (entity = &video->video.entity)
> > > >  			continue;
> > > >  
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity))
> > > >  			continue;
> > > >  
> > > >  		far_end = to_iss_video(media_entity_to_video_device(entity));
> > > 
> > > I finally got around to test these patches eventually, and after some
> > > debugging found this one. I think it's a good idea to have macros to
> > > determine whether an entity exposes a V4L2 sub-device interface but it
> > > should be more robust than is_media_entity_v4l2_subdev() right now is.
> > 
> > Hmm... Not sure what you're meaning... the V4L2 sub-device interface is
> > actually a separate graph object (interfaces). Those macros work at the
> > entities, not at the interface objects.
> 
> is_media_entity_v4l2_subdev() will produce wrong results for a large part of
> V4L2 sub-devices with these patches applied.
> 
> I checked again the original implementation, and it seems to be based only
> on the type as well, albeit that's a range, not a set of different
> functions.

Yes. As we're getting rid of ranges for subdevs, we need to change the
implementation. Your patch does the job by recognizing the "unknown"
subdevs.

> I suppose this will change at some point in the future: the interface indeed
> should not be determined by the function of the entity. At least it needs to
> be fixed now until the rework. I'll submit a patch for that.
> 

Thanks!

Mauro

WARNING: multiple messages have this Message-ID (diff)
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: "Linux Media Mailing List" <linux-media@vger.kernel.org>,
	"Mauro Carvalho Chehab" <mchehab@infradead.org>,
	"Kyungmin Park" <kyungmin.park@samsung.com>,
	"Sylwester Nawrocki" <s.nawrocki@samsung.com>,
	"Kukjin Kim" <kgene@kernel.org>,
	"Krzysztof Kozlowski" <k.kozlowski@samsung.com>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Hyun Kwon" <hyun.kwon@xilinx.com>,
	"Michal Simek" <michal.simek@xilinx.com>,
	"Sören Brinkmann" <soren.brinkmann@xilinx.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Hans Verkuil" <hans.verkuil@cisco.com>,
	"Prabhakar Lad" <prabhakar.csengg@gmail.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Markus Elfring" <elfring@users.sourceforge.net>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Javier Martinez Canillas" <javier@osg.samsung.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-sh@vger.kernel.org,
	devel@driverdev.osuosl.org
Subject: Re: [PATCH v8 32/55] [media] media: use macros to check for V4L2 subdev entities
Date: Mon, 12 Oct 2015 13:00:13 -0300	[thread overview]
Message-ID: <20151012130013.5b7dcbb0@recife.lan> (raw)
In-Reply-To: <20151012153504.GL26916@valkosipuli.retiisi.org.uk>

Em Mon, 12 Oct 2015 18:35:05 +0300
Sakari Ailus <sakari.ailus@iki.fi> escreveu:

> Hi Mauro,
> 
> On Sun, Oct 11, 2015 at 09:56:25PM -0300, Mauro Carvalho Chehab wrote:
> > Em Mon, 12 Oct 2015 00:07:52 +0300
> > Sakari Ailus <sakari.ailus@iki.fi> escreveu:
> > 
> > > Hi Mauro,
> > > 
> > > On Sun, Aug 30, 2015 at 12:06:43AM -0300, Mauro Carvalho Chehab wrote:
> > > > Instead of relying on media subtype, use the new macros to detect
> > > > if an entity is a subdev or an A/V DMA entity.
> > > > 
> > > > Please note that most drivers assume that there's just AV_DMA or
> > > > V4L2 subdevs. This is not true anymore, as we've added MC support
> > > > for DVB, and there are plans to add support for ALSA and FB/DRM
> > > > too.
> > > > 
> > > > Ok, on the current pipelines supported by those drivers, just V4L
> > > > stuff are there, but, assuming that some day a pipeline that also
> > > > works with other subsystems will ever added, it is better to add
> > > > explicit checks for the AV_DMA stuff.
> > > > 
> > > > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> > > > 
> > > > diff --git a/drivers/media/platform/exynos4-is/common.c b/drivers/media/platform/exynos4-is/common.c
> > > > index 0eb34ecb8ee4..8c9a29e0e294 100644
> > > > --- a/drivers/media/platform/exynos4-is/common.c
> > > > +++ b/drivers/media/platform/exynos4-is/common.c
> > > > @@ -22,8 +22,7 @@ struct v4l2_subdev *fimc_find_remote_sensor(struct media_entity *entity)
> > > >  	while (pad->flags & MEDIA_PAD_FL_SINK) {
> > > >  		/* source pad */
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > > diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c
> > > > index 0627a93b2f3b..e9810fee4c30 100644
> > > > --- a/drivers/media/platform/exynos4-is/fimc-capture.c
> > > > +++ b/drivers/media/platform/exynos4-is/fimc-capture.c
> > > > @@ -1141,8 +1141,7 @@ static int fimc_pipeline_validate(struct fimc_dev *fimc)
> > > >  			}
> > > >  		}
> > > >  
> > > > -		if (src_pad == NULL ||
> > > > -		    media_entity_type(src_pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!src_pad || !is_media_entity_v4l2_subdev(src_pad->entity))
> > > >  			break;
> > > >  
> > > >  		/* Don't call FIMC subdev operation to avoid nested locking */
> > > > @@ -1397,7 +1396,7 @@ static int fimc_link_setup(struct media_entity *entity,
> > > >  	struct fimc_vid_cap *vc = &fimc->vid_cap;
> > > >  	struct v4l2_subdev *sensor;
> > > >  
> > > > -	if (media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return -EINVAL;
> > > >  
> > > >  	if (WARN_ON(fimc == NULL))
> > > > diff --git a/drivers/media/platform/exynos4-is/fimc-isp-video.c b/drivers/media/platform/exynos4-is/fimc-isp-video.c
> > > > index 3d9ccbf5f10f..5fbaf5e39903 100644
> > > > --- a/drivers/media/platform/exynos4-is/fimc-isp-video.c
> > > > +++ b/drivers/media/platform/exynos4-is/fimc-isp-video.c
> > > > @@ -467,8 +467,7 @@ static int isp_video_pipeline_validate(struct fimc_isp *isp)
> > > >  
> > > >  		/* Retrieve format at the source pad */
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > > diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
> > > > index b2607da4ad14..c2327147b360 100644
> > > > --- a/drivers/media/platform/exynos4-is/fimc-lite.c
> > > > +++ b/drivers/media/platform/exynos4-is/fimc-lite.c
> > > > @@ -814,8 +814,7 @@ static int fimc_pipeline_validate(struct fimc_lite *fimc)
> > > >  		}
> > > >  		/* Retrieve format at the source pad */
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > > @@ -988,7 +987,6 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  {
> > > >  	struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity);
> > > >  	struct fimc_lite *fimc = v4l2_get_subdevdata(sd);
> > > > -	unsigned int remote_ent_type = media_entity_type(remote->entity);
> > > >  	int ret = 0;
> > > >  
> > > >  	if (WARN_ON(fimc == NULL))
> > > > @@ -1000,7 +998,7 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  
> > > >  	switch (local->index) {
> > > >  	case FLITE_SD_PAD_SINK:
> > > > -		if (remote_ent_type != MEDIA_ENT_T_V4L2_SUBDEV) {
> > > > +		if (!is_media_entity_v4l2_subdev(remote->entity)) {
> > > >  			ret = -EINVAL;
> > > >  			break;
> > > >  		}
> > > > @@ -1018,7 +1016,7 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  	case FLITE_SD_PAD_SOURCE_DMA:
> > > >  		if (!(flags & MEDIA_LNK_FL_ENABLED))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_NONE);
> > > > -		else if (remote_ent_type == MEDIA_ENT_T_DEVNODE)
> > > > +		else if (is_media_entity_v4l2_io(remote->entity))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_DMA);
> > > >  		else
> > > >  			ret = -EINVAL;
> > > > @@ -1027,7 +1025,7 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  	case FLITE_SD_PAD_SOURCE_ISP:
> > > >  		if (!(flags & MEDIA_LNK_FL_ENABLED))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_NONE);
> > > > -		else if (remote_ent_type == MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		else if (is_media_entity_v4l2_subdev(remote->entity))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_ISP);
> > > >  		else
> > > >  			ret = -EINVAL;
> > > > diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c
> > > > index 92dbade2fffc..4a25df9dd869 100644
> > > > --- a/drivers/media/platform/exynos4-is/media-dev.c
> > > > +++ b/drivers/media/platform/exynos4-is/media-dev.c
> > > > @@ -88,8 +88,7 @@ static void fimc_pipeline_prepare(struct fimc_pipeline *p,
> > > >  				break;
> > > >  		}
> > > >  
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > >  
> > > > @@ -1062,7 +1061,7 @@ static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity))
> > > >  			continue;
> > > >  
> > > >  		ret  = __fimc_md_modify_pipeline(entity, enable);
> > > > @@ -1076,7 +1075,7 @@ static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable)
> > > >  	media_entity_graph_walk_start(&graph, entity_err);
> > > >  
> > > >  	while ((entity_err = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity_err) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity_err))
> > > >  			continue;
> > > >  
> > > >  		__fimc_md_modify_pipeline(entity_err, !enable);
> > > > diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
> > > > index 69e7733d36cd..cb8ac90086c1 100644
> > > > --- a/drivers/media/platform/omap3isp/isp.c
> > > > +++ b/drivers/media/platform/omap3isp/isp.c
> > > > @@ -691,7 +691,7 @@ static int isp_pipeline_pm_use_count(struct media_entity *entity)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_io(entity))
> > > >  			use += entity->use_count;
> > > >  	}
> > > >  
> > > > @@ -714,7 +714,7 @@ static int isp_pipeline_pm_power_one(struct media_entity *entity, int change)
> > > >  	struct v4l2_subdev *subdev;
> > > >  	int ret;
> > > >  
> > > > -	subdev = media_entity_type(entity) == MEDIA_ENT_T_V4L2_SUBDEV
> > > > +	subdev = is_media_entity_v4l2_subdev(entity)
> > > >  	       ? media_entity_to_v4l2_subdev(entity) : NULL;
> > > >  
> > > >  	if (entity->use_count == 0 && change > 0 && subdev != NULL) {
> > > > @@ -754,7 +754,7 @@ static int isp_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while (!ret && (entity = media_entity_graph_walk_next(&graph)))
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(entity))
> > > >  			ret = isp_pipeline_pm_power_one(entity, change);
> > > >  
> > > >  	if (!ret)
> > > > @@ -764,7 +764,7 @@ static int isp_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  
> > > >  	while ((first = media_entity_graph_walk_next(&graph))
> > > >  	       && first != entity)
> > > > -		if (media_entity_type(first) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(first))
> > > >  			isp_pipeline_pm_power_one(first, -change);
> > > >  
> > > >  	return ret;
> > > > @@ -897,8 +897,7 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe,
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > @@ -988,8 +987,7 @@ static int isp_pipeline_disable(struct isp_pipeline *pipe)
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
> > > > index 4c367352b1f7..52843ac2a9ca 100644
> > > > --- a/drivers/media/platform/omap3isp/ispvideo.c
> > > > +++ b/drivers/media/platform/omap3isp/ispvideo.c
> > > > @@ -210,8 +210,7 @@ isp_video_remote_subdev(struct isp_video *video, u32 *pad)
> > > >  
> > > >  	remote = media_entity_remote_pad(&video->pad);
> > > >  
> > > > -	if (remote == NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -243,7 +242,7 @@ static int isp_video_get_graph_data(struct isp_video *video,
> > > >  		if (entity == &video->video.entity)
> > > >  			continue;
> > > >  
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity))
> > > >  			continue;
> > > >  
> > > >  		__video = to_isp_video(media_entity_to_video_device(entity));
> > > > @@ -917,7 +916,7 @@ static int isp_video_check_external_subdevs(struct isp_video *video,
> > > >  		return -EINVAL;
> > > >  	}
> > > >  
> > > > -	if (media_entity_type(source) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!is_media_entity_v4l2_subdev(source))
> > > >  		return 0;
> > > >  
> > > >  	pipe->external = media_entity_to_v4l2_subdev(source);
> > > > diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c
> > > > index eae667eab1b9..fb5b016cc0a1 100644
> > > > --- a/drivers/media/platform/s3c-camif/camif-capture.c
> > > > +++ b/drivers/media/platform/s3c-camif/camif-capture.c
> > > > @@ -837,7 +837,7 @@ static int camif_pipeline_validate(struct camif_dev *camif)
> > > >  
> > > >  	/* Retrieve format at the sensor subdev source pad */
> > > >  	pad = media_entity_remote_pad(&camif->pads[0]);
> > > > -	if (!pad || media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  		return -EPIPE;
> > > >  
> > > >  	src_fmt.pad = pad->index;
> > > > diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
> > > > index 1f94c1a54e00..f74158224b93 100644
> > > > --- a/drivers/media/platform/vsp1/vsp1_video.c
> > > > +++ b/drivers/media/platform/vsp1/vsp1_video.c
> > > > @@ -160,8 +160,7 @@ vsp1_video_remote_subdev(struct media_pad *local, u32 *pad)
> > > >  	struct media_pad *remote;
> > > >  
> > > >  	remote = media_entity_remote_pad(local);
> > > > -	if (remote == NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -326,7 +325,7 @@ static int vsp1_pipeline_validate_branch(struct vsp1_pipeline *pipe,
> > > >  			return -EPIPE;
> > > >  
> > > >  		/* We've reached a video node, that shouldn't have happened. */
> > > > -		if (media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!is_media_entity_v4l2_subdev(pad->entity))
> > > >  			return -EPIPE;
> > > >  
> > > >  		entity = to_vsp1_entity(media_entity_to_v4l2_subdev(pad->entity));
> > > > @@ -423,7 +422,7 @@ static int vsp1_pipeline_validate(struct vsp1_pipeline *pipe,
> > > >  		struct vsp1_rwpf *rwpf;
> > > >  		struct vsp1_entity *e;
> > > >  
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_V4L2_SUBDEV) {
> > > > +		if (is_media_entity_v4l2_io(entity)) {
> > > >  			pipe->num_video++;
> > > >  			continue;
> > > >  		}
> > > > @@ -692,7 +691,7 @@ void vsp1_pipeline_propagate_alpha(struct vsp1_pipeline *pipe,
> > > >  	pad = media_entity_remote_pad(&input->pads[RWPF_PAD_SOURCE]);
> > > >  
> > > >  	while (pad) {
> > > > -		if (media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = to_vsp1_entity(media_entity_to_v4l2_subdev(pad->entity));
> > > > diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c
> > > > index 88cd789cdaf7..8e14841bf445 100644
> > > > --- a/drivers/media/platform/xilinx/xilinx-dma.c
> > > > +++ b/drivers/media/platform/xilinx/xilinx-dma.c
> > > > @@ -49,8 +49,7 @@ xvip_dma_remote_subdev(struct media_pad *local, u32 *pad)
> > > >  	struct media_pad *remote;
> > > >  
> > > >  	remote = media_entity_remote_pad(local);
> > > > -	if (remote == NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -113,8 +112,7 @@ static int xvip_pipeline_start_stop(struct xvip_pipeline *pipe, bool start)
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
> > > > index e6e1115d8215..60da43772de9 100644
> > > > --- a/drivers/media/v4l2-core/v4l2-subdev.c
> > > > +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> > > > @@ -526,7 +526,7 @@ static int
> > > >  v4l2_subdev_link_validate_get_format(struct media_pad *pad,
> > > >  				     struct v4l2_subdev_format *fmt)
> > > >  {
> > > > -	if (media_entity_type(pad->entity) == MEDIA_ENT_T_V4L2_SUBDEV) {
> > > > +	if (is_media_entity_v4l2_subdev(pad->entity)) {
> > > >  		struct v4l2_subdev *sd =
> > > >  			media_entity_to_v4l2_subdev(pad->entity);
> > > >  
> > > > diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c
> > > > index 92573fa852a9..16763e0831f2 100644
> > > > --- a/drivers/staging/media/davinci_vpfe/vpfe_video.c
> > > > +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c
> > > > @@ -148,7 +148,7 @@ static void vpfe_prepare_pipeline(struct vpfe_video_device *video)
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > >  		if (entity == &video->video_dev.entity)
> > > >  			continue;
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if ((!is_media_entity_v4l2_io(remote->entity))
> > > >  			continue;
> > > >  		far_end = to_vpfe_video(media_entity_to_video_device(entity));
> > > >  		if (far_end->type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
> > > > @@ -293,7 +293,7 @@ static int vpfe_pipeline_enable(struct vpfe_pipeline *pipe)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > >  
> > > > -		if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE)
> > > > +		if !is_media_entity_v4l2_subdev(entity))
> > > >  			continue;
> > > >  		subdev = media_entity_to_v4l2_subdev(entity);
> > > >  		ret = v4l2_subdev_call(subdev, video, s_stream, 1);
> > > > @@ -334,7 +334,7 @@ static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe)
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > >  
> > > > -		if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_subdev(entity))
> > > >  			continue;
> > > >  		subdev = media_entity_to_v4l2_subdev(entity);
> > > >  		ret = v4l2_subdev_call(subdev, video, s_stream, 0);
> > > > diff --git a/drivers/staging/media/omap4iss/iss.c b/drivers/staging/media/omap4iss/iss.c
> > > > index 40591963b42b..44b88ff3ba83 100644
> > > > --- a/drivers/staging/media/omap4iss/iss.c
> > > > +++ b/drivers/staging/media/omap4iss/iss.c
> > > > @@ -397,7 +397,7 @@ static int iss_pipeline_pm_use_count(struct media_entity *entity)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_io(entity))
> > > >  			use += entity->use_count;
> > > >  	}
> > > >  
> > > > @@ -419,7 +419,7 @@ static int iss_pipeline_pm_power_one(struct media_entity *entity, int change)
> > > >  {
> > > >  	struct v4l2_subdev *subdev;
> > > >  
> > > > -	subdev = media_entity_type(entity) == MEDIA_ENT_T_V4L2_SUBDEV
> > > > +	subdev = is_media_entity_v4l2_subdev(entity)
> > > >  	       ? media_entity_to_v4l2_subdev(entity) : NULL;
> > > >  
> > > >  	if (entity->use_count == 0 && change > 0 && subdev != NULL) {
> > > > @@ -461,7 +461,7 @@ static int iss_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while (!ret && (entity = media_entity_graph_walk_next(&graph)))
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(entity))
> > > >  			ret = iss_pipeline_pm_power_one(entity, change);
> > > >  
> > > >  	if (!ret)
> > > > @@ -471,7 +471,7 @@ static int iss_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  
> > > >  	while ((first = media_entity_graph_walk_next(&graph))
> > > >  	       && first != entity)
> > > > -		if (media_entity_type(first) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(first))
> > > >  			iss_pipeline_pm_power_one(first, -change);
> > > >  
> > > >  	return ret;
> > > > @@ -590,8 +590,7 @@ static int iss_pipeline_disable(struct iss_pipeline *pipe,
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > @@ -658,8 +657,7 @@ static int iss_pipeline_enable(struct iss_pipeline *pipe,
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > diff --git a/drivers/staging/media/omap4iss/iss_video.c b/drivers/staging/media/omap4iss/iss_video.c
> > > > index 45a3f2d778fc..cbe5783735dc 100644
> > > > --- a/drivers/staging/media/omap4iss/iss_video.c
> > > > +++ b/drivers/staging/media/omap4iss/iss_video.c
> > > > @@ -191,8 +191,7 @@ iss_video_remote_subdev(struct iss_video *video, u32 *pad)
> > > >  
> > > >  	remote = media_entity_remote_pad(&video->pad);
> > > >  
> > > > -	if (remote == NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -217,7 +216,7 @@ iss_video_far_end(struct iss_video *video)
> > > >  		if (entity == &video->video.entity)
> > > >  			continue;
> > > >  
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity))
> > > >  			continue;
> > > >  
> > > >  		far_end = to_iss_video(media_entity_to_video_device(entity));
> > > 
> > > I finally got around to test these patches eventually, and after some
> > > debugging found this one. I think it's a good idea to have macros to
> > > determine whether an entity exposes a V4L2 sub-device interface but it
> > > should be more robust than is_media_entity_v4l2_subdev() right now is.
> > 
> > Hmm... Not sure what you're meaning... the V4L2 sub-device interface is
> > actually a separate graph object (interfaces). Those macros work at the
> > entities, not at the interface objects.
> 
> is_media_entity_v4l2_subdev() will produce wrong results for a large part of
> V4L2 sub-devices with these patches applied.
> 
> I checked again the original implementation, and it seems to be based only
> on the type as well, albeit that's a range, not a set of different
> functions.

Yes. As we're getting rid of ranges for subdevs, we need to change the
implementation. Your patch does the job by recognizing the "unknown"
subdevs.

> I suppose this will change at some point in the future: the interface indeed
> should not be determined by the function of the entity. At least it needs to
> be fixed now until the rework. I'll submit a patch for that.
> 

Thanks!

Mauro

WARNING: multiple messages have this Message-ID (diff)
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: "Linux Media Mailing List" <linux-media@vger.kernel.org>,
	"Mauro Carvalho Chehab" <mchehab@infradead.org>,
	"Kyungmin Park" <kyungmin.park@samsung.com>,
	"Sylwester Nawrocki" <s.nawrocki@samsung.com>,
	"Kukjin Kim" <kgene@kernel.org>,
	"Krzysztof Kozlowski" <k.kozlowski@samsung.com>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Hyun Kwon" <hyun.kwon@xilinx.com>,
	"Michal Simek" <michal.simek@xilinx.com>,
	"Sören Brinkmann" <soren.brinkmann@xilinx.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Hans Verkuil" <hans.verkuil@cisco.com>,
	"Prabhakar Lad" <prabhakar.csengg@gmail.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Markus Elfring" <elfring@users.sourceforge.net>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Javier Martinez Canillas" <javier@osg.samsung.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH v8 32/55] [media] media: use macros to check for V4L2 subdev entities
Date: Mon, 12 Oct 2015 13:00:13 -0300	[thread overview]
Message-ID: <20151012130013.5b7dcbb0@recife.lan> (raw)
In-Reply-To: <20151012153504.GL26916@valkosipuli.retiisi.org.uk>

Em Mon, 12 Oct 2015 18:35:05 +0300
Sakari Ailus <sakari.ailus@iki.fi> escreveu:

> Hi Mauro,
> 
> On Sun, Oct 11, 2015 at 09:56:25PM -0300, Mauro Carvalho Chehab wrote:
> > Em Mon, 12 Oct 2015 00:07:52 +0300
> > Sakari Ailus <sakari.ailus@iki.fi> escreveu:
> > 
> > > Hi Mauro,
> > > 
> > > On Sun, Aug 30, 2015 at 12:06:43AM -0300, Mauro Carvalho Chehab wrote:
> > > > Instead of relying on media subtype, use the new macros to detect
> > > > if an entity is a subdev or an A/V DMA entity.
> > > > 
> > > > Please note that most drivers assume that there's just AV_DMA or
> > > > V4L2 subdevs. This is not true anymore, as we've added MC support
> > > > for DVB, and there are plans to add support for ALSA and FB/DRM
> > > > too.
> > > > 
> > > > Ok, on the current pipelines supported by those drivers, just V4L
> > > > stuff are there, but, assuming that some day a pipeline that also
> > > > works with other subsystems will ever added, it is better to add
> > > > explicit checks for the AV_DMA stuff.
> > > > 
> > > > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> > > > 
> > > > diff --git a/drivers/media/platform/exynos4-is/common.c b/drivers/media/platform/exynos4-is/common.c
> > > > index 0eb34ecb8ee4..8c9a29e0e294 100644
> > > > --- a/drivers/media/platform/exynos4-is/common.c
> > > > +++ b/drivers/media/platform/exynos4-is/common.c
> > > > @@ -22,8 +22,7 @@ struct v4l2_subdev *fimc_find_remote_sensor(struct media_entity *entity)
> > > >  	while (pad->flags & MEDIA_PAD_FL_SINK) {
> > > >  		/* source pad */
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > > diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c
> > > > index 0627a93b2f3b..e9810fee4c30 100644
> > > > --- a/drivers/media/platform/exynos4-is/fimc-capture.c
> > > > +++ b/drivers/media/platform/exynos4-is/fimc-capture.c
> > > > @@ -1141,8 +1141,7 @@ static int fimc_pipeline_validate(struct fimc_dev *fimc)
> > > >  			}
> > > >  		}
> > > >  
> > > > -		if (src_pad == NULL ||
> > > > -		    media_entity_type(src_pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!src_pad || !is_media_entity_v4l2_subdev(src_pad->entity))
> > > >  			break;
> > > >  
> > > >  		/* Don't call FIMC subdev operation to avoid nested locking */
> > > > @@ -1397,7 +1396,7 @@ static int fimc_link_setup(struct media_entity *entity,
> > > >  	struct fimc_vid_cap *vc = &fimc->vid_cap;
> > > >  	struct v4l2_subdev *sensor;
> > > >  
> > > > -	if (media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return -EINVAL;
> > > >  
> > > >  	if (WARN_ON(fimc == NULL))
> > > > diff --git a/drivers/media/platform/exynos4-is/fimc-isp-video.c b/drivers/media/platform/exynos4-is/fimc-isp-video.c
> > > > index 3d9ccbf5f10f..5fbaf5e39903 100644
> > > > --- a/drivers/media/platform/exynos4-is/fimc-isp-video.c
> > > > +++ b/drivers/media/platform/exynos4-is/fimc-isp-video.c
> > > > @@ -467,8 +467,7 @@ static int isp_video_pipeline_validate(struct fimc_isp *isp)
> > > >  
> > > >  		/* Retrieve format at the source pad */
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > > diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
> > > > index b2607da4ad14..c2327147b360 100644
> > > > --- a/drivers/media/platform/exynos4-is/fimc-lite.c
> > > > +++ b/drivers/media/platform/exynos4-is/fimc-lite.c
> > > > @@ -814,8 +814,7 @@ static int fimc_pipeline_validate(struct fimc_lite *fimc)
> > > >  		}
> > > >  		/* Retrieve format at the source pad */
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > > @@ -988,7 +987,6 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  {
> > > >  	struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity);
> > > >  	struct fimc_lite *fimc = v4l2_get_subdevdata(sd);
> > > > -	unsigned int remote_ent_type = media_entity_type(remote->entity);
> > > >  	int ret = 0;
> > > >  
> > > >  	if (WARN_ON(fimc == NULL))
> > > > @@ -1000,7 +998,7 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  
> > > >  	switch (local->index) {
> > > >  	case FLITE_SD_PAD_SINK:
> > > > -		if (remote_ent_type != MEDIA_ENT_T_V4L2_SUBDEV) {
> > > > +		if (!is_media_entity_v4l2_subdev(remote->entity)) {
> > > >  			ret = -EINVAL;
> > > >  			break;
> > > >  		}
> > > > @@ -1018,7 +1016,7 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  	case FLITE_SD_PAD_SOURCE_DMA:
> > > >  		if (!(flags & MEDIA_LNK_FL_ENABLED))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_NONE);
> > > > -		else if (remote_ent_type == MEDIA_ENT_T_DEVNODE)
> > > > +		else if (is_media_entity_v4l2_io(remote->entity))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_DMA);
> > > >  		else
> > > >  			ret = -EINVAL;
> > > > @@ -1027,7 +1025,7 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  	case FLITE_SD_PAD_SOURCE_ISP:
> > > >  		if (!(flags & MEDIA_LNK_FL_ENABLED))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_NONE);
> > > > -		else if (remote_ent_type == MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		else if (is_media_entity_v4l2_subdev(remote->entity))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_ISP);
> > > >  		else
> > > >  			ret = -EINVAL;
> > > > diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c
> > > > index 92dbade2fffc..4a25df9dd869 100644
> > > > --- a/drivers/media/platform/exynos4-is/media-dev.c
> > > > +++ b/drivers/media/platform/exynos4-is/media-dev.c
> > > > @@ -88,8 +88,7 @@ static void fimc_pipeline_prepare(struct fimc_pipeline *p,
> > > >  				break;
> > > >  		}
> > > >  
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > >  
> > > > @@ -1062,7 +1061,7 @@ static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity))
> > > >  			continue;
> > > >  
> > > >  		ret  = __fimc_md_modify_pipeline(entity, enable);
> > > > @@ -1076,7 +1075,7 @@ static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable)
> > > >  	media_entity_graph_walk_start(&graph, entity_err);
> > > >  
> > > >  	while ((entity_err = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity_err) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity_err))
> > > >  			continue;
> > > >  
> > > >  		__fimc_md_modify_pipeline(entity_err, !enable);
> > > > diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
> > > > index 69e7733d36cd..cb8ac90086c1 100644
> > > > --- a/drivers/media/platform/omap3isp/isp.c
> > > > +++ b/drivers/media/platform/omap3isp/isp.c
> > > > @@ -691,7 +691,7 @@ static int isp_pipeline_pm_use_count(struct media_entity *entity)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_io(entity))
> > > >  			use += entity->use_count;
> > > >  	}
> > > >  
> > > > @@ -714,7 +714,7 @@ static int isp_pipeline_pm_power_one(struct media_entity *entity, int change)
> > > >  	struct v4l2_subdev *subdev;
> > > >  	int ret;
> > > >  
> > > > -	subdev = media_entity_type(entity) == MEDIA_ENT_T_V4L2_SUBDEV
> > > > +	subdev = is_media_entity_v4l2_subdev(entity)
> > > >  	       ? media_entity_to_v4l2_subdev(entity) : NULL;
> > > >  
> > > >  	if (entity->use_count == 0 && change > 0 && subdev != NULL) {
> > > > @@ -754,7 +754,7 @@ static int isp_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while (!ret && (entity = media_entity_graph_walk_next(&graph)))
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(entity))
> > > >  			ret = isp_pipeline_pm_power_one(entity, change);
> > > >  
> > > >  	if (!ret)
> > > > @@ -764,7 +764,7 @@ static int isp_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  
> > > >  	while ((first = media_entity_graph_walk_next(&graph))
> > > >  	       && first != entity)
> > > > -		if (media_entity_type(first) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(first))
> > > >  			isp_pipeline_pm_power_one(first, -change);
> > > >  
> > > >  	return ret;
> > > > @@ -897,8 +897,7 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe,
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > @@ -988,8 +987,7 @@ static int isp_pipeline_disable(struct isp_pipeline *pipe)
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
> > > > index 4c367352b1f7..52843ac2a9ca 100644
> > > > --- a/drivers/media/platform/omap3isp/ispvideo.c
> > > > +++ b/drivers/media/platform/omap3isp/ispvideo.c
> > > > @@ -210,8 +210,7 @@ isp_video_remote_subdev(struct isp_video *video, u32 *pad)
> > > >  
> > > >  	remote = media_entity_remote_pad(&video->pad);
> > > >  
> > > > -	if (remote == NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -243,7 +242,7 @@ static int isp_video_get_graph_data(struct isp_video *video,
> > > >  		if (entity == &video->video.entity)
> > > >  			continue;
> > > >  
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity))
> > > >  			continue;
> > > >  
> > > >  		__video = to_isp_video(media_entity_to_video_device(entity));
> > > > @@ -917,7 +916,7 @@ static int isp_video_check_external_subdevs(struct isp_video *video,
> > > >  		return -EINVAL;
> > > >  	}
> > > >  
> > > > -	if (media_entity_type(source) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!is_media_entity_v4l2_subdev(source))
> > > >  		return 0;
> > > >  
> > > >  	pipe->external = media_entity_to_v4l2_subdev(source);
> > > > diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c
> > > > index eae667eab1b9..fb5b016cc0a1 100644
> > > > --- a/drivers/media/platform/s3c-camif/camif-capture.c
> > > > +++ b/drivers/media/platform/s3c-camif/camif-capture.c
> > > > @@ -837,7 +837,7 @@ static int camif_pipeline_validate(struct camif_dev *camif)
> > > >  
> > > >  	/* Retrieve format at the sensor subdev source pad */
> > > >  	pad = media_entity_remote_pad(&camif->pads[0]);
> > > > -	if (!pad || media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  		return -EPIPE;
> > > >  
> > > >  	src_fmt.pad = pad->index;
> > > > diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
> > > > index 1f94c1a54e00..f74158224b93 100644
> > > > --- a/drivers/media/platform/vsp1/vsp1_video.c
> > > > +++ b/drivers/media/platform/vsp1/vsp1_video.c
> > > > @@ -160,8 +160,7 @@ vsp1_video_remote_subdev(struct media_pad *local, u32 *pad)
> > > >  	struct media_pad *remote;
> > > >  
> > > >  	remote = media_entity_remote_pad(local);
> > > > -	if (remote == NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -326,7 +325,7 @@ static int vsp1_pipeline_validate_branch(struct vsp1_pipeline *pipe,
> > > >  			return -EPIPE;
> > > >  
> > > >  		/* We've reached a video node, that shouldn't have happened. */
> > > > -		if (media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!is_media_entity_v4l2_subdev(pad->entity))
> > > >  			return -EPIPE;
> > > >  
> > > >  		entity = to_vsp1_entity(media_entity_to_v4l2_subdev(pad->entity));
> > > > @@ -423,7 +422,7 @@ static int vsp1_pipeline_validate(struct vsp1_pipeline *pipe,
> > > >  		struct vsp1_rwpf *rwpf;
> > > >  		struct vsp1_entity *e;
> > > >  
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_V4L2_SUBDEV) {
> > > > +		if (is_media_entity_v4l2_io(entity)) {
> > > >  			pipe->num_video++;
> > > >  			continue;
> > > >  		}
> > > > @@ -692,7 +691,7 @@ void vsp1_pipeline_propagate_alpha(struct vsp1_pipeline *pipe,
> > > >  	pad = media_entity_remote_pad(&input->pads[RWPF_PAD_SOURCE]);
> > > >  
> > > >  	while (pad) {
> > > > -		if (media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = to_vsp1_entity(media_entity_to_v4l2_subdev(pad->entity));
> > > > diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c
> > > > index 88cd789cdaf7..8e14841bf445 100644
> > > > --- a/drivers/media/platform/xilinx/xilinx-dma.c
> > > > +++ b/drivers/media/platform/xilinx/xilinx-dma.c
> > > > @@ -49,8 +49,7 @@ xvip_dma_remote_subdev(struct media_pad *local, u32 *pad)
> > > >  	struct media_pad *remote;
> > > >  
> > > >  	remote = media_entity_remote_pad(local);
> > > > -	if (remote == NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -113,8 +112,7 @@ static int xvip_pipeline_start_stop(struct xvip_pipeline *pipe, bool start)
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
> > > > index e6e1115d8215..60da43772de9 100644
> > > > --- a/drivers/media/v4l2-core/v4l2-subdev.c
> > > > +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> > > > @@ -526,7 +526,7 @@ static int
> > > >  v4l2_subdev_link_validate_get_format(struct media_pad *pad,
> > > >  				     struct v4l2_subdev_format *fmt)
> > > >  {
> > > > -	if (media_entity_type(pad->entity) == MEDIA_ENT_T_V4L2_SUBDEV) {
> > > > +	if (is_media_entity_v4l2_subdev(pad->entity)) {
> > > >  		struct v4l2_subdev *sd =
> > > >  			media_entity_to_v4l2_subdev(pad->entity);
> > > >  
> > > > diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c
> > > > index 92573fa852a9..16763e0831f2 100644
> > > > --- a/drivers/staging/media/davinci_vpfe/vpfe_video.c
> > > > +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c
> > > > @@ -148,7 +148,7 @@ static void vpfe_prepare_pipeline(struct vpfe_video_device *video)
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > >  		if (entity == &video->video_dev.entity)
> > > >  			continue;
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if ((!is_media_entity_v4l2_io(remote->entity))
> > > >  			continue;
> > > >  		far_end = to_vpfe_video(media_entity_to_video_device(entity));
> > > >  		if (far_end->type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
> > > > @@ -293,7 +293,7 @@ static int vpfe_pipeline_enable(struct vpfe_pipeline *pipe)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > >  
> > > > -		if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE)
> > > > +		if !is_media_entity_v4l2_subdev(entity))
> > > >  			continue;
> > > >  		subdev = media_entity_to_v4l2_subdev(entity);
> > > >  		ret = v4l2_subdev_call(subdev, video, s_stream, 1);
> > > > @@ -334,7 +334,7 @@ static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe)
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > >  
> > > > -		if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_subdev(entity))
> > > >  			continue;
> > > >  		subdev = media_entity_to_v4l2_subdev(entity);
> > > >  		ret = v4l2_subdev_call(subdev, video, s_stream, 0);
> > > > diff --git a/drivers/staging/media/omap4iss/iss.c b/drivers/staging/media/omap4iss/iss.c
> > > > index 40591963b42b..44b88ff3ba83 100644
> > > > --- a/drivers/staging/media/omap4iss/iss.c
> > > > +++ b/drivers/staging/media/omap4iss/iss.c
> > > > @@ -397,7 +397,7 @@ static int iss_pipeline_pm_use_count(struct media_entity *entity)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_io(entity))
> > > >  			use += entity->use_count;
> > > >  	}
> > > >  
> > > > @@ -419,7 +419,7 @@ static int iss_pipeline_pm_power_one(struct media_entity *entity, int change)
> > > >  {
> > > >  	struct v4l2_subdev *subdev;
> > > >  
> > > > -	subdev = media_entity_type(entity) == MEDIA_ENT_T_V4L2_SUBDEV
> > > > +	subdev = is_media_entity_v4l2_subdev(entity)
> > > >  	       ? media_entity_to_v4l2_subdev(entity) : NULL;
> > > >  
> > > >  	if (entity->use_count == 0 && change > 0 && subdev != NULL) {
> > > > @@ -461,7 +461,7 @@ static int iss_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while (!ret && (entity = media_entity_graph_walk_next(&graph)))
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(entity))
> > > >  			ret = iss_pipeline_pm_power_one(entity, change);
> > > >  
> > > >  	if (!ret)
> > > > @@ -471,7 +471,7 @@ static int iss_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  
> > > >  	while ((first = media_entity_graph_walk_next(&graph))
> > > >  	       && first != entity)
> > > > -		if (media_entity_type(first) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(first))
> > > >  			iss_pipeline_pm_power_one(first, -change);
> > > >  
> > > >  	return ret;
> > > > @@ -590,8 +590,7 @@ static int iss_pipeline_disable(struct iss_pipeline *pipe,
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > @@ -658,8 +657,7 @@ static int iss_pipeline_enable(struct iss_pipeline *pipe,
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > diff --git a/drivers/staging/media/omap4iss/iss_video.c b/drivers/staging/media/omap4iss/iss_video.c
> > > > index 45a3f2d778fc..cbe5783735dc 100644
> > > > --- a/drivers/staging/media/omap4iss/iss_video.c
> > > > +++ b/drivers/staging/media/omap4iss/iss_video.c
> > > > @@ -191,8 +191,7 @@ iss_video_remote_subdev(struct iss_video *video, u32 *pad)
> > > >  
> > > >  	remote = media_entity_remote_pad(&video->pad);
> > > >  
> > > > -	if (remote == NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -217,7 +216,7 @@ iss_video_far_end(struct iss_video *video)
> > > >  		if (entity == &video->video.entity)
> > > >  			continue;
> > > >  
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity))
> > > >  			continue;
> > > >  
> > > >  		far_end = to_iss_video(media_entity_to_video_device(entity));
> > > 
> > > I finally got around to test these patches eventually, and after some
> > > debugging found this one. I think it's a good idea to have macros to
> > > determine whether an entity exposes a V4L2 sub-device interface but it
> > > should be more robust than is_media_entity_v4l2_subdev() right now is.
> > 
> > Hmm... Not sure what you're meaning... the V4L2 sub-device interface is
> > actually a separate graph object (interfaces). Those macros work at the
> > entities, not at the interface objects.
> 
> is_media_entity_v4l2_subdev() will produce wrong results for a large part of
> V4L2 sub-devices with these patches applied.
> 
> I checked again the original implementation, and it seems to be based only
> on the type as well, albeit that's a range, not a set of different
> functions.

Yes. As we're getting rid of ranges for subdevs, we need to change the
implementation. Your patch does the job by recognizing the "unknown"
subdevs.

> I suppose this will change at some point in the future: the interface indeed
> should not be determined by the function of the entity. At least it needs to
> be fixed now until the rework. I'll submit a patch for that.
> 

Thanks!

Mauro

WARNING: multiple messages have this Message-ID (diff)
From: mchehab@osg.samsung.com (Mauro Carvalho Chehab)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v8 32/55] [media] media: use macros to check for V4L2 subdev entities
Date: Mon, 12 Oct 2015 13:00:13 -0300	[thread overview]
Message-ID: <20151012130013.5b7dcbb0@recife.lan> (raw)
In-Reply-To: <20151012153504.GL26916@valkosipuli.retiisi.org.uk>

Em Mon, 12 Oct 2015 18:35:05 +0300
Sakari Ailus <sakari.ailus@iki.fi> escreveu:

> Hi Mauro,
> 
> On Sun, Oct 11, 2015 at 09:56:25PM -0300, Mauro Carvalho Chehab wrote:
> > Em Mon, 12 Oct 2015 00:07:52 +0300
> > Sakari Ailus <sakari.ailus@iki.fi> escreveu:
> > 
> > > Hi Mauro,
> > > 
> > > On Sun, Aug 30, 2015 at 12:06:43AM -0300, Mauro Carvalho Chehab wrote:
> > > > Instead of relying on media subtype, use the new macros to detect
> > > > if an entity is a subdev or an A/V DMA entity.
> > > > 
> > > > Please note that most drivers assume that there's just AV_DMA or
> > > > V4L2 subdevs. This is not true anymore, as we've added MC support
> > > > for DVB, and there are plans to add support for ALSA and FB/DRM
> > > > too.
> > > > 
> > > > Ok, on the current pipelines supported by those drivers, just V4L
> > > > stuff are there, but, assuming that some day a pipeline that also
> > > > works with other subsystems will ever added, it is better to add
> > > > explicit checks for the AV_DMA stuff.
> > > > 
> > > > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> > > > 
> > > > diff --git a/drivers/media/platform/exynos4-is/common.c b/drivers/media/platform/exynos4-is/common.c
> > > > index 0eb34ecb8ee4..8c9a29e0e294 100644
> > > > --- a/drivers/media/platform/exynos4-is/common.c
> > > > +++ b/drivers/media/platform/exynos4-is/common.c
> > > > @@ -22,8 +22,7 @@ struct v4l2_subdev *fimc_find_remote_sensor(struct media_entity *entity)
> > > >  	while (pad->flags & MEDIA_PAD_FL_SINK) {
> > > >  		/* source pad */
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > > diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c
> > > > index 0627a93b2f3b..e9810fee4c30 100644
> > > > --- a/drivers/media/platform/exynos4-is/fimc-capture.c
> > > > +++ b/drivers/media/platform/exynos4-is/fimc-capture.c
> > > > @@ -1141,8 +1141,7 @@ static int fimc_pipeline_validate(struct fimc_dev *fimc)
> > > >  			}
> > > >  		}
> > > >  
> > > > -		if (src_pad == NULL ||
> > > > -		    media_entity_type(src_pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!src_pad || !is_media_entity_v4l2_subdev(src_pad->entity))
> > > >  			break;
> > > >  
> > > >  		/* Don't call FIMC subdev operation to avoid nested locking */
> > > > @@ -1397,7 +1396,7 @@ static int fimc_link_setup(struct media_entity *entity,
> > > >  	struct fimc_vid_cap *vc = &fimc->vid_cap;
> > > >  	struct v4l2_subdev *sensor;
> > > >  
> > > > -	if (media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return -EINVAL;
> > > >  
> > > >  	if (WARN_ON(fimc == NULL))
> > > > diff --git a/drivers/media/platform/exynos4-is/fimc-isp-video.c b/drivers/media/platform/exynos4-is/fimc-isp-video.c
> > > > index 3d9ccbf5f10f..5fbaf5e39903 100644
> > > > --- a/drivers/media/platform/exynos4-is/fimc-isp-video.c
> > > > +++ b/drivers/media/platform/exynos4-is/fimc-isp-video.c
> > > > @@ -467,8 +467,7 @@ static int isp_video_pipeline_validate(struct fimc_isp *isp)
> > > >  
> > > >  		/* Retrieve format at the source pad */
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > > diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
> > > > index b2607da4ad14..c2327147b360 100644
> > > > --- a/drivers/media/platform/exynos4-is/fimc-lite.c
> > > > +++ b/drivers/media/platform/exynos4-is/fimc-lite.c
> > > > @@ -814,8 +814,7 @@ static int fimc_pipeline_validate(struct fimc_lite *fimc)
> > > >  		}
> > > >  		/* Retrieve format at the source pad */
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > > @@ -988,7 +987,6 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  {
> > > >  	struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity);
> > > >  	struct fimc_lite *fimc = v4l2_get_subdevdata(sd);
> > > > -	unsigned int remote_ent_type = media_entity_type(remote->entity);
> > > >  	int ret = 0;
> > > >  
> > > >  	if (WARN_ON(fimc == NULL))
> > > > @@ -1000,7 +998,7 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  
> > > >  	switch (local->index) {
> > > >  	case FLITE_SD_PAD_SINK:
> > > > -		if (remote_ent_type != MEDIA_ENT_T_V4L2_SUBDEV) {
> > > > +		if (!is_media_entity_v4l2_subdev(remote->entity)) {
> > > >  			ret = -EINVAL;
> > > >  			break;
> > > >  		}
> > > > @@ -1018,7 +1016,7 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  	case FLITE_SD_PAD_SOURCE_DMA:
> > > >  		if (!(flags & MEDIA_LNK_FL_ENABLED))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_NONE);
> > > > -		else if (remote_ent_type == MEDIA_ENT_T_DEVNODE)
> > > > +		else if (is_media_entity_v4l2_io(remote->entity))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_DMA);
> > > >  		else
> > > >  			ret = -EINVAL;
> > > > @@ -1027,7 +1025,7 @@ static int fimc_lite_link_setup(struct media_entity *entity,
> > > >  	case FLITE_SD_PAD_SOURCE_ISP:
> > > >  		if (!(flags & MEDIA_LNK_FL_ENABLED))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_NONE);
> > > > -		else if (remote_ent_type == MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		else if (is_media_entity_v4l2_subdev(remote->entity))
> > > >  			atomic_set(&fimc->out_path, FIMC_IO_ISP);
> > > >  		else
> > > >  			ret = -EINVAL;
> > > > diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c
> > > > index 92dbade2fffc..4a25df9dd869 100644
> > > > --- a/drivers/media/platform/exynos4-is/media-dev.c
> > > > +++ b/drivers/media/platform/exynos4-is/media-dev.c
> > > > @@ -88,8 +88,7 @@ static void fimc_pipeline_prepare(struct fimc_pipeline *p,
> > > >  				break;
> > > >  		}
> > > >  
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  		sd = media_entity_to_v4l2_subdev(pad->entity);
> > > >  
> > > > @@ -1062,7 +1061,7 @@ static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity))
> > > >  			continue;
> > > >  
> > > >  		ret  = __fimc_md_modify_pipeline(entity, enable);
> > > > @@ -1076,7 +1075,7 @@ static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable)
> > > >  	media_entity_graph_walk_start(&graph, entity_err);
> > > >  
> > > >  	while ((entity_err = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity_err) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity_err))
> > > >  			continue;
> > > >  
> > > >  		__fimc_md_modify_pipeline(entity_err, !enable);
> > > > diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
> > > > index 69e7733d36cd..cb8ac90086c1 100644
> > > > --- a/drivers/media/platform/omap3isp/isp.c
> > > > +++ b/drivers/media/platform/omap3isp/isp.c
> > > > @@ -691,7 +691,7 @@ static int isp_pipeline_pm_use_count(struct media_entity *entity)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_io(entity))
> > > >  			use += entity->use_count;
> > > >  	}
> > > >  
> > > > @@ -714,7 +714,7 @@ static int isp_pipeline_pm_power_one(struct media_entity *entity, int change)
> > > >  	struct v4l2_subdev *subdev;
> > > >  	int ret;
> > > >  
> > > > -	subdev = media_entity_type(entity) == MEDIA_ENT_T_V4L2_SUBDEV
> > > > +	subdev = is_media_entity_v4l2_subdev(entity)
> > > >  	       ? media_entity_to_v4l2_subdev(entity) : NULL;
> > > >  
> > > >  	if (entity->use_count == 0 && change > 0 && subdev != NULL) {
> > > > @@ -754,7 +754,7 @@ static int isp_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while (!ret && (entity = media_entity_graph_walk_next(&graph)))
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(entity))
> > > >  			ret = isp_pipeline_pm_power_one(entity, change);
> > > >  
> > > >  	if (!ret)
> > > > @@ -764,7 +764,7 @@ static int isp_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  
> > > >  	while ((first = media_entity_graph_walk_next(&graph))
> > > >  	       && first != entity)
> > > > -		if (media_entity_type(first) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(first))
> > > >  			isp_pipeline_pm_power_one(first, -change);
> > > >  
> > > >  	return ret;
> > > > @@ -897,8 +897,7 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe,
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > @@ -988,8 +987,7 @@ static int isp_pipeline_disable(struct isp_pipeline *pipe)
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
> > > > index 4c367352b1f7..52843ac2a9ca 100644
> > > > --- a/drivers/media/platform/omap3isp/ispvideo.c
> > > > +++ b/drivers/media/platform/omap3isp/ispvideo.c
> > > > @@ -210,8 +210,7 @@ isp_video_remote_subdev(struct isp_video *video, u32 *pad)
> > > >  
> > > >  	remote = media_entity_remote_pad(&video->pad);
> > > >  
> > > > -	if (remote == NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -243,7 +242,7 @@ static int isp_video_get_graph_data(struct isp_video *video,
> > > >  		if (entity == &video->video.entity)
> > > >  			continue;
> > > >  
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity))
> > > >  			continue;
> > > >  
> > > >  		__video = to_isp_video(media_entity_to_video_device(entity));
> > > > @@ -917,7 +916,7 @@ static int isp_video_check_external_subdevs(struct isp_video *video,
> > > >  		return -EINVAL;
> > > >  	}
> > > >  
> > > > -	if (media_entity_type(source) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!is_media_entity_v4l2_subdev(source))
> > > >  		return 0;
> > > >  
> > > >  	pipe->external = media_entity_to_v4l2_subdev(source);
> > > > diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c
> > > > index eae667eab1b9..fb5b016cc0a1 100644
> > > > --- a/drivers/media/platform/s3c-camif/camif-capture.c
> > > > +++ b/drivers/media/platform/s3c-camif/camif-capture.c
> > > > @@ -837,7 +837,7 @@ static int camif_pipeline_validate(struct camif_dev *camif)
> > > >  
> > > >  	/* Retrieve format at the sensor subdev source pad */
> > > >  	pad = media_entity_remote_pad(&camif->pads[0]);
> > > > -	if (!pad || media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  		return -EPIPE;
> > > >  
> > > >  	src_fmt.pad = pad->index;
> > > > diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
> > > > index 1f94c1a54e00..f74158224b93 100644
> > > > --- a/drivers/media/platform/vsp1/vsp1_video.c
> > > > +++ b/drivers/media/platform/vsp1/vsp1_video.c
> > > > @@ -160,8 +160,7 @@ vsp1_video_remote_subdev(struct media_pad *local, u32 *pad)
> > > >  	struct media_pad *remote;
> > > >  
> > > >  	remote = media_entity_remote_pad(local);
> > > > -	if (remote == NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -326,7 +325,7 @@ static int vsp1_pipeline_validate_branch(struct vsp1_pipeline *pipe,
> > > >  			return -EPIPE;
> > > >  
> > > >  		/* We've reached a video node, that shouldn't have happened. */
> > > > -		if (media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!is_media_entity_v4l2_subdev(pad->entity))
> > > >  			return -EPIPE;
> > > >  
> > > >  		entity = to_vsp1_entity(media_entity_to_v4l2_subdev(pad->entity));
> > > > @@ -423,7 +422,7 @@ static int vsp1_pipeline_validate(struct vsp1_pipeline *pipe,
> > > >  		struct vsp1_rwpf *rwpf;
> > > >  		struct vsp1_entity *e;
> > > >  
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_V4L2_SUBDEV) {
> > > > +		if (is_media_entity_v4l2_io(entity)) {
> > > >  			pipe->num_video++;
> > > >  			continue;
> > > >  		}
> > > > @@ -692,7 +691,7 @@ void vsp1_pipeline_propagate_alpha(struct vsp1_pipeline *pipe,
> > > >  	pad = media_entity_remote_pad(&input->pads[RWPF_PAD_SOURCE]);
> > > >  
> > > >  	while (pad) {
> > > > -		if (media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = to_vsp1_entity(media_entity_to_v4l2_subdev(pad->entity));
> > > > diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c
> > > > index 88cd789cdaf7..8e14841bf445 100644
> > > > --- a/drivers/media/platform/xilinx/xilinx-dma.c
> > > > +++ b/drivers/media/platform/xilinx/xilinx-dma.c
> > > > @@ -49,8 +49,7 @@ xvip_dma_remote_subdev(struct media_pad *local, u32 *pad)
> > > >  	struct media_pad *remote;
> > > >  
> > > >  	remote = media_entity_remote_pad(local);
> > > > -	if (remote == NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -113,8 +112,7 @@ static int xvip_pipeline_start_stop(struct xvip_pipeline *pipe, bool start)
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
> > > > index e6e1115d8215..60da43772de9 100644
> > > > --- a/drivers/media/v4l2-core/v4l2-subdev.c
> > > > +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> > > > @@ -526,7 +526,7 @@ static int
> > > >  v4l2_subdev_link_validate_get_format(struct media_pad *pad,
> > > >  				     struct v4l2_subdev_format *fmt)
> > > >  {
> > > > -	if (media_entity_type(pad->entity) == MEDIA_ENT_T_V4L2_SUBDEV) {
> > > > +	if (is_media_entity_v4l2_subdev(pad->entity)) {
> > > >  		struct v4l2_subdev *sd =
> > > >  			media_entity_to_v4l2_subdev(pad->entity);
> > > >  
> > > > diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c
> > > > index 92573fa852a9..16763e0831f2 100644
> > > > --- a/drivers/staging/media/davinci_vpfe/vpfe_video.c
> > > > +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c
> > > > @@ -148,7 +148,7 @@ static void vpfe_prepare_pipeline(struct vpfe_video_device *video)
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > >  		if (entity == &video->video_dev.entity)
> > > >  			continue;
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if ((!is_media_entity_v4l2_io(remote->entity))
> > > >  			continue;
> > > >  		far_end = to_vpfe_video(media_entity_to_video_device(entity));
> > > >  		if (far_end->type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
> > > > @@ -293,7 +293,7 @@ static int vpfe_pipeline_enable(struct vpfe_pipeline *pipe)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > >  
> > > > -		if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE)
> > > > +		if !is_media_entity_v4l2_subdev(entity))
> > > >  			continue;
> > > >  		subdev = media_entity_to_v4l2_subdev(entity);
> > > >  		ret = v4l2_subdev_call(subdev, video, s_stream, 1);
> > > > @@ -334,7 +334,7 @@ static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe)
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > >  
> > > > -		if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_subdev(entity))
> > > >  			continue;
> > > >  		subdev = media_entity_to_v4l2_subdev(entity);
> > > >  		ret = v4l2_subdev_call(subdev, video, s_stream, 0);
> > > > diff --git a/drivers/staging/media/omap4iss/iss.c b/drivers/staging/media/omap4iss/iss.c
> > > > index 40591963b42b..44b88ff3ba83 100644
> > > > --- a/drivers/staging/media/omap4iss/iss.c
> > > > +++ b/drivers/staging/media/omap4iss/iss.c
> > > > @@ -397,7 +397,7 @@ static int iss_pipeline_pm_use_count(struct media_entity *entity)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while ((entity = media_entity_graph_walk_next(&graph))) {
> > > > -		if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_io(entity))
> > > >  			use += entity->use_count;
> > > >  	}
> > > >  
> > > > @@ -419,7 +419,7 @@ static int iss_pipeline_pm_power_one(struct media_entity *entity, int change)
> > > >  {
> > > >  	struct v4l2_subdev *subdev;
> > > >  
> > > > -	subdev = media_entity_type(entity) == MEDIA_ENT_T_V4L2_SUBDEV
> > > > +	subdev = is_media_entity_v4l2_subdev(entity)
> > > >  	       ? media_entity_to_v4l2_subdev(entity) : NULL;
> > > >  
> > > >  	if (entity->use_count == 0 && change > 0 && subdev != NULL) {
> > > > @@ -461,7 +461,7 @@ static int iss_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  	media_entity_graph_walk_start(&graph, entity);
> > > >  
> > > >  	while (!ret && (entity = media_entity_graph_walk_next(&graph)))
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(entity))
> > > >  			ret = iss_pipeline_pm_power_one(entity, change);
> > > >  
> > > >  	if (!ret)
> > > > @@ -471,7 +471,7 @@ static int iss_pipeline_pm_power(struct media_entity *entity, int change)
> > > >  
> > > >  	while ((first = media_entity_graph_walk_next(&graph))
> > > >  	       && first != entity)
> > > > -		if (media_entity_type(first) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (is_media_entity_v4l2_subdev(first))
> > > >  			iss_pipeline_pm_power_one(first, -change);
> > > >  
> > > >  	return ret;
> > > > @@ -590,8 +590,7 @@ static int iss_pipeline_disable(struct iss_pipeline *pipe,
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > @@ -658,8 +657,7 @@ static int iss_pipeline_enable(struct iss_pipeline *pipe,
> > > >  			break;
> > > >  
> > > >  		pad = media_entity_remote_pad(pad);
> > > > -		if (pad == NULL ||
> > > > -		    media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +		if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
> > > >  			break;
> > > >  
> > > >  		entity = pad->entity;
> > > > diff --git a/drivers/staging/media/omap4iss/iss_video.c b/drivers/staging/media/omap4iss/iss_video.c
> > > > index 45a3f2d778fc..cbe5783735dc 100644
> > > > --- a/drivers/staging/media/omap4iss/iss_video.c
> > > > +++ b/drivers/staging/media/omap4iss/iss_video.c
> > > > @@ -191,8 +191,7 @@ iss_video_remote_subdev(struct iss_video *video, u32 *pad)
> > > >  
> > > >  	remote = media_entity_remote_pad(&video->pad);
> > > >  
> > > > -	if (remote == NULL ||
> > > > -	    media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
> > > > +	if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
> > > >  		return NULL;
> > > >  
> > > >  	if (pad)
> > > > @@ -217,7 +216,7 @@ iss_video_far_end(struct iss_video *video)
> > > >  		if (entity == &video->video.entity)
> > > >  			continue;
> > > >  
> > > > -		if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE)
> > > > +		if (!is_media_entity_v4l2_io(entity))
> > > >  			continue;
> > > >  
> > > >  		far_end = to_iss_video(media_entity_to_video_device(entity));
> > > 
> > > I finally got around to test these patches eventually, and after some
> > > debugging found this one. I think it's a good idea to have macros to
> > > determine whether an entity exposes a V4L2 sub-device interface but it
> > > should be more robust than is_media_entity_v4l2_subdev() right now is.
> > 
> > Hmm... Not sure what you're meaning... the V4L2 sub-device interface is
> > actually a separate graph object (interfaces). Those macros work at the
> > entities, not at the interface objects.
> 
> is_media_entity_v4l2_subdev() will produce wrong results for a large part of
> V4L2 sub-devices with these patches applied.
> 
> I checked again the original implementation, and it seems to be based only
> on the type as well, albeit that's a range, not a set of different
> functions.

Yes. As we're getting rid of ranges for subdevs, we need to change the
implementation. Your patch does the job by recognizing the "unknown"
subdevs.

> I suppose this will change at some point in the future: the interface indeed
> should not be determined by the function of the entity. At least it needs to
> be fixed now until the rework. I'll submit a patch for that.
> 

Thanks!

Mauro

  reply	other threads:[~2015-10-12 16:00 UTC|newest]

Thread overview: 309+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-30  3:06 [PATCH v8 00/55] MC next generation patches Mauro Carvalho Chehab
2015-08-30  3:06 ` Mauro Carvalho Chehab
2015-08-30  3:06 ` Mauro Carvalho Chehab
2015-08-30  3:06 ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 01/55] [media] media: create a macro to get entity ID Mauro Carvalho Chehab
2015-08-30  3:06   ` Mauro Carvalho Chehab
2015-09-10 13:58   ` Javier Martinez Canillas
2015-09-10 13:58     ` Javier Martinez Canillas
2015-12-06  3:20   ` Laurent Pinchart
2015-12-06  3:20     ` Laurent Pinchart
2015-08-30  3:06 ` [PATCH v8 02/55] [media] staging: omap4iss: get entity ID using media_entity_id() Mauro Carvalho Chehab
2015-12-06  3:18   ` Laurent Pinchart
2015-12-07 15:24     ` Javier Martinez Canillas
2015-08-30  3:06 ` [PATCH v8 03/55] [media] omap3isp: " Mauro Carvalho Chehab
2015-08-31 10:10   ` Hans Verkuil
2015-12-06  3:16   ` Laurent Pinchart
2015-12-07 15:22     ` Javier Martinez Canillas
2015-08-30  3:06 ` [PATCH v8 04/55] [media] media: add a common struct to be embed on media graph objects Mauro Carvalho Chehab
2015-09-09  7:01   ` Sakari Ailus
2015-09-09 11:10     ` Mauro Carvalho Chehab
2015-09-10 14:02   ` Javier Martinez Canillas
2015-08-30  3:06 ` [PATCH v8 05/55] [media] media: use media_gobj inside entities Mauro Carvalho Chehab
2015-09-10 14:04   ` Javier Martinez Canillas
2015-08-30  3:06 ` [PATCH v8 06/55] [media] media: use media_gobj inside pads Mauro Carvalho Chehab
2015-09-09  7:37   ` Sakari Ailus
2015-09-10 14:09   ` Javier Martinez Canillas
2015-08-30  3:06 ` [PATCH v8 07/55] [media] media: use media_gobj inside links Mauro Carvalho Chehab
2015-09-10 14:10   ` Javier Martinez Canillas
2015-08-30  3:06 ` [PATCH v8 08/55] [media] media: add messages when media device gets (un)registered Mauro Carvalho Chehab
2015-09-10 14:12   ` Javier Martinez Canillas
2015-08-30  3:06 ` [PATCH v8 09/55] [media] media: add a debug message to warn about gobj creation/removal Mauro Carvalho Chehab
2015-09-10 14:14   ` Javier Martinez Canillas
2015-08-30  3:06 ` [PATCH v8 10/55] [media] media: rename the function that create pad links Mauro Carvalho Chehab
2015-08-30  3:06   ` Mauro Carvalho Chehab
2015-08-30  3:06   ` Mauro Carvalho Chehab
2015-08-30  3:06   ` Mauro Carvalho Chehab
2015-09-10 14:16   ` Javier Martinez Canillas
2015-09-10 14:16     ` Javier Martinez Canillas
2015-09-10 14:16     ` Javier Martinez Canillas
2015-09-10 14:16     ` Javier Martinez Canillas
2015-08-30  3:06 ` [PATCH v8 11/55] [media] media: use entity.graph_obj.mdev instead of .parent Mauro Carvalho Chehab
2015-08-30  3:06   ` Mauro Carvalho Chehab
2015-08-30  3:06   ` Mauro Carvalho Chehab
2015-08-30  3:06   ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 12/55] [media] media: remove media entity .parent field Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 13/55] [media] uapi/media.h: Declare interface types for V4L2 and DVB Mauro Carvalho Chehab
2015-09-10 14:19   ` Javier Martinez Canillas
2015-09-10 14:19     ` Javier Martinez Canillas
2015-08-30  3:06 ` [PATCH v8 14/55] [media] media: add functions to allow creating interfaces Mauro Carvalho Chehab
2015-08-31 10:20   ` Hans Verkuil
2015-08-31 10:49     ` Mauro Carvalho Chehab
2015-09-06 12:02   ` Mauro Carvalho Chehab
2015-09-09  7:34     ` Sakari Ailus
2015-09-09 10:00       ` Mauro Carvalho Chehab
2015-09-10 14:22     ` Javier Martinez Canillas
2015-09-11 12:57     ` Hans Verkuil
2015-12-08 14:36       ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 15/55] [media] uapi/media.h: Declare interface types for ALSA Mauro Carvalho Chehab
2015-09-06 12:02   ` Mauro Carvalho Chehab
2015-09-06 12:02     ` Mauro Carvalho Chehab
2015-09-10 14:23     ` Javier Martinez Canillas
2015-08-30  3:06 ` [PATCH v8 16/55] [media] media: Don't accept early-created links Mauro Carvalho Chehab
2015-08-31 10:30   ` Hans Verkuil
2015-08-31 10:54     ` Mauro Carvalho Chehab
2015-08-31 11:01       ` Hans Verkuil
2015-08-31 14:39         ` Javier Martinez Canillas
2015-08-31 15:05           ` Mauro Carvalho Chehab
2015-09-06 12:02   ` Mauro Carvalho Chehab
2015-12-06  3:13     ` Laurent Pinchart
2015-08-30  3:06 ` [PATCH v8 17/55] [media] omap3isp: separate links creation from entities init Mauro Carvalho Chehab
2015-11-23 15:55   ` Laurent Pinchart
2015-11-23 16:22     ` Javier Martinez Canillas
2015-08-30  3:06 ` [PATCH v8 18/55] [media] omap3isp: create links after all subdevs have been bound Mauro Carvalho Chehab
2015-09-09  8:03   ` Sakari Ailus
2015-09-09  8:48     ` Javier Martinez Canillas
2015-12-06  3:05       ` Laurent Pinchart
2015-12-07 15:17         ` Javier Martinez Canillas
2015-09-09 10:28     ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 19/55] [media] media: convert links from array to list Mauro Carvalho Chehab
2015-09-04  8:41   ` Sakari Ailus
2015-09-04  9:00     ` Hans Verkuil
2015-09-04 11:10       ` Mauro Carvalho Chehab
2015-09-04 11:28   ` [PATCH v8.1 " Mauro Carvalho Chehab
2015-09-04 11:48     ` [PATCH v8.2 " Mauro Carvalho Chehab
2015-09-06 12:02       ` Mauro Carvalho Chehab
2015-11-23 15:37         ` Laurent Pinchart
2015-11-23 15:41           ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 20/55] [media] media: make add link more generic Mauro Carvalho Chehab
2015-08-31 10:44   ` Hans Verkuil
2015-09-06 12:02   ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 21/55] [media] media: make media_link more generic to handle interace links Mauro Carvalho Chehab
2015-08-31 10:44   ` Hans Verkuil
2015-09-06 12:02   ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 22/55] [media] media: make link debug printk more generic Mauro Carvalho Chehab
2015-09-06 12:02   ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 23/55] [media] media: add support to link interfaces and entities Mauro Carvalho Chehab
2015-08-31 10:48   ` Hans Verkuil
2015-09-06 12:02   ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 24/55] [media] media-entity: add a helper function to create interface Mauro Carvalho Chehab
2015-08-31 10:49   ` Hans Verkuil
2015-09-06 12:02   ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 25/55] [media] dvbdev: add support for interfaces Mauro Carvalho Chehab
2015-08-31 10:51   ` Hans Verkuil
2015-08-30  3:06 ` [PATCH v8 26/55] [media] media: add a linked list to track interfaces by mdev Mauro Carvalho Chehab
2015-08-31 10:52   ` Hans Verkuil
2015-09-06 12:02   ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 27/55] [media] dvbdev: add support for indirect interface links Mauro Carvalho Chehab
2015-08-31 10:54   ` Hans Verkuil
2015-09-06 12:02   ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 28/55] [media] uapi/media.h: Fix entity namespace Mauro Carvalho Chehab
2015-08-31 11:17   ` Hans Verkuil
2015-08-31 12:12     ` Mauro Carvalho Chehab
2015-09-06 12:02   ` Mauro Carvalho Chehab
2015-09-06 12:02     ` Mauro Carvalho Chehab
2015-09-11 13:06     ` Hans Verkuil
2015-09-11 13:06       ` Hans Verkuil
2015-08-30  3:06 ` [PATCH v8 29/55] [media] replace all occurrences of MEDIA_ENT_T_DEVNODE_V4L Mauro Carvalho Chehab
2015-08-30  3:06   ` Mauro Carvalho Chehab
2015-08-31 11:22   ` Hans Verkuil
2015-08-31 11:22     ` Hans Verkuil
2015-08-30  3:06 ` [PATCH v8 30/55] [media] replace all occurrences of MEDIA_ENT_T_DEVNODE_DVB Mauro Carvalho Chehab
2015-08-31 11:21   ` Hans Verkuil
2015-08-30  3:06 ` [PATCH v8 31/55] [media] media: add macros to check if subdev or V4L2 DMA Mauro Carvalho Chehab
2015-08-31 11:31   ` Hans Verkuil
2015-08-31 11:40     ` Hans Verkuil
2015-08-31 13:08     ` Mauro Carvalho Chehab
2015-08-31 13:46       ` Hans Verkuil
2015-09-06 12:02   ` Mauro Carvalho Chehab
2015-12-06  2:20     ` Laurent Pinchart
2015-12-08 15:41       ` Mauro Carvalho Chehab
2016-02-16  0:34         ` Laurent Pinchart
2015-08-30  3:06 ` [PATCH v8 32/55] [media] media: use macros to check for V4L2 subdev entities Mauro Carvalho Chehab
2015-08-30  3:06   ` Mauro Carvalho Chehab
2015-08-30  3:06   ` Mauro Carvalho Chehab
2015-08-30  3:06   ` Mauro Carvalho Chehab
2015-10-11 21:07   ` Sakari Ailus
2015-10-11 21:07     ` Sakari Ailus
2015-10-11 21:07     ` Sakari Ailus
2015-10-11 21:07     ` Sakari Ailus
2015-10-12  0:56     ` Mauro Carvalho Chehab
2015-10-12  0:56       ` Mauro Carvalho Chehab
2015-10-12  0:56       ` Mauro Carvalho Chehab
2015-10-12  0:56       ` Mauro Carvalho Chehab
2015-10-12 15:35       ` Sakari Ailus
2015-10-12 15:35         ` Sakari Ailus
2015-10-12 15:35         ` Sakari Ailus
2015-10-12 15:35         ` Sakari Ailus
2015-10-12 16:00         ` Mauro Carvalho Chehab [this message]
2015-10-12 16:00           ` Mauro Carvalho Chehab
2015-10-12 16:00           ` Mauro Carvalho Chehab
2015-10-12 16:00           ` Mauro Carvalho Chehab
2015-12-08 15:57         ` Mauro Carvalho Chehab
2015-12-08 17:05           ` Mauro Carvalho Chehab
2015-12-08 17:08             ` Mauro Carvalho Chehab
2015-10-12 15:38       ` [PATCH 1/1] media: Correctly determine whether an entity is a sub-device Sakari Ailus
2015-10-12 15:38         ` Sakari Ailus
2015-10-12 15:38         ` Sakari Ailus
2015-10-12 15:58         ` Mauro Carvalho Chehab
2015-10-12 15:58           ` Mauro Carvalho Chehab
2015-10-12 15:58           ` Mauro Carvalho Chehab
2015-10-12 15:58           ` Mauro Carvalho Chehab
2015-12-06  2:16   ` [PATCH v8 32/55] [media] media: use macros to check for V4L2 subdev entities Laurent Pinchart
2015-12-06  2:16     ` Laurent Pinchart
2015-12-06  2:16     ` Laurent Pinchart
2015-12-08 16:03     ` Mauro Carvalho Chehab
2015-12-08 16:03       ` Mauro Carvalho Chehab
2015-12-08 16:03       ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 33/55] [media] omap3/omap4/davinci: get rid of MEDIA_ENT_T_V4L2_SUBDEV abuse Mauro Carvalho Chehab
2015-12-06  2:08   ` Laurent Pinchart
2015-12-08 16:52     ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 34/55] [media] s5c73m3: fix subdev type Mauro Carvalho Chehab
2015-12-06  1:57   ` Laurent Pinchart
2015-12-08 17:11     ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 35/55] [media] s5k5baf: " Mauro Carvalho Chehab
2015-12-06  1:55   ` Laurent Pinchart
2015-12-08 17:17     ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 36/55] [media] davinci_vbpe: stop MEDIA_ENT_T_V4L2_SUBDEV abuse Mauro Carvalho Chehab
2015-12-06  1:52   ` Laurent Pinchart
2015-12-08 17:22     ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 37/55] [media] omap4iss: " Mauro Carvalho Chehab
2015-12-06  1:46   ` Laurent Pinchart
2015-12-08 17:47     ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 38/55] [media] v4l2-subdev: use MEDIA_ENT_T_UNKNOWN for new subdevs Mauro Carvalho Chehab
2015-08-31 11:43   ` Hans Verkuil
2015-08-31 11:43     ` Hans Verkuil
2015-09-06 12:02   ` Mauro Carvalho Chehab
2015-12-06  1:37     ` Laurent Pinchart
2015-12-08 17:38       ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 39/55] [media] media controller: get rid of entity subtype on Kernel Mauro Carvalho Chehab
2015-08-31 11:44   ` Hans Verkuil
2015-08-31 11:44     ` Hans Verkuil
2015-09-06 12:02   ` Mauro Carvalho Chehab
2015-09-06 12:02     ` Mauro Carvalho Chehab
2015-09-11 13:08     ` Hans Verkuil
2015-09-11 13:08       ` Hans Verkuil
2015-12-06  1:03     ` Laurent Pinchart
2015-12-06  1:03       ` Laurent Pinchart
2015-08-30  3:06 ` [PATCH v8 40/55] [media] media.h: don't use legacy entity macros at Kernel Mauro Carvalho Chehab
2015-08-30  3:06   ` Mauro Carvalho Chehab
2015-08-31 11:44   ` Hans Verkuil
2015-08-31 11:44     ` Hans Verkuil
2015-09-06 12:03   ` Mauro Carvalho Chehab
2015-09-06 12:03     ` Mauro Carvalho Chehab
2015-12-06  1:02     ` Laurent Pinchart
2015-12-06  1:02       ` Laurent Pinchart
2015-08-30  3:06 ` [PATCH v8 41/55] [media] DocBook: update descriptions for the media controller entities Mauro Carvalho Chehab
2015-08-31 11:22   ` Hans Verkuil
2015-09-06 12:03   ` Mauro Carvalho Chehab
2015-09-11 13:13     ` Hans Verkuil
2015-12-06  1:00       ` Laurent Pinchart
2015-12-08 18:04         ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 42/55] [media] dvb: modify core to implement interfaces/entities at MC new gen Mauro Carvalho Chehab
2015-08-31 11:49   ` Hans Verkuil
2015-09-06 12:03   ` Mauro Carvalho Chehab
2015-09-11 13:51     ` Hans Verkuil
2015-08-30  3:06 ` [PATCH v8 43/55] [media] media: report if a pad is sink or source at debug msg Mauro Carvalho Chehab
2015-08-31 11:51   ` Hans Verkuil
2015-09-06 12:03   ` Mauro Carvalho Chehab
2015-09-11 13:52     ` Hans Verkuil
2015-12-06  0:53     ` Laurent Pinchart
2015-12-08 18:46       ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 44/55] [media] uapi/media.h: Add MEDIA_IOC_G_TOPOLOGY ioctl Mauro Carvalho Chehab
2015-08-31 12:00   ` Hans Verkuil
2015-08-31 13:35     ` Mauro Carvalho Chehab
2015-08-31 13:35       ` Mauro Carvalho Chehab
2015-09-06 12:03   ` Mauro Carvalho Chehab
2015-09-06 12:03     ` Mauro Carvalho Chehab
2015-09-11 13:58     ` Hans Verkuil
2015-09-11 13:58       ` Hans Verkuil
2015-12-06  0:47     ` Laurent Pinchart
2015-12-06  0:47       ` Laurent Pinchart
2015-12-08 19:23       ` Mauro Carvalho Chehab
2015-12-08 19:48         ` Arnd Bergmann
2015-12-08 19:48           ` Arnd Bergmann
2015-08-30  3:06 ` [PATCH v8 45/55] [media] media: Use a macro to interate between all interfaces Mauro Carvalho Chehab
2015-08-31 12:01   ` Hans Verkuil
2015-09-06 12:03   ` Mauro Carvalho Chehab
2015-11-23 22:36     ` Laurent Pinchart
2015-08-30  3:06 ` [PATCH v8 46/55] [media] media: move mdev list init to gobj Mauro Carvalho Chehab
2015-08-31 12:03   ` Hans Verkuil
2015-09-06 12:03   ` Mauro Carvalho Chehab
2015-09-11 13:59     ` Hans Verkuil
2015-11-23 22:32     ` Laurent Pinchart
2015-12-08 19:31       ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 47/55] [media] media-device: add pads and links to media_device Mauro Carvalho Chehab
2015-08-31 12:25   ` Hans Verkuil
2015-09-06 12:03   ` Mauro Carvalho Chehab
2015-11-23 22:28     ` Laurent Pinchart
2015-11-24 12:19       ` Mauro Carvalho Chehab
2015-08-30  3:06 ` [PATCH v8 48/55] [media] media_device: add a topology version field Mauro Carvalho Chehab
2015-08-31 12:29   ` Hans Verkuil
2015-08-31 12:52     ` Mauro Carvalho Chehab
2015-08-31 13:35       ` Hans Verkuil
2015-09-04 17:08         ` Mauro Carvalho Chehab
2015-11-23 22:18           ` Laurent Pinchart
2015-12-08 20:05             ` Mauro Carvalho Chehab
2015-11-23 22:20     ` Laurent Pinchart
2015-09-06 12:03   ` Mauro Carvalho Chehab
2015-09-11 13:59     ` Hans Verkuil
2015-08-30  3:07 ` [PATCH v8 49/55] [media] media-device: add support for MEDIA_IOC_G_TOPOLOGY ioctl Mauro Carvalho Chehab
2015-08-31 12:47   ` Hans Verkuil
2015-08-31 13:40     ` Mauro Carvalho Chehab
2015-08-31 13:48       ` Hans Verkuil
2015-09-06 12:03   ` Mauro Carvalho Chehab
2015-09-07 22:18     ` Sakari Ailus
2015-09-08  1:23       ` Mauro Carvalho Chehab
2015-09-08  7:26         ` Sakari Ailus
2015-09-08 10:49           ` Mauro Carvalho Chehab
2015-09-08 13:34             ` Sakari Ailus
2015-09-08 15:11               ` Mauro Carvalho Chehab
2015-09-11 14:08     ` Hans Verkuil
2015-12-08 20:20       ` Mauro Carvalho Chehab
2015-11-23 22:04     ` Laurent Pinchart
2015-12-08 20:17       ` Mauro Carvalho Chehab
2015-08-30  3:07 ` [PATCH v8 50/55] [media] media-entity: unregister entity links Mauro Carvalho Chehab
2015-08-31 12:48   ` Hans Verkuil
2015-09-06 12:03   ` Mauro Carvalho Chehab
2015-11-23 21:27     ` Laurent Pinchart
2015-12-08 20:23       ` Mauro Carvalho Chehab
2015-08-30  3:07 ` [PATCH v8 51/55] [media] remove interface links at media_entity_unregister() Mauro Carvalho Chehab
2015-08-31 12:53   ` Hans Verkuil
2015-08-31 13:42     ` Mauro Carvalho Chehab
2015-09-06 12:03   ` Mauro Carvalho Chehab
2015-09-11 14:18     ` Hans Verkuil
2015-08-30  3:07 ` [PATCH v8 52/55] [media] media-device: remove interfaces and interface links Mauro Carvalho Chehab
2015-08-31 12:57   ` Hans Verkuil
2015-09-06 12:03   ` Mauro Carvalho Chehab
2015-09-11 14:20     ` Hans Verkuil
2015-11-23 21:22     ` Laurent Pinchart
2015-12-09 13:39       ` Mauro Carvalho Chehab
2015-08-30  3:07 ` [PATCH v8 53/55] [media] v4l2-core: create MC interfaces for devnodes Mauro Carvalho Chehab
2015-08-31 13:23   ` Hans Verkuil
2015-09-04 16:13     ` Mauro Carvalho Chehab
2015-09-06 12:03   ` Mauro Carvalho Chehab
2015-09-11 14:38     ` Hans Verkuil
2015-11-23 21:10     ` Laurent Pinchart
2015-11-24 11:25       ` Mauro Carvalho Chehab
2015-08-30  3:07 ` [PATCH v8 54/55] [media] au0828: unregister MC at the end Mauro Carvalho Chehab
2015-08-31 13:25   ` Hans Verkuil
2015-09-04 22:24     ` Mauro Carvalho Chehab
2015-08-30  3:07 ` [PATCH v8 55/55] [media] media-entity.h: document all the structs Mauro Carvalho Chehab
2015-09-06 12:03   ` Mauro Carvalho Chehab
2015-09-11 14:45     ` Hans Verkuil
2015-11-23 20:19     ` Laurent Pinchart
2015-12-10 18:16       ` Mauro Carvalho Chehab
2015-08-30 14:27 ` [PATCH v8 00/55] MC next generation patches Mauro Carvalho Chehab
2015-08-30 14:27   ` Mauro Carvalho Chehab
2015-08-30 14:27   ` Mauro Carvalho Chehab
2015-08-30 14:27   ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151012130013.5b7dcbb0@recife.lan \
    --to=mchehab@osg.samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.