public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: venus: assign unique bus_info strings for encoder and decoder
@ 2025-11-21 18:43 ` Jorge Ramirez-Ortiz
  2025-11-21 19:22   ` Konrad Dybcio
                     ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Jorge Ramirez-Ortiz @ 2025-11-21 18:43 UTC (permalink / raw)
  To: jorge.ramirez, vikash.garodia, dikshita.agarwal, bod, mchehab
  Cc: linux-media, linux-arm-msm, linux-kernel

The Venus encoder and decoder video devices currently report the same
bus_info string ("platform:qcom-venus").

Assign unique bus_info identifiers by appending ":dec" and ":enc" to the
parent device name. With this change v4l2-ctl will display two separate
logical devices

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
---
 drivers/media/platform/qcom/venus/vdec.c | 5 +++++
 drivers/media/platform/qcom/venus/venc.c | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 4a6641fdffcf..63f6ae1ff6ac 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -433,9 +433,14 @@ vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
 static int
 vdec_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
 {
+	struct venus_inst *inst = to_inst(file);
+	struct venus_core *core = inst->core;
+
 	strscpy(cap->driver, "qcom-venus", sizeof(cap->driver));
 	strscpy(cap->card, "Qualcomm Venus video decoder", sizeof(cap->card));
 	strscpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
+	snprintf(cap->bus_info, sizeof(cap->bus_info),
+		 "platform:%s:dec", dev_name(core->dev));
 
 	return 0;
 }
diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index b478b982a80d..520689f5533d 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -144,9 +144,14 @@ static int venc_v4l2_to_hfi(int id, int value)
 static int
 venc_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
 {
+	struct venus_inst *inst = to_inst(file);
+	struct venus_core *core = inst->core;
+
 	strscpy(cap->driver, "qcom-venus", sizeof(cap->driver));
 	strscpy(cap->card, "Qualcomm Venus video encoder", sizeof(cap->card));
 	strscpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
+	snprintf(cap->bus_info, sizeof(cap->bus_info),
+		 "platform:%s:enc", dev_name(core->dev));
 
 	return 0;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] media: venus: assign unique bus_info strings for encoder and decoder
  2025-11-21 18:43 ` [PATCH] media: venus: assign unique bus_info strings for encoder and decoder Jorge Ramirez-Ortiz
@ 2025-11-21 19:22   ` Konrad Dybcio
  2025-11-25 12:55     ` Jorge Ramirez
  2025-11-22 16:17   ` Bryan O'Donoghue
  2025-11-25  8:29   ` Dikshita Agarwal
  2 siblings, 1 reply; 12+ messages in thread
From: Konrad Dybcio @ 2025-11-21 19:22 UTC (permalink / raw)
  To: Jorge Ramirez-Ortiz, vikash.garodia, dikshita.agarwal, bod,
	mchehab
  Cc: linux-media, linux-arm-msm, linux-kernel

On 11/21/25 7:43 PM, Jorge Ramirez-Ortiz wrote:
> The Venus encoder and decoder video devices currently report the same
> bus_info string ("platform:qcom-venus").
> 
> Assign unique bus_info identifiers by appending ":dec" and ":enc" to the
> parent device name. With this change v4l2-ctl will display two separate
> logical devices
> 
> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
> ---

Perhaps that's a stupid question, but is there a reason they're
separate at all?

Konrad


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] media: venus: assign unique bus_info strings for encoder and decoder
  2025-11-21 18:43 ` [PATCH] media: venus: assign unique bus_info strings for encoder and decoder Jorge Ramirez-Ortiz
  2025-11-21 19:22   ` Konrad Dybcio
@ 2025-11-22 16:17   ` Bryan O'Donoghue
  2025-11-25  8:29   ` Dikshita Agarwal
  2 siblings, 0 replies; 12+ messages in thread
From: Bryan O'Donoghue @ 2025-11-22 16:17 UTC (permalink / raw)
  To: Jorge Ramirez-Ortiz, vikash.garodia, dikshita.agarwal, mchehab
  Cc: linux-media, linux-arm-msm, linux-kernel

On 21/11/2025 18:43, Jorge Ramirez-Ortiz wrote:
> The Venus encoder and decoder video devices currently report the same
> bus_info string ("platform:qcom-venus").
> 
> Assign unique bus_info identifiers by appending ":dec" and ":enc" to the
> parent device name. With this change v4l2-ctl will display two separate
> logical devices
> 
> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
> ---
>   drivers/media/platform/qcom/venus/vdec.c | 5 +++++
>   drivers/media/platform/qcom/venus/venc.c | 5 +++++
>   2 files changed, 10 insertions(+)
> 
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index 4a6641fdffcf..63f6ae1ff6ac 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -433,9 +433,14 @@ vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
>   static int
>   vdec_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
>   {
> +	struct venus_inst *inst = to_inst(file);
> +	struct venus_core *core = inst->core;
> +
>   	strscpy(cap->driver, "qcom-venus", sizeof(cap->driver));
>   	strscpy(cap->card, "Qualcomm Venus video decoder", sizeof(cap->card));
>   	strscpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
> +	snprintf(cap->bus_info, sizeof(cap->bus_info),
> +		 "platform:%s:dec", dev_name(core->dev));
> 
>   	return 0;
>   }
> diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
> index b478b982a80d..520689f5533d 100644
> --- a/drivers/media/platform/qcom/venus/venc.c
> +++ b/drivers/media/platform/qcom/venus/venc.c
> @@ -144,9 +144,14 @@ static int venc_v4l2_to_hfi(int id, int value)
>   static int
>   venc_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
>   {
> +	struct venus_inst *inst = to_inst(file);
> +	struct venus_core *core = inst->core;
> +
>   	strscpy(cap->driver, "qcom-venus", sizeof(cap->driver));
>   	strscpy(cap->card, "Qualcomm Venus video encoder", sizeof(cap->card));
>   	strscpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
> +	snprintf(cap->bus_info, sizeof(cap->bus_info),
> +		 "platform:%s:enc", dev_name(core->dev));
> 
>   	return 0;
>   }
> --
> 2.43.0
> 
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] media: venus: assign unique bus_info strings for encoder and decoder
  2025-11-21 18:43 ` [PATCH] media: venus: assign unique bus_info strings for encoder and decoder Jorge Ramirez-Ortiz
  2025-11-21 19:22   ` Konrad Dybcio
  2025-11-22 16:17   ` Bryan O'Donoghue
@ 2025-11-25  8:29   ` Dikshita Agarwal
  2025-11-25 12:52     ` Jorge Ramirez
  2 siblings, 1 reply; 12+ messages in thread
From: Dikshita Agarwal @ 2025-11-25  8:29 UTC (permalink / raw)
  To: Jorge Ramirez-Ortiz, vikash.garodia, dikshita.agarwal, bod,
	mchehab
  Cc: linux-media, linux-arm-msm, linux-kernel



On 11/22/2025 12:13 AM, Jorge Ramirez-Ortiz wrote:
> The Venus encoder and decoder video devices currently report the same
> bus_info string ("platform:qcom-venus").
> 
> Assign unique bus_info identifiers by appending ":dec" and ":enc" to the
> parent device name. With this change v4l2-ctl will display two separate
> logical devices
> 
> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
> ---
>  drivers/media/platform/qcom/venus/vdec.c | 5 +++++
>  drivers/media/platform/qcom/venus/venc.c | 5 +++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index 4a6641fdffcf..63f6ae1ff6ac 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -433,9 +433,14 @@ vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
>  static int
>  vdec_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
>  {
> +	struct venus_inst *inst = to_inst(file);
> +	struct venus_core *core = inst->core;
> +
>  	strscpy(cap->driver, "qcom-venus", sizeof(cap->driver));
>  	strscpy(cap->card, "Qualcomm Venus video decoder", sizeof(cap->card));
>  	strscpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
> +	snprintf(cap->bus_info, sizeof(cap->bus_info),
> +		 "platform:%s:dec", dev_name(core->dev));

Is there a reason to keep both strscpy() and snprintf() for cap->bus_info?
The second call to snprintf() seems to overwrite the value set by
strscpy(), making the first assignment redundant. Would it be cleaner to
remove the strscpy() line and rely solely on snprintf()?

Thanks,
Dikshita
>  
>  	return 0;
>  }
> diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
> index b478b982a80d..520689f5533d 100644
> --- a/drivers/media/platform/qcom/venus/venc.c
> +++ b/drivers/media/platform/qcom/venus/venc.c
> @@ -144,9 +144,14 @@ static int venc_v4l2_to_hfi(int id, int value)
>  static int
>  venc_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
>  {
> +	struct venus_inst *inst = to_inst(file);
> +	struct venus_core *core = inst->core;
> +
>  	strscpy(cap->driver, "qcom-venus", sizeof(cap->driver));
>  	strscpy(cap->card, "Qualcomm Venus video encoder", sizeof(cap->card));
>  	strscpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
> +	snprintf(cap->bus_info, sizeof(cap->bus_info),
> +		 "platform:%s:enc", dev_name(core->dev));
>  
>  	return 0;
>  }

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] media: venus: assign unique bus_info strings for encoder and decoder
  2025-11-25  8:29   ` Dikshita Agarwal
@ 2025-11-25 12:52     ` Jorge Ramirez
  2025-11-25 13:09       ` Dikshita Agarwal
  0 siblings, 1 reply; 12+ messages in thread
From: Jorge Ramirez @ 2025-11-25 12:52 UTC (permalink / raw)
  To: Dikshita Agarwal
  Cc: Jorge Ramirez-Ortiz, vikash.garodia, bod, mchehab, linux-media,
	linux-arm-msm, linux-kernel

On 25/11/25 13:59:56, Dikshita Agarwal wrote:
> 
> 
> On 11/22/2025 12:13 AM, Jorge Ramirez-Ortiz wrote:
> > The Venus encoder and decoder video devices currently report the same
> > bus_info string ("platform:qcom-venus").
> > 
> > Assign unique bus_info identifiers by appending ":dec" and ":enc" to the
> > parent device name. With this change v4l2-ctl will display two separate
> > logical devices
> > 
> > Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
> > ---
> >  drivers/media/platform/qcom/venus/vdec.c | 5 +++++
> >  drivers/media/platform/qcom/venus/venc.c | 5 +++++
> >  2 files changed, 10 insertions(+)
> > 
> > diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> > index 4a6641fdffcf..63f6ae1ff6ac 100644
> > --- a/drivers/media/platform/qcom/venus/vdec.c
> > +++ b/drivers/media/platform/qcom/venus/vdec.c
> > @@ -433,9 +433,14 @@ vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
> >  static int
> >  vdec_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
> >  {
> > +	struct venus_inst *inst = to_inst(file);
> > +	struct venus_core *core = inst->core;
> > +
> >  	strscpy(cap->driver, "qcom-venus", sizeof(cap->driver));
> >  	strscpy(cap->card, "Qualcomm Venus video decoder", sizeof(cap->card));
> >  	strscpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
> > +	snprintf(cap->bus_info, sizeof(cap->bus_info),
> > +		 "platform:%s:dec", dev_name(core->dev));
> 
> Is there a reason to keep both strscpy() and snprintf() for cap->bus_info?
> The second call to snprintf() seems to overwrite the value set by
> strscpy(), making the first assignment redundant. Would it be cleaner to
> remove the strscpy() line and rely solely on snprintf()?

argh, my bad, you are right. will fix.

perhaps we should just have instead

decoder:
strscpy(cap->bus_info,"platform:qcom-venus-dec", sizeof(cap->bus_info));

encoder:
strscpy(cap->bus_info, "platform:qcom-venus-enc",sizeof(cap->bus_info)); on the encoder

I suppose the additional info provided by the dev_name is not really
important to consumers.

?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] media: venus: assign unique bus_info strings for encoder and decoder
  2025-11-21 19:22   ` Konrad Dybcio
@ 2025-11-25 12:55     ` Jorge Ramirez
  2025-11-27 11:47       ` Konrad Dybcio
  0 siblings, 1 reply; 12+ messages in thread
From: Jorge Ramirez @ 2025-11-25 12:55 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Jorge Ramirez-Ortiz, vikash.garodia, dikshita.agarwal, bod,
	mchehab, linux-media, linux-arm-msm, linux-kernel

On 21/11/25 20:22:13, Konrad Dybcio wrote:
> On 11/21/25 7:43 PM, Jorge Ramirez-Ortiz wrote:
> > The Venus encoder and decoder video devices currently report the same
> > bus_info string ("platform:qcom-venus").
> > 
> > Assign unique bus_info identifiers by appending ":dec" and ":enc" to the
> > parent device name. With this change v4l2-ctl will display two separate
> > logical devices
> > 
> > Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
> > ---
> 
> Perhaps that's a stupid question, but is there a reason they're
> separate at all?

not sure I understand, enc/dec support different APIs, v4l2 controls..is
that what you mean?


> 
> Konrad
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] media: venus: assign unique bus_info strings for encoder and decoder
  2025-11-25 12:52     ` Jorge Ramirez
@ 2025-11-25 13:09       ` Dikshita Agarwal
  2025-11-25 21:19         ` Jorge Ramirez
  0 siblings, 1 reply; 12+ messages in thread
From: Dikshita Agarwal @ 2025-11-25 13:09 UTC (permalink / raw)
  To: Jorge Ramirez, Dikshita Agarwal
  Cc: vikash.garodia, bod, mchehab, linux-media, linux-arm-msm,
	linux-kernel



On 11/25/2025 6:22 PM, Jorge Ramirez wrote:
> On 25/11/25 13:59:56, Dikshita Agarwal wrote:
>>
>>
>> On 11/22/2025 12:13 AM, Jorge Ramirez-Ortiz wrote:
>>> The Venus encoder and decoder video devices currently report the same
>>> bus_info string ("platform:qcom-venus").
>>>
>>> Assign unique bus_info identifiers by appending ":dec" and ":enc" to the
>>> parent device name. With this change v4l2-ctl will display two separate
>>> logical devices
>>>
>>> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
>>> ---
>>>  drivers/media/platform/qcom/venus/vdec.c | 5 +++++
>>>  drivers/media/platform/qcom/venus/venc.c | 5 +++++
>>>  2 files changed, 10 insertions(+)
>>>
>>> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
>>> index 4a6641fdffcf..63f6ae1ff6ac 100644
>>> --- a/drivers/media/platform/qcom/venus/vdec.c
>>> +++ b/drivers/media/platform/qcom/venus/vdec.c
>>> @@ -433,9 +433,14 @@ vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
>>>  static int
>>>  vdec_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
>>>  {
>>> +	struct venus_inst *inst = to_inst(file);
>>> +	struct venus_core *core = inst->core;
>>> +
>>>  	strscpy(cap->driver, "qcom-venus", sizeof(cap->driver));
>>>  	strscpy(cap->card, "Qualcomm Venus video decoder", sizeof(cap->card));
>>>  	strscpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
>>> +	snprintf(cap->bus_info, sizeof(cap->bus_info),
>>> +		 "platform:%s:dec", dev_name(core->dev));
>>
>> Is there a reason to keep both strscpy() and snprintf() for cap->bus_info?
>> The second call to snprintf() seems to overwrite the value set by
>> strscpy(), making the first assignment redundant. Would it be cleaner to
>> remove the strscpy() line and rely solely on snprintf()?
> 
> argh, my bad, you are right. will fix.
> 
> perhaps we should just have instead
> 
> decoder:
> strscpy(cap->bus_info,"platform:qcom-venus-dec", sizeof(cap->bus_info));
> 
> encoder:
> strscpy(cap->bus_info, "platform:qcom-venus-enc",sizeof(cap->bus_info)); on the encoder
> 
> I suppose the additional info provided by the dev_name is not really
> important to consumers.

In-fact, we don't even need to fill the bus_info, received a similar
comment on iris [1]
[1]:
https://lore.kernel.org/linux-media/c4350128-a05c-47af-a7e7-2810171cd311@xs4all.nl/


Thanks,
Dikshita
> 
> ?
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] media: venus: assign unique bus_info strings for encoder and decoder
  2025-11-25 13:09       ` Dikshita Agarwal
@ 2025-11-25 21:19         ` Jorge Ramirez
  2025-11-26  5:31           ` Dikshita Agarwal
  0 siblings, 1 reply; 12+ messages in thread
From: Jorge Ramirez @ 2025-11-25 21:19 UTC (permalink / raw)
  To: Dikshita Agarwal
  Cc: Jorge Ramirez, vikash.garodia, bod, mchehab, linux-media,
	linux-arm-msm, linux-kernel

On 25/11/25 18:39:14, Dikshita Agarwal wrote:
> 
> 
> On 11/25/2025 6:22 PM, Jorge Ramirez wrote:
> > On 25/11/25 13:59:56, Dikshita Agarwal wrote:
> >>
> >>
> >> On 11/22/2025 12:13 AM, Jorge Ramirez-Ortiz wrote:
> >>> The Venus encoder and decoder video devices currently report the same
> >>> bus_info string ("platform:qcom-venus").
> >>>
> >>> Assign unique bus_info identifiers by appending ":dec" and ":enc" to the
> >>> parent device name. With this change v4l2-ctl will display two separate
> >>> logical devices
> >>>
> >>> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
> >>> ---
> >>>  drivers/media/platform/qcom/venus/vdec.c | 5 +++++
> >>>  drivers/media/platform/qcom/venus/venc.c | 5 +++++
> >>>  2 files changed, 10 insertions(+)
> >>>
> >>> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> >>> index 4a6641fdffcf..63f6ae1ff6ac 100644
> >>> --- a/drivers/media/platform/qcom/venus/vdec.c
> >>> +++ b/drivers/media/platform/qcom/venus/vdec.c
> >>> @@ -433,9 +433,14 @@ vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
> >>>  static int
> >>>  vdec_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
> >>>  {
> >>> +	struct venus_inst *inst = to_inst(file);
> >>> +	struct venus_core *core = inst->core;
> >>> +
> >>>  	strscpy(cap->driver, "qcom-venus", sizeof(cap->driver));
> >>>  	strscpy(cap->card, "Qualcomm Venus video decoder", sizeof(cap->card));
> >>>  	strscpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
> >>> +	snprintf(cap->bus_info, sizeof(cap->bus_info),
> >>> +		 "platform:%s:dec", dev_name(core->dev));
> >>
> >> Is there a reason to keep both strscpy() and snprintf() for cap->bus_info?
> >> The second call to snprintf() seems to overwrite the value set by
> >> strscpy(), making the first assignment redundant. Would it be cleaner to
> >> remove the strscpy() line and rely solely on snprintf()?
> > 
> > argh, my bad, you are right. will fix.
> > 
> > perhaps we should just have instead
> > 
> > decoder:
> > strscpy(cap->bus_info,"platform:qcom-venus-dec", sizeof(cap->bus_info));
> > 
> > encoder:
> > strscpy(cap->bus_info, "platform:qcom-venus-enc",sizeof(cap->bus_info)); on the encoder
> > 
> > I suppose the additional info provided by the dev_name is not really
> > important to consumers.
> 
> In-fact, we don't even need to fill the bus_info, received a similar
> comment on iris [1]
> [1]:
> https://lore.kernel.org/linux-media/c4350128-a05c-47af-a7e7-2810171cd311@xs4all.nl/


Nope, that is wrong. 

if we dont fill bus_info we will end up with the following again:

root@qrb2210-rb1-core-kit:~# v4l2-ctl --list-devices
Qualcomm Venus video encoder (platform:5a00000.video-codec):
	 /dev/video0
	 /dev/video1  

instead of something like this:

root@qrb2210-rb1-core-kit:~# v4l2-ctl --list-devices
Qualcomm Venus video decoder (platform:qcom-venus_dec):
	 /dev/video1

Qualcomm Venus video encoder (platform:qcom-venus_enc):
	 /dev/video0

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] media: venus: assign unique bus_info strings for encoder and decoder
  2025-11-25 21:19         ` Jorge Ramirez
@ 2025-11-26  5:31           ` Dikshita Agarwal
  0 siblings, 0 replies; 12+ messages in thread
From: Dikshita Agarwal @ 2025-11-26  5:31 UTC (permalink / raw)
  To: Jorge Ramirez
  Cc: vikash.garodia, bod, mchehab, linux-media, linux-arm-msm,
	linux-kernel



On 11/26/2025 2:49 AM, Jorge Ramirez wrote:
> On 25/11/25 18:39:14, Dikshita Agarwal wrote:
>>
>>
>> On 11/25/2025 6:22 PM, Jorge Ramirez wrote:
>>> On 25/11/25 13:59:56, Dikshita Agarwal wrote:
>>>>
>>>>
>>>> On 11/22/2025 12:13 AM, Jorge Ramirez-Ortiz wrote:
>>>>> The Venus encoder and decoder video devices currently report the same
>>>>> bus_info string ("platform:qcom-venus").
>>>>>
>>>>> Assign unique bus_info identifiers by appending ":dec" and ":enc" to the
>>>>> parent device name. With this change v4l2-ctl will display two separate
>>>>> logical devices
>>>>>
>>>>> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
>>>>> ---
>>>>>  drivers/media/platform/qcom/venus/vdec.c | 5 +++++
>>>>>  drivers/media/platform/qcom/venus/venc.c | 5 +++++
>>>>>  2 files changed, 10 insertions(+)
>>>>>
>>>>> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
>>>>> index 4a6641fdffcf..63f6ae1ff6ac 100644
>>>>> --- a/drivers/media/platform/qcom/venus/vdec.c
>>>>> +++ b/drivers/media/platform/qcom/venus/vdec.c
>>>>> @@ -433,9 +433,14 @@ vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
>>>>>  static int
>>>>>  vdec_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
>>>>>  {
>>>>> +	struct venus_inst *inst = to_inst(file);
>>>>> +	struct venus_core *core = inst->core;
>>>>> +
>>>>>  	strscpy(cap->driver, "qcom-venus", sizeof(cap->driver));
>>>>>  	strscpy(cap->card, "Qualcomm Venus video decoder", sizeof(cap->card));
>>>>>  	strscpy(cap->bus_info, "platform:qcom-venus", sizeof(cap->bus_info));
>>>>> +	snprintf(cap->bus_info, sizeof(cap->bus_info),
>>>>> +		 "platform:%s:dec", dev_name(core->dev));
>>>>
>>>> Is there a reason to keep both strscpy() and snprintf() for cap->bus_info?
>>>> The second call to snprintf() seems to overwrite the value set by
>>>> strscpy(), making the first assignment redundant. Would it be cleaner to
>>>> remove the strscpy() line and rely solely on snprintf()?
>>>
>>> argh, my bad, you are right. will fix.
>>>
>>> perhaps we should just have instead
>>>
>>> decoder:
>>> strscpy(cap->bus_info,"platform:qcom-venus-dec", sizeof(cap->bus_info));
>>>
>>> encoder:
>>> strscpy(cap->bus_info, "platform:qcom-venus-enc",sizeof(cap->bus_info)); on the encoder
>>>
>>> I suppose the additional info provided by the dev_name is not really
>>> important to consumers.
>>
>> In-fact, we don't even need to fill the bus_info, received a similar
>> comment on iris [1]
>> [1]:
>> https://lore.kernel.org/linux-media/c4350128-a05c-47af-a7e7-2810171cd311@xs4all.nl/
> 
> 
> Nope, that is wrong. 
> 
> if we dont fill bus_info we will end up with the following again:
> 
> root@qrb2210-rb1-core-kit:~# v4l2-ctl --list-devices
> Qualcomm Venus video encoder (platform:5a00000.video-codec):
> 	 /dev/video0
> 	 /dev/video1  
> 
> instead of something like this:
> 
> root@qrb2210-rb1-core-kit:~# v4l2-ctl --list-devices
> Qualcomm Venus video decoder (platform:qcom-venus_dec):
> 	 /dev/video1
> 
> Qualcomm Venus video encoder (platform:qcom-venus_enc):
> 	 /dev/video0

Got it.

Thanks,
Dikshita

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] media: venus: assign unique bus_info strings for encoder and decoder
  2025-11-25 12:55     ` Jorge Ramirez
@ 2025-11-27 11:47       ` Konrad Dybcio
  2025-11-27 17:11         ` Jorge Ramirez
  0 siblings, 1 reply; 12+ messages in thread
From: Konrad Dybcio @ 2025-11-27 11:47 UTC (permalink / raw)
  To: Jorge Ramirez
  Cc: vikash.garodia, dikshita.agarwal, bod, mchehab, linux-media,
	linux-arm-msm, linux-kernel

On 11/25/25 1:55 PM, Jorge Ramirez wrote:
> On 21/11/25 20:22:13, Konrad Dybcio wrote:
>> On 11/21/25 7:43 PM, Jorge Ramirez-Ortiz wrote:
>>> The Venus encoder and decoder video devices currently report the same
>>> bus_info string ("platform:qcom-venus").
>>>
>>> Assign unique bus_info identifiers by appending ":dec" and ":enc" to the
>>> parent device name. With this change v4l2-ctl will display two separate
>>> logical devices
>>>
>>> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
>>> ---
>>
>> Perhaps that's a stupid question, but is there a reason they're
>> separate at all?
> 
> not sure I understand, enc/dec support different APIs, v4l2 controls..is
> that what you mean?

Perhaps that shows my lack of knowledge about V4L2. I had imagined that
a single video device could implement (non-colliding) enc_xyz and dec_xyz
operations and was wondering why we need two.

Konrad

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] media: venus: assign unique bus_info strings for encoder and decoder
  2025-11-27 11:47       ` Konrad Dybcio
@ 2025-11-27 17:11         ` Jorge Ramirez
  2025-11-27 18:34           ` Konrad Dybcio
  0 siblings, 1 reply; 12+ messages in thread
From: Jorge Ramirez @ 2025-11-27 17:11 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Jorge Ramirez, vikash.garodia, dikshita.agarwal, bod, mchehab,
	linux-media, linux-arm-msm, linux-kernel

On 27/11/25 12:47:19, Konrad Dybcio wrote:
> On 11/25/25 1:55 PM, Jorge Ramirez wrote:
> > On 21/11/25 20:22:13, Konrad Dybcio wrote:
> >> On 11/21/25 7:43 PM, Jorge Ramirez-Ortiz wrote:
> >>> The Venus encoder and decoder video devices currently report the same
> >>> bus_info string ("platform:qcom-venus").
> >>>
> >>> Assign unique bus_info identifiers by appending ":dec" and ":enc" to the
> >>> parent device name. With this change v4l2-ctl will display two separate
> >>> logical devices
> >>>
> >>> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
> >>> ---
> >>
> >> Perhaps that's a stupid question, but is there a reason they're
> >> separate at all?
> > 
> > not sure I understand, enc/dec support different APIs, v4l2 controls..is
> > that what you mean?
> 
> Perhaps that shows my lack of knowledge about V4L2. I had imagined that
> a single video device could implement (non-colliding) enc_xyz and dec_xyz
> operations and was wondering why we need two.
>

I think the main issue is that the pipelines have very different
flows/states and semantics so even if the IP block serves both, the
v4l2 abstraction needs to have them separate (plus we want concurrency).

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] media: venus: assign unique bus_info strings for encoder and decoder
  2025-11-27 17:11         ` Jorge Ramirez
@ 2025-11-27 18:34           ` Konrad Dybcio
  0 siblings, 0 replies; 12+ messages in thread
From: Konrad Dybcio @ 2025-11-27 18:34 UTC (permalink / raw)
  To: Jorge Ramirez
  Cc: vikash.garodia, dikshita.agarwal, bod, mchehab, linux-media,
	linux-arm-msm, linux-kernel

On 11/27/25 6:11 PM, Jorge Ramirez wrote:
> On 27/11/25 12:47:19, Konrad Dybcio wrote:
>> On 11/25/25 1:55 PM, Jorge Ramirez wrote:
>>> On 21/11/25 20:22:13, Konrad Dybcio wrote:
>>>> On 11/21/25 7:43 PM, Jorge Ramirez-Ortiz wrote:
>>>>> The Venus encoder and decoder video devices currently report the same
>>>>> bus_info string ("platform:qcom-venus").
>>>>>
>>>>> Assign unique bus_info identifiers by appending ":dec" and ":enc" to the
>>>>> parent device name. With this change v4l2-ctl will display two separate
>>>>> logical devices
>>>>>
>>>>> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
>>>>> ---
>>>>
>>>> Perhaps that's a stupid question, but is there a reason they're
>>>> separate at all?
>>>
>>> not sure I understand, enc/dec support different APIs, v4l2 controls..is
>>> that what you mean?
>>
>> Perhaps that shows my lack of knowledge about V4L2. I had imagined that
>> a single video device could implement (non-colliding) enc_xyz and dec_xyz
>> operations and was wondering why we need two.
>>
> 
> I think the main issue is that the pipelines have very different
> flows/states and semantics so even if the IP block serves both, the
> v4l2 abstraction needs to have them separate (plus we want concurrency).

Ah right, that makes sense

Thanks!

Konrad

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-11-27 18:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <3FJhEomSdQ2CUrDJZaWiNVmSKYmUGylmoUUZc_15p0xnLmG_gydDxIyJDrUnemnatDXNOtQAqbWytjZ-xZAJ_w==@protonmail.internalid>
2025-11-21 18:43 ` [PATCH] media: venus: assign unique bus_info strings for encoder and decoder Jorge Ramirez-Ortiz
2025-11-21 19:22   ` Konrad Dybcio
2025-11-25 12:55     ` Jorge Ramirez
2025-11-27 11:47       ` Konrad Dybcio
2025-11-27 17:11         ` Jorge Ramirez
2025-11-27 18:34           ` Konrad Dybcio
2025-11-22 16:17   ` Bryan O'Donoghue
2025-11-25  8:29   ` Dikshita Agarwal
2025-11-25 12:52     ` Jorge Ramirez
2025-11-25 13:09       ` Dikshita Agarwal
2025-11-25 21:19         ` Jorge Ramirez
2025-11-26  5:31           ` Dikshita Agarwal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox