diff mbox series

[v5,15/28] media: iris: implement query_cap ioctl

Message ID 20241105-qcom-video-iris-v5-15-a88e7c220f78@quicinc.com
State Superseded
Headers show
Series Qualcomm iris video decoder driver | expand

Commit Message

Dikshita Agarwal Nov. 5, 2024, 6:55 a.m. UTC
From: Vedang Nagar <quic_vnagar@quicinc.com>

Implement query_cap ioctl 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 | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Dikshita Agarwal Nov. 13, 2024, 5:27 a.m. UTC | #1
On 11/12/2024 3:54 PM, Hans Verkuil wrote:
> On 05/11/2024 07:55, Dikshita Agarwal wrote:
>> From: Vedang Nagar <quic_vnagar@quicinc.com>
>>
>> Implement query_cap ioctl 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 | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/platform/qcom/iris/iris_vidc.c
>> index 820d98da3190..e270711b8f6b 100644
>> --- a/drivers/media/platform/qcom/iris/iris_vidc.c
>> +++ b/drivers/media/platform/qcom/iris/iris_vidc.c
>> @@ -303,6 +303,14 @@ 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->card, "iris_decoder", sizeof(cap->card));
> 
> The card field is supposed to be a human readable strings, so I
> would suggest using "Iris Decoder" instead. Up to you, though.
> 
That sounds better, will update.

Thanks,
Dikshita
> Regards,
> 
> 	Hans
> 
>> +
>> +	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);
>> @@ -361,6 +369,7 @@ 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_g_selection             = iris_g_selection,
>>  	.vidioc_subscribe_event         = iris_subscribe_event,
>>  	.vidioc_unsubscribe_event       = v4l2_event_unsubscribe,
>>
>
diff mbox series

Patch

diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/platform/qcom/iris/iris_vidc.c
index 820d98da3190..e270711b8f6b 100644
--- a/drivers/media/platform/qcom/iris/iris_vidc.c
+++ b/drivers/media/platform/qcom/iris/iris_vidc.c
@@ -303,6 +303,14 @@  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->card, "iris_decoder", sizeof(cap->card));
+
+	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);
@@ -361,6 +369,7 @@  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_g_selection             = iris_g_selection,
 	.vidioc_subscribe_event         = iris_subscribe_event,
 	.vidioc_unsubscribe_event       = v4l2_event_unsubscribe,