[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <78fbe221-57c3-495b-a9d8-2e40a1612e40@linaro.org>
Date: Tue, 24 Sep 2024 15:41:53 +0100
From: Bryan O'Donoghue <bryan.odonoghue@...aro.org>
To: quic_dikshita@...cinc.com, Vikash Garodia <quic_vgarodia@...cinc.com>,
Abhinav Kumar <quic_abhinavk@...cinc.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Philipp Zabel <p.zabel@...gutronix.de>
Cc: linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Vedang Nagar <quic_vnagar@...cinc.com>
Subject: Re: [PATCH v3 12/29] media: iris: implement s_fmt, g_fmt and try_fmt
ioctls
On 27/08/2024 11:05, Dikshita Agarwal via B4 Relay wrote:
> From: Vedang Nagar <quic_vnagar@...cinc.com>
>
> Implement s_fmt, g_fmt and try_fmt IOCTL ops in
> the driver with necessary hooks.
>
> Signed-off-by: Vedang Nagar <quic_vnagar@...cinc.com>
> Signed-off-by: Dikshita Agarwal <quic_dikshita@...cinc.com>
> +
> + src_q = v4l2_m2m_get_src_vq(m2m_ctx);
> + memset(pixmp->reserved, 0, sizeof(pixmp->reserved));
> + if (V4L2_TYPE_IS_OUTPUT(f->type)) {
> + if (f->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_H264) {
> + f_inst = inst->fmt_src;
> + f->fmt.pix_mp.width = f_inst->fmt.pix_mp.width;
> + f->fmt.pix_mp.height = f_inst->fmt.pix_mp.height;
> + f->fmt.pix_mp.pixelformat = f_inst->fmt.pix_mp.pixelformat;
> + }
> + } else if (V4L2_TYPE_IS_CAPTURE(f->type)) {
> + if (f->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_NV12) {
> + f_inst = inst->fmt_dst;
> + f->fmt.pix_mp.pixelformat = f_inst->fmt.pix_mp.pixelformat;
> + f->fmt.pix_mp.width = f_inst->fmt.pix_mp.width;
> + f->fmt.pix_mp.height = f_inst->fmt.pix_mp.height;
> + }
> + if (vb2_is_streaming(src_q)) {
> + f_inst = inst->fmt_src;
> + f->fmt.pix_mp.height = f_inst->fmt.pix_mp.height;
> + f->fmt.pix_mp.width = f_inst->fmt.pix_mp.width;
> + }
> + } else {
> + return -EINVAL;
> + }
> +
<snip>
> +int iris_vdec_s_fmt(struct iris_inst *inst, struct v4l2_format *f)
> +{
> + struct v4l2_format *fmt, *output_fmt;
> + struct vb2_queue *q;
> + u32 codec_align;
> +
> + int ret = 0;
> +
> + q = v4l2_m2m_get_vq(inst->m2m_ctx, f->type);
> + if (!q)
> + return -EINVAL;
> +
> + iris_vdec_try_fmt(inst, f);
> +
> + if (V4L2_TYPE_IS_OUTPUT(f->type)) {
<snip>
> +
> + } else if (V4L2_TYPE_IS_CAPTURE(f->type)) {
<snip>
> + } else {
> + return -EINVAL;
> + }
I'd switch this instead of if/elsing.
A blanket comment for this series.
Powered by blists - more mailing lists