[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8ff4265f-96b5-9f96-c8c2-32a95f447e78@quicinc.com>
Date: Thu, 26 Sep 2024 16:19:48 +0530
From: Dikshita Agarwal <quic_dikshita@...cinc.com>
To: Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
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 9/24/2024 8:11 PM, Bryan O'Donoghue wrote:
> 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.
Sure, will revisit the whole driver code and convert if/else to switch
wherever possible/required.
>
>
Powered by blists - more mailing lists