diff mbox series

media: camss: use proper media entity function for subdevices

Message ID 20200409112404.21071-1-andrey.konovalov@linaro.org (mailing list archive)
State New, archived
Headers show
Series media: camss: use proper media entity function for subdevices | expand

Commit Message

Andrey Konovalov April 9, 2020, 11:24 a.m. UTC
Currently for msm_csiphy, msm_csid, and msm_ispif subdevices the media
entity function field is set to MEDIA_ENT_F_IO_V4L. This is incorrect
as MEDIA_ENT_F_IO_V4L implies V4L2 video node.

Change it to MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER as this is the best
fit from the functions defined in include/uapi/linux/media.h.

Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
---
 drivers/media/platform/qcom/camss/camss-csid.c   | 2 +-
 drivers/media/platform/qcom/camss/camss-csiphy.c | 2 +-
 drivers/media/platform/qcom/camss/camss-ispif.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

Robert Foss April 9, 2020, 11:29 a.m. UTC | #1
Hey Andrey,

Thanks for sending this out. I've tested this patch on a db410c board.

Tested-by: Robert Foss <robert.foss@linaro.org>


On Thu, 9 Apr 2020 at 13:24, Andrey Konovalov
<andrey.konovalov@linaro.org> wrote:
>
> Currently for msm_csiphy, msm_csid, and msm_ispif subdevices the media
> entity function field is set to MEDIA_ENT_F_IO_V4L. This is incorrect
> as MEDIA_ENT_F_IO_V4L implies V4L2 video node.
>
> Change it to MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER as this is the best
> fit from the functions defined in include/uapi/linux/media.h.
>
> Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
> ---
>  drivers/media/platform/qcom/camss/camss-csid.c   | 2 +-
>  drivers/media/platform/qcom/camss/camss-csiphy.c | 2 +-
>  drivers/media/platform/qcom/camss/camss-ispif.c  | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
> index a5ae85674ffb..721d7434253e 100644
> --- a/drivers/media/platform/qcom/camss/camss-csid.c
> +++ b/drivers/media/platform/qcom/camss/camss-csid.c
> @@ -1356,7 +1356,7 @@ int msm_csid_register_entity(struct csid_device *csid,
>         pads[MSM_CSID_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
>         pads[MSM_CSID_PAD_SRC].flags = MEDIA_PAD_FL_SOURCE;
>
> -       sd->entity.function = MEDIA_ENT_F_IO_V4L;
> +       sd->entity.function = MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER;
>         sd->entity.ops = &csid_media_ops;
>         ret = media_entity_pads_init(&sd->entity, MSM_CSID_PADS_NUM, pads);
>         if (ret < 0) {
> diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c
> index 008afb85023b..03ef9c5f4774 100644
> --- a/drivers/media/platform/qcom/camss/camss-csiphy.c
> +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c
> @@ -737,7 +737,7 @@ int msm_csiphy_register_entity(struct csiphy_device *csiphy,
>         pads[MSM_CSIPHY_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
>         pads[MSM_CSIPHY_PAD_SRC].flags = MEDIA_PAD_FL_SOURCE;
>
> -       sd->entity.function = MEDIA_ENT_F_IO_V4L;
> +       sd->entity.function = MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER;
>         sd->entity.ops = &csiphy_media_ops;
>         ret = media_entity_pads_init(&sd->entity, MSM_CSIPHY_PADS_NUM, pads);
>         if (ret < 0) {
> diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c b/drivers/media/platform/qcom/camss/camss-ispif.c
> index 1f33b4eb198c..f04cdeafbcac 100644
> --- a/drivers/media/platform/qcom/camss/camss-ispif.c
> +++ b/drivers/media/platform/qcom/camss/camss-ispif.c
> @@ -1323,7 +1323,7 @@ int msm_ispif_register_entities(struct ispif_device *ispif,
>                 pads[MSM_ISPIF_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
>                 pads[MSM_ISPIF_PAD_SRC].flags = MEDIA_PAD_FL_SOURCE;
>
> -               sd->entity.function = MEDIA_ENT_F_IO_V4L;
> +               sd->entity.function = MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER;
>                 sd->entity.ops = &ispif_media_ops;
>                 ret = media_entity_pads_init(&sd->entity, MSM_ISPIF_PADS_NUM,
>                                              pads);
> --
> 2.17.1
>
Robert Foss June 23, 2020, 8:49 a.m. UTC | #2
Reviewed-by: Robert Foss <robert.foss@linaro.org>

On Thu, 9 Apr 2020 at 13:29, Robert Foss <robert.foss@linaro.org> wrote:
>
> Hey Andrey,
>
> Thanks for sending this out. I've tested this patch on a db410c board.
>
> Tested-by: Robert Foss <robert.foss@linaro.org>
>
>
> On Thu, 9 Apr 2020 at 13:24, Andrey Konovalov
> <andrey.konovalov@linaro.org> wrote:
> >
> > Currently for msm_csiphy, msm_csid, and msm_ispif subdevices the media
> > entity function field is set to MEDIA_ENT_F_IO_V4L. This is incorrect
> > as MEDIA_ENT_F_IO_V4L implies V4L2 video node.
> >
> > Change it to MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER as this is the best
> > fit from the functions defined in include/uapi/linux/media.h.
> >
> > Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
> > ---
> >  drivers/media/platform/qcom/camss/camss-csid.c   | 2 +-
> >  drivers/media/platform/qcom/camss/camss-csiphy.c | 2 +-
> >  drivers/media/platform/qcom/camss/camss-ispif.c  | 2 +-
> >  3 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
> > index a5ae85674ffb..721d7434253e 100644
> > --- a/drivers/media/platform/qcom/camss/camss-csid.c
> > +++ b/drivers/media/platform/qcom/camss/camss-csid.c
> > @@ -1356,7 +1356,7 @@ int msm_csid_register_entity(struct csid_device *csid,
> >         pads[MSM_CSID_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
> >         pads[MSM_CSID_PAD_SRC].flags = MEDIA_PAD_FL_SOURCE;
> >
> > -       sd->entity.function = MEDIA_ENT_F_IO_V4L;
> > +       sd->entity.function = MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER;
> >         sd->entity.ops = &csid_media_ops;
> >         ret = media_entity_pads_init(&sd->entity, MSM_CSID_PADS_NUM, pads);
> >         if (ret < 0) {
> > diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c
> > index 008afb85023b..03ef9c5f4774 100644
> > --- a/drivers/media/platform/qcom/camss/camss-csiphy.c
> > +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c
> > @@ -737,7 +737,7 @@ int msm_csiphy_register_entity(struct csiphy_device *csiphy,
> >         pads[MSM_CSIPHY_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
> >         pads[MSM_CSIPHY_PAD_SRC].flags = MEDIA_PAD_FL_SOURCE;
> >
> > -       sd->entity.function = MEDIA_ENT_F_IO_V4L;
> > +       sd->entity.function = MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER;
> >         sd->entity.ops = &csiphy_media_ops;
> >         ret = media_entity_pads_init(&sd->entity, MSM_CSIPHY_PADS_NUM, pads);
> >         if (ret < 0) {
> > diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c b/drivers/media/platform/qcom/camss/camss-ispif.c
> > index 1f33b4eb198c..f04cdeafbcac 100644
> > --- a/drivers/media/platform/qcom/camss/camss-ispif.c
> > +++ b/drivers/media/platform/qcom/camss/camss-ispif.c
> > @@ -1323,7 +1323,7 @@ int msm_ispif_register_entities(struct ispif_device *ispif,
> >                 pads[MSM_ISPIF_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
> >                 pads[MSM_ISPIF_PAD_SRC].flags = MEDIA_PAD_FL_SOURCE;
> >
> > -               sd->entity.function = MEDIA_ENT_F_IO_V4L;
> > +               sd->entity.function = MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER;

At some point in the future it is possible that the ispif could
support memory to memory operations, and then MEDIA_ENT_F_IO_V4L might
be correct. But until then I'd say that this change is what we want.

> >                 sd->entity.ops = &ispif_media_ops;
> >                 ret = media_entity_pads_init(&sd->entity, MSM_ISPIF_PADS_NUM,
> >                                              pads);
> > --
> > 2.17.1
> >
diff mbox series

Patch

diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
index a5ae85674ffb..721d7434253e 100644
--- a/drivers/media/platform/qcom/camss/camss-csid.c
+++ b/drivers/media/platform/qcom/camss/camss-csid.c
@@ -1356,7 +1356,7 @@  int msm_csid_register_entity(struct csid_device *csid,
 	pads[MSM_CSID_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
 	pads[MSM_CSID_PAD_SRC].flags = MEDIA_PAD_FL_SOURCE;
 
-	sd->entity.function = MEDIA_ENT_F_IO_V4L;
+	sd->entity.function = MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER;
 	sd->entity.ops = &csid_media_ops;
 	ret = media_entity_pads_init(&sd->entity, MSM_CSID_PADS_NUM, pads);
 	if (ret < 0) {
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c
index 008afb85023b..03ef9c5f4774 100644
--- a/drivers/media/platform/qcom/camss/camss-csiphy.c
+++ b/drivers/media/platform/qcom/camss/camss-csiphy.c
@@ -737,7 +737,7 @@  int msm_csiphy_register_entity(struct csiphy_device *csiphy,
 	pads[MSM_CSIPHY_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
 	pads[MSM_CSIPHY_PAD_SRC].flags = MEDIA_PAD_FL_SOURCE;
 
-	sd->entity.function = MEDIA_ENT_F_IO_V4L;
+	sd->entity.function = MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER;
 	sd->entity.ops = &csiphy_media_ops;
 	ret = media_entity_pads_init(&sd->entity, MSM_CSIPHY_PADS_NUM, pads);
 	if (ret < 0) {
diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c b/drivers/media/platform/qcom/camss/camss-ispif.c
index 1f33b4eb198c..f04cdeafbcac 100644
--- a/drivers/media/platform/qcom/camss/camss-ispif.c
+++ b/drivers/media/platform/qcom/camss/camss-ispif.c
@@ -1323,7 +1323,7 @@  int msm_ispif_register_entities(struct ispif_device *ispif,
 		pads[MSM_ISPIF_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
 		pads[MSM_ISPIF_PAD_SRC].flags = MEDIA_PAD_FL_SOURCE;
 
-		sd->entity.function = MEDIA_ENT_F_IO_V4L;
+		sd->entity.function = MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER;
 		sd->entity.ops = &ispif_media_ops;
 		ret = media_entity_pads_init(&sd->entity, MSM_ISPIF_PADS_NUM,
 					     pads);