<html><body><p>
<pre>
Hi, Shu-hsiang:
On Wed, 2024-10-09 at 19:15 +0800, Shu-hsiang Yang wrote:
> Introduces the ISP pipeline driver for the MediaTek ISP raw and yuv
> modules. Key functionalities include data processing, V4L2 integration,
> resource management, debug support, and various control operations.
> Additionally, IRQ handling, platform device management, and MediaTek
> ISP DMA format support are also included.
>
> Signed-off-by: Shu-hsiang Yang <Shu-hsiang.Yang@mediatek.com>
> ---
[snip]
> +static bool mtk_raw_fmt_get_res(struct v4l2_subdev *sd,
> +struct v4l2_subdev_format *fmt,
> +struct mtk_cam_resource *res)
> +{
> +void *user_ptr;
> +u64 addr;
> +
> +addr = ((u64)fmt->reserved[1] << 32) | fmt->reserved[2];
The callstack to this function is:
subdev_do_ioctl() -> mtk_raw_set_fmt() -> mtk_raw_try_pad_fmt() -> mtk_raw_set_src_pad_fmt() -> mtk_raw_fmt_get_res()
In subdev_do_ioctl() [1], fmt->reserved[] would be cleared to zero.
I don't know why you could get a non-zero addr value?
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/v4l2-core/v4l2-subdev.c?h=v6.12-rc6#n753
Regards,
CK
> +user_ptr = (void *)addr;
> +if (!user_ptr) {
> +dev_info(sd->v4l2_dev->dev, "%s: mtk_cam_resource is null\n",
> + __func__);
> +return false;
> +}
> +
> +if (copy_from_user(res, (void __user *)user_ptr, sizeof(*res))) {
> +dev_info(sd->v4l2_dev->dev,
> + "%s: copy_from_user failedm user_ptr:%p\n",
> + __func__, user_ptr);
> +return false;
> +}
> +
> +dev_dbg(sd->v4l2_dev->dev,
> +"%s:sensor:%d/%d/%lld/%d/%d, raw:%lld/%d/%d/%d/%d/%d/%d/%d/%lld\n",
> +__func__,
> +res->sensor_res.hblank, res->sensor_res.vblank,
> +res->sensor_res.pixel_rate, res->sensor_res.interval.denominator,
> +res->sensor_res.interval.numerator,
> +res->raw_res.feature, res->raw_res.bin, res->raw_res.path_sel,
> +res->raw_res.raw_max, res->raw_res.raw_min, res->raw_res.raw_used,
> +res->raw_res.strategy, res->raw_res.pixel_mode,
> +res->raw_res.throughput);
> +
> +return res;
> +}
> +
</pre>
</p></body></html><!--type:text--><!--{--><pre>************* MEDIATEK Confidentiality Notice ********************
The information contained in this e-mail message (including any
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be
conveyed only to the designated recipient(s). Any use, dissemination,
distribution, printing, retaining or copying of this e-mail (including its
attachments) by unintended recipient(s) is strictly prohibited and may
be unlawful. If you are not an intended recipient of this e-mail, or believe
that you have received this e-mail in error, please notify the sender
immediately (by replying to this e-mail), delete any and all copies of
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!
</pre><!--}-->