[PATCH 11/15] media: soc_camera: soc_scale_crop: Use correct pad number in try_fmt

2015-06-25 Thread William Towle
From: Rob Taylor 

Fix calls to subdev try_fmt function to use valid pad numbers, fixing
the case where subdevs (eg. ADV7612) have valid pad numbers that are
non-zero.

Signed-off-by: William Towle 
Reviewed-by: Rob Taylor 
---
 drivers/media/platform/soc_camera/soc_scale_crop.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/soc_camera/soc_scale_crop.c 
b/drivers/media/platform/soc_camera/soc_scale_crop.c
index bda29bc..2772215 100644
--- a/drivers/media/platform/soc_camera/soc_scale_crop.c
+++ b/drivers/media/platform/soc_camera/soc_scale_crop.c
@@ -225,6 +225,7 @@ static int client_set_fmt(struct soc_camera_device *icd,
bool host_1to1;
int ret;
 
+   format->pad = icd->src_pad_idx;
ret = v4l2_device_call_until_err(sd->v4l2_dev,
 soc_camera_grp_id(icd), pad,
 set_fmt, NULL, format);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 11/15] media: soc_camera: soc_scale_crop: Use correct pad number in try_fmt

2015-06-20 Thread Guennadi Liakhovetski
On Wed, 3 Jun 2015, William Towle wrote:

> From: Rob Taylor 
> 
> Fix calls to subdev try_fmt to use correct pad. Fixes failures with
> subdevs that care about having the right pad number set.
> 
> Signed-off-by: William Towle 
> Reviewed-by: Rob Taylor 
> ---
>  drivers/media/platform/soc_camera/soc_scale_crop.c |   10 ++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/media/platform/soc_camera/soc_scale_crop.c 
> b/drivers/media/platform/soc_camera/soc_scale_crop.c
> index bda29bc..90e2769 100644
> --- a/drivers/media/platform/soc_camera/soc_scale_crop.c
> +++ b/drivers/media/platform/soc_camera/soc_scale_crop.c
> @@ -225,6 +225,10 @@ static int client_set_fmt(struct soc_camera_device *icd,
>   bool host_1to1;
>   int ret;
>  
> +#if defined(CONFIG_MEDIA_CONTROLLER)
> + format->pad = icd->src_pad_idx;
> +#endif
> +
>   ret = v4l2_device_call_until_err(sd->v4l2_dev,
>soc_camera_grp_id(icd), pad,
>set_fmt, NULL, format);
> @@ -261,10 +265,16 @@ static int client_set_fmt(struct soc_camera_device *icd,
>   /* width <= max_width && height <= max_height - guaranteed by try_fmt */
>   while ((width > tmp_w || height > tmp_h) &&
>  tmp_w < max_width && tmp_h < max_height) {
> +
>   tmp_w = min(2 * tmp_w, max_width);
>   tmp_h = min(2 * tmp_h, max_height);
>   mf->width = tmp_w;
>   mf->height = tmp_h;
> +
> +#if defined(CONFIG_MEDIA_CONTROLLER)
> + format->pad = icd->src_pad_idx;

BTW, can format->pad be changed by subdev's .set_fmt()? Do you really have 
to set it in a loop?

Thanks
Guennadi

> +#endif
> +
>   ret = v4l2_device_call_until_err(sd->v4l2_dev,
>   soc_camera_grp_id(icd), pad,
>   set_fmt, NULL, format);
> -- 
> 1.7.10.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in


Re: [PATCH 11/15] media: soc_camera: soc_scale_crop: Use correct pad number in try_fmt

2015-06-20 Thread Guennadi Liakhovetski
On Wed, 3 Jun 2015, William Towle wrote:

> From: Rob Taylor 
> 
> Fix calls to subdev try_fmt to use correct pad. Fixes failures with
> subdevs that care about having the right pad number set.
> 
> Signed-off-by: William Towle 
> Reviewed-by: Rob Taylor 
> ---
>  drivers/media/platform/soc_camera/soc_scale_crop.c |   10 ++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/media/platform/soc_camera/soc_scale_crop.c 
> b/drivers/media/platform/soc_camera/soc_scale_crop.c
> index bda29bc..90e2769 100644
> --- a/drivers/media/platform/soc_camera/soc_scale_crop.c
> +++ b/drivers/media/platform/soc_camera/soc_scale_crop.c
> @@ -225,6 +225,10 @@ static int client_set_fmt(struct soc_camera_device *icd,
>   bool host_1to1;
>   int ret;
>  
> +#if defined(CONFIG_MEDIA_CONTROLLER)
> + format->pad = icd->src_pad_idx;
> +#endif
> +
>   ret = v4l2_device_call_until_err(sd->v4l2_dev,
>soc_camera_grp_id(icd), pad,
>set_fmt, NULL, format);
> @@ -261,10 +265,16 @@ static int client_set_fmt(struct soc_camera_device *icd,
>   /* width <= max_width && height <= max_height - guaranteed by try_fmt */
>   while ((width > tmp_w || height > tmp_h) &&
>  tmp_w < max_width && tmp_h < max_height) {
> +

I usually don't use an empty line directly after an opening brace. Please, 
drop.

Thanks
Guennadi

>   tmp_w = min(2 * tmp_w, max_width);
>   tmp_h = min(2 * tmp_h, max_height);
>   mf->width = tmp_w;
>   mf->height = tmp_h;
> +
> +#if defined(CONFIG_MEDIA_CONTROLLER)
> + format->pad = icd->src_pad_idx;
> +#endif
> +
>   ret = v4l2_device_call_until_err(sd->v4l2_dev,
>   soc_camera_grp_id(icd), pad,
>   set_fmt, NULL, format);
> -- 
> 1.7.10.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in


Re: [PATCH 11/15] media: soc_camera: soc_scale_crop: Use correct pad number in try_fmt

2015-06-12 Thread Hans Verkuil
On 06/03/2015 03:59 PM, William Towle wrote:
> From: Rob Taylor 
> 
> Fix calls to subdev try_fmt to use correct pad. Fixes failures with
> subdevs that care about having the right pad number set.
> 
> Signed-off-by: William Towle 
> Reviewed-by: Rob Taylor 
> ---
>  drivers/media/platform/soc_camera/soc_scale_crop.c |   10 ++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/media/platform/soc_camera/soc_scale_crop.c 
> b/drivers/media/platform/soc_camera/soc_scale_crop.c
> index bda29bc..90e2769 100644
> --- a/drivers/media/platform/soc_camera/soc_scale_crop.c
> +++ b/drivers/media/platform/soc_camera/soc_scale_crop.c
> @@ -225,6 +225,10 @@ static int client_set_fmt(struct soc_camera_device *icd,
>   bool host_1to1;
>   int ret;
>  
> +#if defined(CONFIG_MEDIA_CONTROLLER)
> + format->pad = icd->src_pad_idx;
> +#endif

As mentioned in the review of patch 9 it should be possible to drop the
#if defined() here.

> +
>   ret = v4l2_device_call_until_err(sd->v4l2_dev,
>soc_camera_grp_id(icd), pad,
>set_fmt, NULL, format);
> @@ -261,10 +265,16 @@ static int client_set_fmt(struct soc_camera_device *icd,
>   /* width <= max_width && height <= max_height - guaranteed by try_fmt */
>   while ((width > tmp_w || height > tmp_h) &&
>  tmp_w < max_width && tmp_h < max_height) {
> +

Spurious whitespace change.

>   tmp_w = min(2 * tmp_w, max_width);
>   tmp_h = min(2 * tmp_h, max_height);
>   mf->width = tmp_w;
>   mf->height = tmp_h;
> +
> +#if defined(CONFIG_MEDIA_CONTROLLER)
> + format->pad = icd->src_pad_idx;
> +#endif

Same as the first comment.

> +
>   ret = v4l2_device_call_until_err(sd->v4l2_dev,
>   soc_camera_grp_id(icd), pad,
>   set_fmt, NULL, format);
> 

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/15] media: soc_camera: soc_scale_crop: Use correct pad number in try_fmt

2015-06-03 Thread William Towle
From: Rob Taylor 

Fix calls to subdev try_fmt to use correct pad. Fixes failures with
subdevs that care about having the right pad number set.

Signed-off-by: William Towle 
Reviewed-by: Rob Taylor 
---
 drivers/media/platform/soc_camera/soc_scale_crop.c |   10 ++
 1 file changed, 10 insertions(+)

diff --git a/drivers/media/platform/soc_camera/soc_scale_crop.c 
b/drivers/media/platform/soc_camera/soc_scale_crop.c
index bda29bc..90e2769 100644
--- a/drivers/media/platform/soc_camera/soc_scale_crop.c
+++ b/drivers/media/platform/soc_camera/soc_scale_crop.c
@@ -225,6 +225,10 @@ static int client_set_fmt(struct soc_camera_device *icd,
bool host_1to1;
int ret;
 
+#if defined(CONFIG_MEDIA_CONTROLLER)
+   format->pad = icd->src_pad_idx;
+#endif
+
ret = v4l2_device_call_until_err(sd->v4l2_dev,
 soc_camera_grp_id(icd), pad,
 set_fmt, NULL, format);
@@ -261,10 +265,16 @@ static int client_set_fmt(struct soc_camera_device *icd,
/* width <= max_width && height <= max_height - guaranteed by try_fmt */
while ((width > tmp_w || height > tmp_h) &&
   tmp_w < max_width && tmp_h < max_height) {
+
tmp_w = min(2 * tmp_w, max_width);
tmp_h = min(2 * tmp_h, max_height);
mf->width = tmp_w;
mf->height = tmp_h;
+
+#if defined(CONFIG_MEDIA_CONTROLLER)
+   format->pad = icd->src_pad_idx;
+#endif
+
ret = v4l2_device_call_until_err(sd->v4l2_dev,
soc_camera_grp_id(icd), pad,
set_fmt, NULL, format);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html