devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dikshita Agarwal <quic_dikshita@quicinc.com>
To: 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: Hans Verkuil <hverkuil@xs4all.nl>,
	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>,
	Dikshita Agarwal <quic_dikshita@quicinc.com>,
	Vedang Nagar <quic_vnagar@quicinc.com>
Subject: [PATCH v4 15/28] media: iris: implement query_cap, query_ctrl and query_menu ioctls
Date: Mon, 14 Oct 2024 14:37:36 +0530	[thread overview]
Message-ID: <20241014-qcom-video-iris-v4-v4-15-c5eaa4e9ab9e@quicinc.com> (raw)
In-Reply-To: <20241014-qcom-video-iris-v4-v4-0-c5eaa4e9ab9e@quicinc.com>

From: Vedang Nagar <quic_vnagar@quicinc.com>

Implement query_cap, query_ctrl and query_menu ioctls
with necessary hooks.

Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
---
 drivers/media/platform/qcom/iris/iris_vidc.c | 52 ++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/platform/qcom/iris/iris_vidc.c
index 93d2be118a81..60ee05b67f86 100644
--- a/drivers/media/platform/qcom/iris/iris_vidc.c
+++ b/drivers/media/platform/qcom/iris/iris_vidc.c
@@ -300,6 +300,55 @@ static int iris_enum_framesizes(struct file *filp, void *fh,
 	return 0;
 }
 
+static int iris_querycap(struct file *filp, void *fh, struct v4l2_capability *cap)
+{
+	strscpy(cap->driver, IRIS_DRV_NAME, sizeof(cap->driver));
+	strscpy(cap->bus_info, IRIS_BUS_NAME, sizeof(cap->bus_info));
+	memset(cap->reserved, 0, sizeof(cap->reserved));
+	strscpy(cap->card, "iris_decoder", sizeof(cap->card));
+
+	return 0;
+}
+
+static int iris_queryctrl(struct file *filp, void *fh, struct v4l2_queryctrl *q_ctrl)
+{
+	struct v4l2_ctrl *ctrl;
+	struct iris_inst *inst = iris_get_inst(filp, NULL);
+
+	ctrl = v4l2_ctrl_find(&inst->ctrl_handler, q_ctrl->id);
+	if (!ctrl)
+		return -EINVAL;
+
+	q_ctrl->minimum = ctrl->minimum;
+	q_ctrl->maximum = ctrl->maximum;
+	q_ctrl->default_value = ctrl->default_value;
+	q_ctrl->flags = 0;
+	q_ctrl->step = ctrl->step;
+
+	return 0;
+}
+
+static int iris_querymenu(struct file *filp, void *fh, struct v4l2_querymenu *qmenu)
+{
+	struct iris_inst *inst = iris_get_inst(filp, NULL);
+	struct v4l2_ctrl *ctrl;
+
+	ctrl = v4l2_ctrl_find(&inst->ctrl_handler, qmenu->id);
+	if (!ctrl)
+		return -EINVAL;
+
+	if (ctrl->type != V4L2_CTRL_TYPE_MENU)
+		return -EINVAL;
+
+	if (qmenu->index < ctrl->minimum || qmenu->index > ctrl->maximum)
+		return -EINVAL;
+
+	if (ctrl->menu_skip_mask & (1 << qmenu->index))
+		return -EINVAL;
+
+	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);
@@ -366,6 +415,9 @@ static const struct v4l2_ioctl_ops iris_v4l2_ioctl_ops = {
 	.vidioc_g_fmt_vid_out_mplane    = iris_g_fmt_vid_mplane,
 	.vidioc_enum_framesizes         = iris_enum_framesizes,
 	.vidioc_reqbufs                 = v4l2_m2m_ioctl_reqbufs,
+	.vidioc_querycap                = iris_querycap,
+	.vidioc_queryctrl               = iris_queryctrl,
+	.vidioc_querymenu               = iris_querymenu,
 	.vidioc_g_selection             = iris_g_selection,
 	.vidioc_subscribe_event         = iris_subscribe_event,
 	.vidioc_unsubscribe_event       = iris_unsubscribe_event,

-- 
2.34.1


  parent reply	other threads:[~2024-10-14  9:08 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
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 ` Dikshita Agarwal [this message]
2024-10-23 11:05   ` [PATCH v4 15/28] media: iris: implement query_cap, query_ctrl and query_menu ioctls 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=20241014-qcom-video-iris-v4-v4-15-c5eaa4e9ab9e@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).