* [PATCH 0/5] [media] Create pads links after entities registration
@ 2015-09-03 16:00 Javier Martinez Canillas
2015-09-03 16:00 ` [PATCH 2/5] [media] v4l: vsp1: create pad links after subdev registration Javier Martinez Canillas
2015-09-03 16:00 ` [PATCH 3/5] [media] v4l: vsp1: separate links creation from entities init Javier Martinez Canillas
0 siblings, 2 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2015-09-03 16:00 UTC (permalink / raw)
To: linux-kernel
Cc: Hans Verkuil, Javier Martinez Canillas, devel, Sakari Ailus,
linux-sh, Mauro Carvalho Chehab, Greg Kroah-Hartman,
Laurent Pinchart, linux-media
Hello,
This series changes all the MC media drivers that are currently creating
pads links before registering the media entities with the media device.
The patches are similar to the ones posted for the OMAP3 ISP driver [0]
and depends on Mauro's "[PATCH v8 00/55] MC next generation patches" [1].
The patches just moves the entities registration logic before pads links
creation and in the case of the vsp1, split the pads links creationg from
the entities initialization logic as it was made for the OMAP3 ISP driver.
Unfortunately I don't have hardware to test these patches and they were
only build tested. So testing that I didn't introduce any regression will
be highly appreciated.
[0]: https://lkml.org/lkml/2015/8/26/453
[1]: http://www.spinics.net/lists/linux-samsung-soc/msg47089.html
Best regards,
Javier
Javier Martinez Canillas (5):
[media] staging: omap4iss: separate links creation from entities init
[media] v4l: vsp1: create pad links after subdev registration
[media] v4l: vsp1: separate links creation from entities init
[media] uvcvideo: create pad links after subdev registration
[media] smiapp: create pad links after subdev registration
drivers/media/i2c/smiapp/smiapp-core.c | 20 +++---
drivers/media/platform/vsp1/vsp1_drv.c | 30 +++++---
drivers/media/platform/vsp1/vsp1_rpf.c | 29 +++++---
drivers/media/platform/vsp1/vsp1_rwpf.h | 5 ++
drivers/media/platform/vsp1/vsp1_wpf.c | 40 +++++++----
drivers/media/usb/uvc/uvc_entity.c | 16 +++--
drivers/staging/media/omap4iss/iss.c | 101 ++++++++++++++++++---------
drivers/staging/media/omap4iss/iss_csi2.c | 35 +++++++---
drivers/staging/media/omap4iss/iss_csi2.h | 1 +
drivers/staging/media/omap4iss/iss_ipipeif.c | 29 ++++----
drivers/staging/media/omap4iss/iss_ipipeif.h | 1 +
drivers/staging/media/omap4iss/iss_resizer.c | 29 ++++----
drivers/staging/media/omap4iss/iss_resizer.h | 1 +
13 files changed, 224 insertions(+), 113 deletions(-)
--
2.4.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/5] [media] v4l: vsp1: create pad links after subdev registration
2015-09-03 16:00 [PATCH 0/5] [media] Create pads links after entities registration Javier Martinez Canillas
@ 2015-09-03 16:00 ` Javier Martinez Canillas
2015-12-06 2:46 ` Laurent Pinchart
2015-09-03 16:00 ` [PATCH 3/5] [media] v4l: vsp1: separate links creation from entities init Javier Martinez Canillas
1 sibling, 1 reply; 6+ messages in thread
From: Javier Martinez Canillas @ 2015-09-03 16:00 UTC (permalink / raw)
To: linux-kernel
Cc: Hans Verkuil, Javier Martinez Canillas, Mauro Carvalho Chehab,
linux-sh, Laurent Pinchart, linux-media
The vsp1 driver creates the pads links before the media entities are
registered with the media device. This doesn't work now that object
IDs are used to create links so the media_device has to be set.
Move entities registration logic before pads links creation.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/media/platform/vsp1/vsp1_drv.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c
index 9cd94a76a9ed..2aa427d3ff39 100644
--- a/drivers/media/platform/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/vsp1/vsp1_drv.c
@@ -250,6 +250,14 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
list_add_tail(&wpf->entity.list_dev, &vsp1->entities);
}
+ /* Register all subdevs. */
+ list_for_each_entry(entity, &vsp1->entities, list_dev) {
+ ret = v4l2_device_register_subdev(&vsp1->v4l2_dev,
+ &entity->subdev);
+ if (ret < 0)
+ goto done;
+ }
+
/* Create links. */
list_for_each_entry(entity, &vsp1->entities, list_dev) {
if (entity->type = VSP1_ENTITY_LIF ||
@@ -269,14 +277,6 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
return ret;
}
- /* Register all subdevs. */
- list_for_each_entry(entity, &vsp1->entities, list_dev) {
- ret = v4l2_device_register_subdev(&vsp1->v4l2_dev,
- &entity->subdev);
- if (ret < 0)
- goto done;
- }
-
ret = v4l2_device_register_subdev_nodes(&vsp1->v4l2_dev);
done:
--
2.4.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] [media] v4l: vsp1: separate links creation from entities init
2015-09-03 16:00 [PATCH 0/5] [media] Create pads links after entities registration Javier Martinez Canillas
2015-09-03 16:00 ` [PATCH 2/5] [media] v4l: vsp1: create pad links after subdev registration Javier Martinez Canillas
@ 2015-09-03 16:00 ` Javier Martinez Canillas
2015-12-06 2:51 ` Laurent Pinchart
1 sibling, 1 reply; 6+ messages in thread
From: Javier Martinez Canillas @ 2015-09-03 16:00 UTC (permalink / raw)
To: linux-kernel
Cc: Hans Verkuil, Javier Martinez Canillas, Mauro Carvalho Chehab,
linux-sh, Laurent Pinchart, linux-media
The vsp1 driver initializes the entities and creates the pads links
before the entities are registered with the media device. This doesn't
work now that object IDs are used to create links so the media_device
has to be set.
Split out the pads links creation from the entity initialization so are
made after the entities registration.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/media/platform/vsp1/vsp1_drv.c | 14 ++++++++++--
drivers/media/platform/vsp1/vsp1_rpf.c | 29 ++++++++++++++++--------
drivers/media/platform/vsp1/vsp1_rwpf.h | 5 +++++
drivers/media/platform/vsp1/vsp1_wpf.c | 40 ++++++++++++++++++++-------------
4 files changed, 62 insertions(+), 26 deletions(-)
diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c
index 2aa427d3ff39..8f995d267646 100644
--- a/drivers/media/platform/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/vsp1/vsp1_drv.c
@@ -260,9 +260,19 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
/* Create links. */
list_for_each_entry(entity, &vsp1->entities, list_dev) {
- if (entity->type = VSP1_ENTITY_LIF ||
- entity->type = VSP1_ENTITY_RPF)
+ if (entity->type = VSP1_ENTITY_LIF) {
+ ret = vsp1_wpf_create_pads_links(vsp1, entity);
+ if (ret < 0)
+ goto done;
+ continue;
+ }
+
+ if (entity->type = VSP1_ENTITY_RPF) {
+ ret = vsp1_rpf_create_pads_links(vsp1, entity);
+ if (ret < 0)
+ goto done;
continue;
+ }
ret = vsp1_create_links(vsp1, entity);
if (ret < 0)
diff --git a/drivers/media/platform/vsp1/vsp1_rpf.c b/drivers/media/platform/vsp1/vsp1_rpf.c
index b60a528a8fe8..38aebdf691b5 100644
--- a/drivers/media/platform/vsp1/vsp1_rpf.c
+++ b/drivers/media/platform/vsp1/vsp1_rpf.c
@@ -277,18 +277,29 @@ struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index)
rpf->entity.video = video;
- /* Connect the video device to the RPF. */
- ret = media_create_pad_link(&rpf->video.video.entity, 0,
- &rpf->entity.subdev.entity,
- RWPF_PAD_SINK,
- MEDIA_LNK_FL_ENABLED |
- MEDIA_LNK_FL_IMMUTABLE);
- if (ret < 0)
- goto error;
-
return rpf;
error:
vsp1_entity_destroy(&rpf->entity);
return ERR_PTR(ret);
}
+
+/*
+ * vsp1_rpf_create_pads_links_create_pads_links() - RPF pads links creation
+ * @vsp1: Pointer to VSP1 device
+ * @entity: Pointer to VSP1 entity
+ *
+ * return negative error code or zero on success
+ */
+int vsp1_rpf_create_pads_links(struct vsp1_device *vsp1,
+ struct vsp1_entity *entity)
+{
+ struct vsp1_rwpf *rpf = to_rwpf(&entity->subdev);
+
+ /* Connect the video device to the RPF. */
+ return media_create_pad_link(&rpf->video.video.entity, 0,
+ &rpf->entity.subdev.entity,
+ RWPF_PAD_SINK,
+ MEDIA_LNK_FL_ENABLED |
+ MEDIA_LNK_FL_IMMUTABLE);
+}
diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.h b/drivers/media/platform/vsp1/vsp1_rwpf.h
index f452dce1a931..6638b3587369 100644
--- a/drivers/media/platform/vsp1/vsp1_rwpf.h
+++ b/drivers/media/platform/vsp1/vsp1_rwpf.h
@@ -50,6 +50,11 @@ static inline struct vsp1_rwpf *to_rwpf(struct v4l2_subdev *subdev)
struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index);
struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device *vsp1, unsigned int index);
+int vsp1_rpf_create_pads_links(struct vsp1_device *vsp1,
+ struct vsp1_entity *entity);
+int vsp1_wpf_create_pads_links(struct vsp1_device *vsp1,
+ struct vsp1_entity *entity);
+
int vsp1_rwpf_enum_mbus_code(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_mbus_code_enum *code);
diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c b/drivers/media/platform/vsp1/vsp1_wpf.c
index d39aa4b8aea1..1be363e4f741 100644
--- a/drivers/media/platform/vsp1/vsp1_wpf.c
+++ b/drivers/media/platform/vsp1/vsp1_wpf.c
@@ -220,7 +220,6 @@ struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device *vsp1, unsigned int index)
struct v4l2_subdev *subdev;
struct vsp1_video *video;
struct vsp1_rwpf *wpf;
- unsigned int flags;
int ret;
wpf = devm_kzalloc(vsp1->dev, sizeof(*wpf), GFP_KERNEL);
@@ -276,20 +275,6 @@ struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device *vsp1, unsigned int index)
goto error;
wpf->entity.video = video;
-
- /* Connect the video device to the WPF. All connections are immutable
- * except for the WPF0 source link if a LIF is present.
- */
- flags = MEDIA_LNK_FL_ENABLED;
- if (!(vsp1->pdata.features & VSP1_HAS_LIF) || index != 0)
- flags |= MEDIA_LNK_FL_IMMUTABLE;
-
- ret = media_create_pad_link(&wpf->entity.subdev.entity,
- RWPF_PAD_SOURCE,
- &wpf->video.video.entity, 0, flags);
- if (ret < 0)
- goto error;
-
wpf->entity.sink = &wpf->video.video.entity;
return wpf;
@@ -298,3 +283,28 @@ error:
vsp1_entity_destroy(&wpf->entity);
return ERR_PTR(ret);
}
+
+/*
+ * vsp1_wpf_create_pads_links_create_pads_links() - RPF pads links creation
+ * @vsp1: Pointer to VSP1 device
+ * @entity: Pointer to VSP1 entity
+ *
+ * return negative error code or zero on success
+ */
+int vsp1_wpf_create_pads_links(struct vsp1_device *vsp1,
+ struct vsp1_entity *entity)
+{
+ struct vsp1_rwpf *wpf = to_rwpf(&entity->subdev);
+ unsigned int flags;
+
+ /* Connect the video device to the WPF. All connections are immutable
+ * except for the WPF0 source link if a LIF is present.
+ */
+ flags = MEDIA_LNK_FL_ENABLED;
+ if (!(vsp1->pdata.features & VSP1_HAS_LIF) || entity->index != 0)
+ flags |= MEDIA_LNK_FL_IMMUTABLE;
+
+ return media_create_pad_link(&wpf->entity.subdev.entity,
+ RWPF_PAD_SOURCE,
+ &wpf->video.video.entity, 0, flags);
+}
--
2.4.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/5] [media] v4l: vsp1: create pad links after subdev registration
2015-09-03 16:00 ` [PATCH 2/5] [media] v4l: vsp1: create pad links after subdev registration Javier Martinez Canillas
@ 2015-12-06 2:46 ` Laurent Pinchart
0 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2015-12-06 2:46 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel, Hans Verkuil, Mauro Carvalho Chehab, linux-sh,
linux-media
Hi Javier,
Thank you for the patch.
On Thursday 03 September 2015 18:00:33 Javier Martinez Canillas wrote:
> The vsp1 driver creates the pads links before the media entities are
> registered with the media device. This doesn't work now that object
> IDs are used to create links so the media_device has to be set.
>
> Move entities registration logic before pads links creation.
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>
> drivers/media/platform/vsp1/vsp1_drv.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/platform/vsp1/vsp1_drv.c
> b/drivers/media/platform/vsp1/vsp1_drv.c index 9cd94a76a9ed..2aa427d3ff39
> 100644
> --- a/drivers/media/platform/vsp1/vsp1_drv.c
> +++ b/drivers/media/platform/vsp1/vsp1_drv.c
> @@ -250,6 +250,14 @@ static int vsp1_create_entities(struct vsp1_device
> *vsp1) list_add_tail(&wpf->entity.list_dev, &vsp1->entities);
> }
>
> + /* Register all subdevs. */
> + list_for_each_entry(entity, &vsp1->entities, list_dev) {
> + ret = v4l2_device_register_subdev(&vsp1->v4l2_dev,
> + &entity->subdev);
> + if (ret < 0)
> + goto done;
> + }
> +
> /* Create links. */
> list_for_each_entry(entity, &vsp1->entities, list_dev) {
> if (entity->type = VSP1_ENTITY_LIF ||
> @@ -269,14 +277,6 @@ static int vsp1_create_entities(struct vsp1_device
> *vsp1) return ret;
> }
>
> - /* Register all subdevs. */
> - list_for_each_entry(entity, &vsp1->entities, list_dev) {
> - ret = v4l2_device_register_subdev(&vsp1->v4l2_dev,
> - &entity->subdev);
> - if (ret < 0)
> - goto done;
> - }
> -
> ret = v4l2_device_register_subdev_nodes(&vsp1->v4l2_dev);
>
> done:
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/5] [media] v4l: vsp1: separate links creation from entities init
2015-09-03 16:00 ` [PATCH 3/5] [media] v4l: vsp1: separate links creation from entities init Javier Martinez Canillas
@ 2015-12-06 2:51 ` Laurent Pinchart
2015-12-07 15:08 ` Javier Martinez Canillas
0 siblings, 1 reply; 6+ messages in thread
From: Laurent Pinchart @ 2015-12-06 2:51 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel, Hans Verkuil, Mauro Carvalho Chehab, linux-sh,
linux-media
Hi Javier,
Thank you for the patch.
On Thursday 03 September 2015 18:00:34 Javier Martinez Canillas wrote:
> The vsp1 driver initializes the entities and creates the pads links
> before the entities are registered with the media device. This doesn't
> work now that object IDs are used to create links so the media_device
> has to be set.
>
> Split out the pads links creation from the entity initialization so are
> made after the entities registration.
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> ---
>
> drivers/media/platform/vsp1/vsp1_drv.c | 14 ++++++++++--
> drivers/media/platform/vsp1/vsp1_rpf.c | 29 ++++++++++++++++--------
> drivers/media/platform/vsp1/vsp1_rwpf.h | 5 +++++
> drivers/media/platform/vsp1/vsp1_wpf.c | 40 +++++++++++++++++-------------
> 4 files changed, 62 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/media/platform/vsp1/vsp1_drv.c
> b/drivers/media/platform/vsp1/vsp1_drv.c index 2aa427d3ff39..8f995d267646
> 100644
> --- a/drivers/media/platform/vsp1/vsp1_drv.c
> +++ b/drivers/media/platform/vsp1/vsp1_drv.c
> @@ -260,9 +260,19 @@ static int vsp1_create_entities(struct vsp1_device
> *vsp1)
>
> /* Create links. */
> list_for_each_entry(entity, &vsp1->entities, list_dev) {
> - if (entity->type = VSP1_ENTITY_LIF ||
> - entity->type = VSP1_ENTITY_RPF)
> + if (entity->type = VSP1_ENTITY_LIF) {
> + ret = vsp1_wpf_create_pads_links(vsp1, entity);
Could you please s/pads_links/links/ ? There's no other type of links handled
by the driver.
> + if (ret < 0)
> + goto done;
> + continue;
I would use
} else if (...) {
instead of a continue.
> + }
> +
> + if (entity->type = VSP1_ENTITY_RPF) {
> + ret = vsp1_rpf_create_pads_links(vsp1, entity);
> + if (ret < 0)
> + goto done;
> continue;
Same here.
Apart from that,
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> + }
>
> ret = vsp1_create_links(vsp1, entity);
> if (ret < 0)
> diff --git a/drivers/media/platform/vsp1/vsp1_rpf.c
> b/drivers/media/platform/vsp1/vsp1_rpf.c index b60a528a8fe8..38aebdf691b5
> 100644
> --- a/drivers/media/platform/vsp1/vsp1_rpf.c
> +++ b/drivers/media/platform/vsp1/vsp1_rpf.c
> @@ -277,18 +277,29 @@ struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device
> *vsp1, unsigned int index)
>
> rpf->entity.video = video;
>
> - /* Connect the video device to the RPF. */
> - ret = media_create_pad_link(&rpf->video.video.entity, 0,
> - &rpf->entity.subdev.entity,
> - RWPF_PAD_SINK,
> - MEDIA_LNK_FL_ENABLED |
> - MEDIA_LNK_FL_IMMUTABLE);
> - if (ret < 0)
> - goto error;
> -
> return rpf;
>
> error:
> vsp1_entity_destroy(&rpf->entity);
> return ERR_PTR(ret);
> }
> +
> +/*
> + * vsp1_rpf_create_pads_links_create_pads_links() - RPF pads links creation
> + * @vsp1: Pointer to VSP1 device
> + * @entity: Pointer to VSP1 entity
> + *
> + * return negative error code or zero on success
> + */
> +int vsp1_rpf_create_pads_links(struct vsp1_device *vsp1,
> + struct vsp1_entity *entity)
> +{
> + struct vsp1_rwpf *rpf = to_rwpf(&entity->subdev);
> +
> + /* Connect the video device to the RPF. */
> + return media_create_pad_link(&rpf->video.video.entity, 0,
> + &rpf->entity.subdev.entity,
> + RWPF_PAD_SINK,
> + MEDIA_LNK_FL_ENABLED |
> + MEDIA_LNK_FL_IMMUTABLE);
> +}
> diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.h
> b/drivers/media/platform/vsp1/vsp1_rwpf.h index f452dce1a931..6638b3587369
> 100644
> --- a/drivers/media/platform/vsp1/vsp1_rwpf.h
> +++ b/drivers/media/platform/vsp1/vsp1_rwpf.h
> @@ -50,6 +50,11 @@ static inline struct vsp1_rwpf *to_rwpf(struct
> v4l2_subdev *subdev) struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device
> *vsp1, unsigned int index); struct vsp1_rwpf *vsp1_wpf_create(struct
> vsp1_device *vsp1, unsigned int index);
>
> +int vsp1_rpf_create_pads_links(struct vsp1_device *vsp1,
> + struct vsp1_entity *entity);
> +int vsp1_wpf_create_pads_links(struct vsp1_device *vsp1,
> + struct vsp1_entity *entity);
> +
> int vsp1_rwpf_enum_mbus_code(struct v4l2_subdev *subdev,
> struct v4l2_subdev_pad_config *cfg,
> struct v4l2_subdev_mbus_code_enum *code);
> diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c
> b/drivers/media/platform/vsp1/vsp1_wpf.c index d39aa4b8aea1..1be363e4f741
> 100644
> --- a/drivers/media/platform/vsp1/vsp1_wpf.c
> +++ b/drivers/media/platform/vsp1/vsp1_wpf.c
> @@ -220,7 +220,6 @@ struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device
> *vsp1, unsigned int index) struct v4l2_subdev *subdev;
> struct vsp1_video *video;
> struct vsp1_rwpf *wpf;
> - unsigned int flags;
> int ret;
>
> wpf = devm_kzalloc(vsp1->dev, sizeof(*wpf), GFP_KERNEL);
> @@ -276,20 +275,6 @@ struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device
> *vsp1, unsigned int index) goto error;
>
> wpf->entity.video = video;
> -
> - /* Connect the video device to the WPF. All connections are immutable
> - * except for the WPF0 source link if a LIF is present.
> - */
> - flags = MEDIA_LNK_FL_ENABLED;
> - if (!(vsp1->pdata.features & VSP1_HAS_LIF) || index != 0)
> - flags |= MEDIA_LNK_FL_IMMUTABLE;
> -
> - ret = media_create_pad_link(&wpf->entity.subdev.entity,
> - RWPF_PAD_SOURCE,
> - &wpf->video.video.entity, 0, flags);
> - if (ret < 0)
> - goto error;
> -
> wpf->entity.sink = &wpf->video.video.entity;
>
> return wpf;
> @@ -298,3 +283,28 @@ error:
> vsp1_entity_destroy(&wpf->entity);
> return ERR_PTR(ret);
> }
> +
> +/*
> + * vsp1_wpf_create_pads_links_create_pads_links() - RPF pads links creation
> + * @vsp1: Pointer to VSP1 device
> + * @entity: Pointer to VSP1 entity
> + *
> + * return negative error code or zero on success
> + */
> +int vsp1_wpf_create_pads_links(struct vsp1_device *vsp1,
> + struct vsp1_entity *entity)
> +{
> + struct vsp1_rwpf *wpf = to_rwpf(&entity->subdev);
> + unsigned int flags;
> +
> + /* Connect the video device to the WPF. All connections are immutable
> + * except for the WPF0 source link if a LIF is present.
> + */
> + flags = MEDIA_LNK_FL_ENABLED;
> + if (!(vsp1->pdata.features & VSP1_HAS_LIF) || entity->index != 0)
> + flags |= MEDIA_LNK_FL_IMMUTABLE;
> +
> + return media_create_pad_link(&wpf->entity.subdev.entity,
> + RWPF_PAD_SOURCE,
> + &wpf->video.video.entity, 0, flags);
> +}
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/5] [media] v4l: vsp1: separate links creation from entities init
2015-12-06 2:51 ` Laurent Pinchart
@ 2015-12-07 15:08 ` Javier Martinez Canillas
0 siblings, 0 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2015-12-07 15:08 UTC (permalink / raw)
To: Laurent Pinchart
Cc: linux-kernel, Hans Verkuil, Mauro Carvalho Chehab, linux-sh,
linux-media
Hello Laurent,
On 12/05/2015 11:51 PM, Laurent Pinchart wrote:
> Hi Javier,
>
> Thank you for the patch.
>
Thanks for your feedback.
> On Thursday 03 September 2015 18:00:34 Javier Martinez Canillas wrote:
>> The vsp1 driver initializes the entities and creates the pads links
>> before the entities are registered with the media device. This doesn't
>> work now that object IDs are used to create links so the media_device
>> has to be set.
>>
>> Split out the pads links creation from the entity initialization so are
>> made after the entities registration.
>>
>> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
>> ---
>>
>> drivers/media/platform/vsp1/vsp1_drv.c | 14 ++++++++++--
>> drivers/media/platform/vsp1/vsp1_rpf.c | 29 ++++++++++++++++--------
>> drivers/media/platform/vsp1/vsp1_rwpf.h | 5 +++++
>> drivers/media/platform/vsp1/vsp1_wpf.c | 40 +++++++++++++++++-------------
>> 4 files changed, 62 insertions(+), 26 deletions(-)
>>
>> diff --git a/drivers/media/platform/vsp1/vsp1_drv.c
>> b/drivers/media/platform/vsp1/vsp1_drv.c index 2aa427d3ff39..8f995d267646
>> 100644
>> --- a/drivers/media/platform/vsp1/vsp1_drv.c
>> +++ b/drivers/media/platform/vsp1/vsp1_drv.c
>> @@ -260,9 +260,19 @@ static int vsp1_create_entities(struct vsp1_device
>> *vsp1)
>>
>> /* Create links. */
>> list_for_each_entry(entity, &vsp1->entities, list_dev) {
>> - if (entity->type = VSP1_ENTITY_LIF ||
>> - entity->type = VSP1_ENTITY_RPF)
>> + if (entity->type = VSP1_ENTITY_LIF) {
>> + ret = vsp1_wpf_create_pads_links(vsp1, entity);
>
> Could you please s/pads_links/links/ ? There's no other type of links handled
> by the driver.
>
Sure, I'll do that for all the drivers that only handle pad links.
>> + if (ret < 0)
>> + goto done;
>> + continue;
>
> I would use
>
> } else if (...) {
>
> instead of a continue.
>
Yes, that will be better indeed.
>> + }
>> +
>> + if (entity->type = VSP1_ENTITY_RPF) {
>> + ret = vsp1_rpf_create_pads_links(vsp1, entity);
>> + if (ret < 0)
>> + goto done;
>> continue;
>
> Same here.
>
Ok.
> Apart from that,
>
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
Thanks.
Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-12-07 15:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-03 16:00 [PATCH 0/5] [media] Create pads links after entities registration Javier Martinez Canillas
2015-09-03 16:00 ` [PATCH 2/5] [media] v4l: vsp1: create pad links after subdev registration Javier Martinez Canillas
2015-12-06 2:46 ` Laurent Pinchart
2015-09-03 16:00 ` [PATCH 3/5] [media] v4l: vsp1: separate links creation from entities init Javier Martinez Canillas
2015-12-06 2:51 ` Laurent Pinchart
2015-12-07 15:08 ` Javier Martinez Canillas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).