lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190531114258.6bvsqzlexqnelu5u@valkosipuli.retiisi.org.uk>
Date:   Fri, 31 May 2019 14:42:58 +0300
From:   Sakari Ailus <sakari.ailus@....fi>
To:     Janusz Krzysztofik <jmkrzyszt@...il.com>
Cc:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Hans Verkuil <hverkuil-cisco@...all.nl>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 4/5] media: ov6650: Fix frame scaling not reset on
 crop

Hi Janusz,

On Sun, May 26, 2019 at 10:47:57PM +0200, Janusz Krzysztofik wrote:
> According to V4L2 subdevice interface specification, frame scaling
> factors should be reset to default values on modification of input frame
> format.  Assuming that requirement also applies in case of crop
> rectangle modification unless V4L2_SEL_FLAG_KEEP_CONFIG is requested,
> the driver now does not respect it.
> 
> The KEEP_CONFIG case is already implemented, fix the other path.
> 
> Signed-off-by: Janusz Krzysztofik <jmkrzyszt@...il.com>
> ---
>  drivers/media/i2c/ov6650.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/media/i2c/ov6650.c b/drivers/media/i2c/ov6650.c
> index 47590cd51190..cc70d8952999 100644
> --- a/drivers/media/i2c/ov6650.c
> +++ b/drivers/media/i2c/ov6650.c
> @@ -472,6 +472,8 @@ static int ov6650_get_selection(struct v4l2_subdev *sd,
>  	}
>  }
>  
> +static int ov6650_s_fmt(struct v4l2_subdev *sd, u32 code, bool half_scale);
> +

Would it be possible to rearrange the functions in the file so you wouldn't
need extra prototypes? Preferrably that'd be a new patch.

>  static int ov6650_set_selection(struct v4l2_subdev *sd,
>  		struct v4l2_subdev_pad_config *cfg,
>  		struct v4l2_subdev_selection *sel)
> @@ -515,7 +517,13 @@ static int ov6650_set_selection(struct v4l2_subdev *sd,
>  	}
>  	if (!ret)
>  		priv->rect.height = sel->r.height;
> +	else
> +		return ret;

if (ret)
	return ret;

...

>  
> +	if (priv->half_scale) {
> +		/* turn off half scaling, preserve media bus format */
> +		ret = ov6650_s_fmt(sd, priv->code, false);
> +	}
>  	return ret;
>  }
>  

-- 
Regards,

Sakari Ailus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ