linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: imx7-media-csi: get csi upstream endpoint
@ 2019-06-11 15:09 Rui Miguel Silva
  2019-06-12  7:43 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Rui Miguel Silva @ 2019-06-11 15:09 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: devel, linux-media, Rui Miguel Silva, Sebastien Szymanski

When the upstream endpoint is neither a mux nor a CSI2 module, just get
the source pad directly upstream from the CSI.

Fixes: 05f634040c0d ("media: staging/imx7: add imx7 CSI subdev driver")
Reported-by: Sebastien Szymanski <sebastien.szymanski@armadeus.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
 drivers/staging/media/imx/imx7-media-csi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c
index 9101566f3f67..8979ee0c8202 100644
--- a/drivers/staging/media/imx/imx7-media-csi.c
+++ b/drivers/staging/media/imx/imx7-media-csi.c
@@ -442,6 +442,14 @@ static int imx7_csi_get_upstream_endpoint(struct imx7_csi *csi,
 
 	src = &csi->src_sd->entity;
 
+	/*
+	 * if the source in neither a mux or csi2 get the one directly upstream
+	 * from this csi
+	 */
+	if (src->function != MEDIA_ENT_F_VID_IF_BRIDGE &&
+		src->function != MEDIA_ENT_F_VID_MUX)
+		src = &csi->sd.entity;
+
 skip_video_mux:
 	/* get source pad of entity directly upstream from src */
 	pad = imx_media_pipeline_pad(src, 0, 0, true);
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] media: imx7-media-csi: get csi upstream endpoint
  2019-06-11 15:09 [PATCH] media: imx7-media-csi: get csi upstream endpoint Rui Miguel Silva
@ 2019-06-12  7:43 ` Dan Carpenter
  2019-06-12  9:50   ` Rui Miguel Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2019-06-12  7:43 UTC (permalink / raw)
  To: Rui Miguel Silva; +Cc: Hans Verkuil, devel, Sebastien Szymanski, linux-media

On Tue, Jun 11, 2019 at 04:09:55PM +0100, Rui Miguel Silva wrote:
> When the upstream endpoint is neither a mux nor a CSI2 module, just get
> the source pad directly upstream from the CSI.
> 
> Fixes: 05f634040c0d ("media: staging/imx7: add imx7 CSI subdev driver")
> Reported-by: Sebastien Szymanski <sebastien.szymanski@armadeus.com>
> Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
> ---
>  drivers/staging/media/imx/imx7-media-csi.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c
> index 9101566f3f67..8979ee0c8202 100644
> --- a/drivers/staging/media/imx/imx7-media-csi.c
> +++ b/drivers/staging/media/imx/imx7-media-csi.c
> @@ -442,6 +442,14 @@ static int imx7_csi_get_upstream_endpoint(struct imx7_csi *csi,
>  
>  	src = &csi->src_sd->entity;
>  
> +	/*
> +	 * if the source in neither a mux or csi2 get the one directly upstream
                         ^^
is?

> +	 * from this csi
> +	 */
> +	if (src->function != MEDIA_ENT_F_VID_IF_BRIDGE &&
> +		src->function != MEDIA_ENT_F_VID_MUX)
> +		src = &csi->sd.entity;

This would be easier to read if the white space were tweaked a little:

	if (src->function != MEDIA_ENT_F_VID_IF_BRIDGE &&
	    src->function != MEDIA_ENT_F_VID_MUX)
		src = &csi->sd.entity;

regards,
dan carpenter



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] media: imx7-media-csi: get csi upstream endpoint
  2019-06-12  7:43 ` Dan Carpenter
@ 2019-06-12  9:50   ` Rui Miguel Silva
  0 siblings, 0 replies; 3+ messages in thread
From: Rui Miguel Silva @ 2019-06-12  9:50 UTC (permalink / raw)
  To: driverdev-devel; +Cc: Hans Verkuil, devel, Sebastien Szymanski, linux-media

Hi Dan,
On Wed 12 Jun 2019 at 08:43, Dan Carpenter wrote:
> On Tue, Jun 11, 2019 at 04:09:55PM +0100, Rui Miguel Silva wrote:
>> When the upstream endpoint is neither a mux nor a CSI2 module, just get
>> the source pad directly upstream from the CSI.
>>
>> Fixes: 05f634040c0d ("media: staging/imx7: add imx7 CSI subdev driver")
>> Reported-by: Sebastien Szymanski <sebastien.szymanski@armadeus.com>
>> Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
>> ---
>>  drivers/staging/media/imx/imx7-media-csi.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c
>> index 9101566f3f67..8979ee0c8202 100644
>> --- a/drivers/staging/media/imx/imx7-media-csi.c
>> +++ b/drivers/staging/media/imx/imx7-media-csi.c
>> @@ -442,6 +442,14 @@ static int imx7_csi_get_upstream_endpoint(struct imx7_csi *csi,
>>
>>  	src = &csi->src_sd->entity;
>>
>> +	/*
>> +	 * if the source in neither a mux or csi2 get the one directly upstream
>                          ^^
> is?

yup.

>
>> +	 * from this csi
>> +	 */
>> +	if (src->function != MEDIA_ENT_F_VID_IF_BRIDGE &&
>> +		src->function != MEDIA_ENT_F_VID_MUX)
>> +		src = &csi->sd.entity;
>
> This would be easier to read if the white space were tweaked a little:
>
> 	if (src->function != MEDIA_ENT_F_VID_IF_BRIDGE &&
> 	    src->function != MEDIA_ENT_F_VID_MUX)
> 		src = &csi->sd.entity;

Agreed, Thanks for the feedback.

---
Cheers,
	Rui


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-12  9:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11 15:09 [PATCH] media: imx7-media-csi: get csi upstream endpoint Rui Miguel Silva
2019-06-12  7:43 ` Dan Carpenter
2019-06-12  9:50   ` Rui Miguel Silva

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).