devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dikshita Agarwal <quic_dikshita@quicinc.com>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	Vikash Garodia <quic_vgarodia@quicinc.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>
Cc: Sebastian Fricke <sebastian.fricke@collabora.com>,
	<linux-arm-msm@vger.kernel.org>, <linux-media@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Vedang Nagar <quic_vnagar@quicinc.com>
Subject: Re: [PATCH v4 12/28] media: iris: implement enum_fmt and enum_frameintervals ioctls
Date: Wed, 23 Oct 2024 17:08:33 +0530	[thread overview]
Message-ID: <48307b08-dbf5-bec5-ac0e-41ad64d0bad4@quicinc.com> (raw)
In-Reply-To: <5a1f5d57-341c-47c3-b478-7d6a7842ae70@xs4all.nl>



On 10/23/2024 4:19 PM, Hans Verkuil wrote:
> On 14/10/2024 11:07, Dikshita Agarwal wrote:
>> From: Vedang Nagar <quic_vnagar@quicinc.com>
>>
>> Implement enum_fmt and enum_frameintervals ioctls with
>> necessary hooks.
>>
>> Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
>> Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
>> ---
>>  .../platform/qcom/iris/iris_platform_common.h      |  4 +++
>>  .../platform/qcom/iris/iris_platform_sm8550.c      |  4 +++
>>  drivers/media/platform/qcom/iris/iris_vdec.c       | 21 ++++++++++++
>>  drivers/media/platform/qcom/iris/iris_vdec.h       |  1 +
>>  drivers/media/platform/qcom/iris/iris_vidc.c       | 39 ++++++++++++++++++++++
>>  5 files changed, 69 insertions(+)
>>
>> diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
>> index e345667dfbf2..54a2d723797b 100644
>> --- a/drivers/media/platform/qcom/iris/iris_platform_common.h
>> +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
>> @@ -43,6 +43,10 @@ struct ubwc_config_data {
>>  };
>>  
>>  struct platform_inst_caps {
>> +	u32 min_frame_width;
>> +	u32 max_frame_width;
>> +	u32 min_frame_height;
>> +	u32 max_frame_height;
>>  	u32 max_mbpf;
>>  };
>>  struct iris_core_power {
>> diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8550.c b/drivers/media/platform/qcom/iris/iris_platform_sm8550.c
>> index bc4769732aad..37c0130d7059 100644
>> --- a/drivers/media/platform/qcom/iris/iris_platform_sm8550.c
>> +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8550.c
>> @@ -11,6 +11,10 @@
>>  #define VIDEO_ARCH_LX 1
>>  
>>  static struct platform_inst_caps platform_inst_cap_sm8550 = {
>> +	.min_frame_width = 96,
>> +	.max_frame_width = 8192,
>> +	.min_frame_height = 96,
>> +	.max_frame_height = 8192,
>>  	.max_mbpf = (8192 * 4352) / 256,
>>  };
>>  
>> diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/platform/qcom/iris/iris_vdec.c
>> index e807decdda2b..fd0f1ebc33e8 100644
>> --- a/drivers/media/platform/qcom/iris/iris_vdec.c
>> +++ b/drivers/media/platform/qcom/iris/iris_vdec.c
>> @@ -60,6 +60,27 @@ void iris_vdec_inst_deinit(struct iris_inst *inst)
>>  	kfree(inst->fmt_src);
>>  }
>>  
>> +int iris_vdec_enum_fmt(struct iris_inst *inst, struct v4l2_fmtdesc *f)
>> +{
>> +	switch (f->type) {
>> +	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
>> +		f->pixelformat = V4L2_PIX_FMT_H264;
>> +		f->flags = V4L2_FMT_FLAG_COMPRESSED | V4L2_FMT_FLAG_DYN_RESOLUTION;
>> +		strscpy(f->description, "codec", sizeof(f->description));
> 
> Don't set description, it's handled in v4l_fill_fmtdesc in v4l2-ioctl.c.
> 
>> +		break;
>> +	case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
>> +		f->pixelformat = V4L2_PIX_FMT_NV12;
>> +		strscpy(f->description, "colorformat", sizeof(f->description));
> 
> Ditto.
> 
> Hmm, v4l2-compliance should warn about this. Is this changed in a later patch perhaps?
> 
Oh, we didn't see such warning.
Will make the change.
>> +		break;
>> +	default:
>> +		return -EINVAL;
>> +	}
>> +
>> +	memset(f->reserved, 0, sizeof(f->reserved));
> 
> No need to do this, it's already zeroed by v4l_enum_fmt.
> 
Sure, Noted.
>> +
>> +	return 0;
>> +}
>> +
>>  int iris_vdec_try_fmt(struct iris_inst *inst, struct v4l2_format *f)
>>  {
>>  	struct v4l2_pix_format_mplane *pixmp = &f->fmt.pix_mp;
>> diff --git a/drivers/media/platform/qcom/iris/iris_vdec.h b/drivers/media/platform/qcom/iris/iris_vdec.h
>> index 4f2557d15ca2..eb8a1121ae92 100644
>> --- a/drivers/media/platform/qcom/iris/iris_vdec.h
>> +++ b/drivers/media/platform/qcom/iris/iris_vdec.h
>> @@ -10,6 +10,7 @@ struct iris_inst;
>>  
>>  void iris_vdec_inst_init(struct iris_inst *inst);
>>  void iris_vdec_inst_deinit(struct iris_inst *inst);
>> +int iris_vdec_enum_fmt(struct iris_inst *inst, struct v4l2_fmtdesc *f);
>>  int iris_vdec_try_fmt(struct iris_inst *inst, struct v4l2_format *f);
>>  int iris_vdec_s_fmt(struct iris_inst *inst, struct v4l2_format *f);
>>  
>> diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/platform/qcom/iris/iris_vidc.c
>> index 481fa0a7b7f3..1d6c5e8fafb4 100644
>> --- a/drivers/media/platform/qcom/iris/iris_vidc.c
>> +++ b/drivers/media/platform/qcom/iris/iris_vidc.c
>> @@ -214,6 +214,16 @@ int iris_close(struct file *filp)
>>  	return 0;
>>  }
>>  
>> +static int iris_enum_fmt(struct file *filp, void *fh, struct v4l2_fmtdesc *f)
>> +{
>> +	struct iris_inst *inst = iris_get_inst(filp, NULL);
>> +
>> +	if (f->index)
>> +		return -EINVAL;
>> +
>> +	return iris_vdec_enum_fmt(inst, f);
>> +}
>> +
>>  static int iris_try_fmt_vid_mplane(struct file *filp, void *fh, struct v4l2_format *f)
>>  {
>>  	struct iris_inst *inst = iris_get_inst(filp, NULL);
>> @@ -256,6 +266,32 @@ static int iris_g_fmt_vid_mplane(struct file *filp, void *fh, struct v4l2_format
>>  	return ret;
>>  }
>>  
>> +static int iris_enum_framesizes(struct file *filp, void *fh,
>> +				struct v4l2_frmsizeenum *fsize)
>> +{
>> +	struct iris_inst *inst = iris_get_inst(filp, NULL);
>> +	struct platform_inst_caps *caps;
>> +
>> +	if (fsize->index)
>> +		return -EINVAL;
>> +
>> +	if (fsize->pixel_format != V4L2_PIX_FMT_H264 &&
>> +	    fsize->pixel_format != V4L2_PIX_FMT_NV12)
>> +		return -EINVAL;
>> +
>> +	caps = inst->core->iris_platform_data->inst_caps;
>> +
>> +	fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;
>> +	fsize->stepwise.min_width = caps->min_frame_width;
>> +	fsize->stepwise.max_width = caps->max_frame_width;
>> +	fsize->stepwise.step_width = STEP_WIDTH;
>> +	fsize->stepwise.min_height = caps->min_frame_height;
>> +	fsize->stepwise.max_height = caps->max_frame_height;
>> +	fsize->stepwise.step_height = STEP_HEIGHT;
>> +
>> +	return 0;
>> +}
>> +
>>  static int iris_g_selection(struct file *filp, void *fh, struct v4l2_selection *s)
>>  {
>>  	struct iris_inst *inst = iris_get_inst(filp, NULL);
>> @@ -298,12 +334,15 @@ static const struct vb2_ops iris_vb2_ops = {
>>  };
>>  
>>  static const struct v4l2_ioctl_ops iris_v4l2_ioctl_ops = {
>> +	.vidioc_enum_fmt_vid_cap        = iris_enum_fmt,
>> +	.vidioc_enum_fmt_vid_out        = iris_enum_fmt,
>>  	.vidioc_try_fmt_vid_cap_mplane  = iris_try_fmt_vid_mplane,
>>  	.vidioc_try_fmt_vid_out_mplane  = iris_try_fmt_vid_mplane,
>>  	.vidioc_s_fmt_vid_cap_mplane    = iris_s_fmt_vid_mplane,
>>  	.vidioc_s_fmt_vid_out_mplane    = iris_s_fmt_vid_mplane,
>>  	.vidioc_g_fmt_vid_cap_mplane    = iris_g_fmt_vid_mplane,
>>  	.vidioc_g_fmt_vid_out_mplane    = iris_g_fmt_vid_mplane,
>> +	.vidioc_enum_framesizes         = iris_enum_framesizes,
>>  	.vidioc_reqbufs                 = v4l2_m2m_ioctl_reqbufs,
>>  	.vidioc_g_selection             = iris_g_selection,
>>  };
>>
> 

  reply	other threads:[~2024-10-23 11:38 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14  9:07 [PATCH v4 00/28] Qualcomm iris video decoder driver Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 01/28] dt-bindings: media: Add video support for QCOM SM8550 SoC Dikshita Agarwal
2024-10-14 11:57   ` Krzysztof Kozlowski
2024-10-14  9:07 ` [PATCH v4 02/28] media: iris: add platform driver for iris video device Dikshita Agarwal
2024-10-16  9:38   ` Uwe Kleine-König
2024-10-16 10:29     ` Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 03/28] media: iris: implement iris v4l2 file ops Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 04/28] media: iris: introduce iris core state management with shared queues Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 05/28] media: iris: implement video firmware load/unload Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 06/28] media: iris: implement boot sequence of the firmware Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 07/28] media: iris: introduce host firmware interface with necessary hooks Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 08/28] media: iris: implement power management Dikshita Agarwal
2024-10-15 11:25   ` kernel test robot
2024-10-15 12:07   ` kernel test robot
2024-10-14  9:07 ` [PATCH v4 09/28] media: iris: implement reqbuf ioctl with vb2_queue_setup Dikshita Agarwal
2024-10-23  9:59   ` Hans Verkuil
2024-10-23 10:17     ` Dikshita Agarwal
2024-10-23 11:25       ` Hans Verkuil
2024-10-23 11:33         ` Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 10/28] media: iris: implement s_fmt, g_fmt and try_fmt ioctls Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 11/28] media: iris: implement g_selection ioctl Dikshita Agarwal
2024-10-23 10:45   ` Hans Verkuil
2024-10-23 11:31     ` Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 12/28] media: iris: implement enum_fmt and enum_frameintervals ioctls Dikshita Agarwal
2024-10-23 10:49   ` Hans Verkuil
2024-10-23 11:38     ` Dikshita Agarwal [this message]
2024-10-14  9:07 ` [PATCH v4 13/28] media: iris: implement subscribe_event and unsubscribe_event ioctls Dikshita Agarwal
2024-10-23 10:53   ` Hans Verkuil
2024-10-23 12:03     ` Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 14/28] media: iris: implement iris v4l2_ctrl_ops Dikshita Agarwal
2024-10-23 11:02   ` Hans Verkuil
2024-10-25  9:21     ` Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 15/28] media: iris: implement query_cap, query_ctrl and query_menu ioctls Dikshita Agarwal
2024-10-23 11:05   ` Hans Verkuil
2024-10-24  5:50     ` Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 16/28] media: iris: implement vb2 streaming ops Dikshita Agarwal
2024-10-23 11:13   ` Hans Verkuil
2024-10-25  7:06     ` Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 17/28] media: iris: implement set properties to firmware during streamon Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 18/28] media: iris: subscribe parameters and properties to firmware for hfi_gen2 Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 19/28] media: iris: allocate, initialize and queue internal buffers Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 20/28] media: iris: implement vb2 ops for buf_queue and firmware response Dikshita Agarwal
2024-10-23 11:19   ` Hans Verkuil
2024-10-23 11:53     ` Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 21/28] media: iris: add support for dynamic resolution change Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 22/28] media: iris: handle streamoff/on from client in " Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 23/28] media: iris: add support for drain sequence Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 24/28] media: iris: add check whether the video session is supported or not Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 25/28] media: iris: implement power scaling for vpu2 and vpu3 Dikshita Agarwal
2024-10-17  6:08   ` kernel test robot
2024-10-19 11:38   ` kernel test robot
2024-10-14  9:07 ` [PATCH v4 26/28] media: iris: add check to allow sub states transitions Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 27/28] media: iris: enable video driver probe of SM8250 SoC Dikshita Agarwal
2024-10-14 14:00   ` Jianhua Lu
2024-10-14 14:08     ` Dmitry Baryshkov
2024-10-15  9:22       ` Dikshita Agarwal
2024-10-15 12:26         ` Dmitry Baryshkov
2024-10-25  7:03           ` Dikshita Agarwal
2024-10-14  9:07 ` [PATCH v4 28/28] media: MAINTAINERS: add Qualcomm iris video accelerator driver Dikshita Agarwal
2024-10-14 11:54 ` [PATCH v4 00/28] Qualcomm iris video decoder driver Krzysztof Kozlowski
2024-10-15  7:26   ` Dikshita Agarwal
2024-10-17  1:26 ` Bryan O'Donoghue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48307b08-dbf5-bec5-ac0e-41ad64d0bad4@quicinc.com \
    --to=quic_dikshita@quicinc.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hverkuil@xs4all.nl \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_vgarodia@quicinc.com \
    --cc=quic_vnagar@quicinc.com \
    --cc=robh@kernel.org \
    --cc=sebastian.fricke@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).