diff mbox

media: mx2_camera: Don't modify non volatile parameters in try_fmt.

Message ID 1341923936-18503-1-git-send-email-javier.martin@vista-silicon.com (mailing list archive)
State New, archived
Headers show

Commit Message

Javier Martin July 10, 2012, 12:38 p.m. UTC
---
 drivers/media/video/mx2_camera.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Guennadi Liakhovetski July 10, 2012, 12:45 p.m. UTC | #1
On Tue, 10 Jul 2012, Javier Martin wrote:

> ---
>  drivers/media/video/mx2_camera.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
> index d5355de..4a96989 100644
> --- a/drivers/media/video/mx2_camera.c
> +++ b/drivers/media/video/mx2_camera.c
> @@ -1370,6 +1370,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
>  	__u32 pixfmt = pix->pixelformat;
>  	struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
>  	struct mx2_camera_dev *pcdev = ici->priv;
> +	struct mx2_fmt_cfg *emma_prp;
>  	unsigned int width_limit;
>  	int ret;
>  
> @@ -1432,7 +1433,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
>  		__func__, pcdev->s_width, pcdev->s_height);
>  
>  	/* If the sensor does not support image size try PrP resizing */
> -	pcdev->emma_prp = mx27_emma_prp_get_format(xlate->code,
> +	emma_prp = mx27_emma_prp_get_format(xlate->code,
>  						   xlate->host_fmt->fourcc);
>  
>  	memset(pcdev->resizing, 0, sizeof(pcdev->resizing));

You forgot to update this:

	if ((mf.width != pix->width || mf.height != pix->height) &&
		pcdev->emma_prp->cfg.in_fmt == PRP_CNTL_DATA_IN_YUV422) {

		^^^^^^^^^^^^^^^^^^^^

		if (mx2_emmaprp_resize(pcdev, &mf, pix, false) < 0)
			dev_dbg(icd->parent, "%s: can't resize\n", __func__);
	}

> -- 
> 1.7.9.5

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index d5355de..4a96989 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -1370,6 +1370,7 @@  static int mx2_camera_try_fmt(struct soc_camera_device *icd,
 	__u32 pixfmt = pix->pixelformat;
 	struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
 	struct mx2_camera_dev *pcdev = ici->priv;
+	struct mx2_fmt_cfg *emma_prp;
 	unsigned int width_limit;
 	int ret;
 
@@ -1432,7 +1433,7 @@  static int mx2_camera_try_fmt(struct soc_camera_device *icd,
 		__func__, pcdev->s_width, pcdev->s_height);
 
 	/* If the sensor does not support image size try PrP resizing */
-	pcdev->emma_prp = mx27_emma_prp_get_format(xlate->code,
+	emma_prp = mx27_emma_prp_get_format(xlate->code,
 						   xlate->host_fmt->fourcc);
 
 	memset(pcdev->resizing, 0, sizeof(pcdev->resizing));