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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f5940c764af6587b97d39fdb9b64ec9bfe09b4e8.camel@collabora.com>
Date: Tue, 18 Feb 2025 14:29:30 +0100
From: Julien Massot <julien.massot@...labora.com>
To: Laurentiu Palcu <laurentiu.palcu@....nxp.com>, Mauro Carvalho Chehab
	 <mchehab@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-media@...r.kernel.org
Subject: Re: [PATCH 2/5] media/i2c: max96717: implement the
 .get_frame_desc() operation

Hi,

On Fri, 2025-02-07 at 13:29 +0200, Laurentiu Palcu wrote:
> Since the max96717 serializer can work with various sensors, we need to
> implement the .get_frame_desc() callback to get the VCs and DTs for the
> incoming stream(s).
> 
> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@....nxp.com>
> ---
>  drivers/media/i2c/max96717.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/drivers/media/i2c/max96717.c b/drivers/media/i2c/max96717.c
> index b1116aade0687..6a668a004c717 100644
> --- a/drivers/media/i2c/max96717.c
> +++ b/drivers/media/i2c/max96717.c
> @@ -575,12 +575,33 @@ static int max96717_disable_streams(struct v4l2_subdev *sd,
>  	return 0;
>  }
>  
> +static int max96717_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
> +				   struct v4l2_mbus_frame_desc *fd)
> +{
> +	struct max96717_priv *priv = sd_to_max96717(sd);
> +	int ret;
> +	struct v4l2_mbus_frame_desc source_fd;
> +
> +	if (pad != MAX96717_PAD_SOURCE)
> +		return -EINVAL;
> +
Please check priv->source_sd first, we support the case where we only have a test pattern from
the serializer. Then we can simply return the result of v4l2_subdev_call.

        return v4l2_subdev_call(priv->source_sd, pad, get_frame_desc,
			       priv->source_sd_pad, fd);

> +	ret = v4l2_subdev_call(priv->source_sd, pad, get_frame_desc,
> +			       priv->source_sd_pad, &source_fd);
> +	if (ret)
> +		return ret;
> +
> +	*fd = source_fd;
> +
> +	return 0;
> +}
> +
>  static const struct v4l2_subdev_pad_ops max96717_pad_ops = {
>  	.enable_streams = max96717_enable_streams,
>  	.disable_streams = max96717_disable_streams,
>  	.set_routing = max96717_set_routing,
>  	.get_fmt = v4l2_subdev_get_fmt,
>  	.set_fmt = max96717_set_fmt,
> +	.get_frame_desc = max96717_get_frame_desc,
>  };
>  
>  static const struct v4l2_subdev_core_ops max96717_subdev_core_ops = {

Regards,
-- 
Julien

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ