Skip to contentSkip to conversation

media: venus: assign unique bus_info strings for encoder and decoder

PATCH Superseded Jorge Ramirez-Ortiz 4 participants 12 messages Nov 21, 2025 – Nov 27, 2025

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: venus: assign unique bus_info strings for encoder and decoder

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

---
 drivers/media/platform/qcom/venus/vdec.c | 5 +++++
 drivers/media/platform/qcom/venus/venc.c | 5 +++++
 2 files changed, 10 insertions(+)
drivers/media/platform/qcom/venus/vdec.c +5 -0
index 4a6641fdffcf..63f6ae1ff6ac 100644
@@ -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;
 }
drivers/media/platform/qcom/venus/venc.c +5 -0
index b478b982a80d..520689f5533d 100644
@@ -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;
 }
Signature · 1 line
2.43.0
#1 lore raw
Quoted 9 lines · Jorge Ramirez-Ortiz

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

---

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

Konrad

#2 lore raw
Quoted 8 lines · Konrad Dybcio
Quoted 7 lines · Jorge Ramirez-Ortiz

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

Quoted 5 lines
Quoted 2 lines

---

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?

Quoted 3 lines

Konrad

#3 lore raw
Quoted 9 lines · Jorge Ramirez
Quoted 8 lines · Konrad Dybcio
Quoted 7 lines · Jorge Ramirez-Ortiz

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

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

---

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

#4 lore raw
Quoted 16 lines · Konrad Dybcio
Quoted 15 lines · Jorge Ramirez
Quoted 13 lines · Konrad Dybcio
Quoted 9 lines · Jorge Ramirez-Ortiz

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

---

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

Quoted 7 lines
Quoted 2 lines

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).

#5 lore raw
Quoted 20 lines · Jorge Ramirez
Quoted 19 lines · Konrad Dybcio
Quoted 17 lines · Jorge Ramirez
Quoted 8 lines · Konrad Dybcio
Quoted 7 lines · Jorge Ramirez-Ortiz

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

Quoted 5 lines
Quoted 2 lines

---

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?

Quoted 8 lines
Quoted 4 lines

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

maintainer Reviewed-by on v1 1/1
#6 lore raw
In reply to Jorge Ramirez-Ortiz
Quoted 52 lines · Jorge Ramirez-Ortiz

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

---
  drivers/media/platform/qcom/venus/vdec.c | 5 +++++
  drivers/media/platform/qcom/venus/venc.c | 5 +++++
  2 files changed, 10 insertions(+)
drivers/media/platform/qcom/venus/vdec.c +5 -0
index 4a6641fdffcf..63f6ae1ff6ac 100644
@@ -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;
  }
drivers/media/platform/qcom/venus/venc.c +5 -1
index b478b982a80d..520689f5533d 100644
@@ -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;
  }
--
Quoted 2 lines

2.43.0

maintainer
#7 lore raw
In reply to Jorge Ramirez-Ortiz
Quoted 19 lines · Jorge Ramirez-Ortiz

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

---
 drivers/media/platform/qcom/venus/vdec.c | 5 +++++
 drivers/media/platform/qcom/venus/venc.c | 5 +++++
 2 files changed, 10 insertions(+)
drivers/media/platform/qcom/venus/vdec.c +0 -0
index 4a6641fdffcf..63f6ae1ff6ac 100644
@@ -433,9 +433,14 @@ vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
 static int

drivers/media/platform/qcom/venus/vdec.c vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s) · line 443

Quoted 10 lines
drivers/media/platform/qcom/venus/vdec.c +5 -0
 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

Quoted 22 lines
drivers/media/platform/qcom/venus/vdec.c +0 -0
 	return 0;
 }
drivers/media/platform/qcom/venus/venc.c +5 -0
index b478b982a80d..520689f5533d 100644
@@ -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;
 }
#8 lore raw
Quoted 29 lines · Dikshita Agarwal
Quoted 26 lines · Jorge Ramirez-Ortiz

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

---
 drivers/media/platform/qcom/venus/vdec.c | 5 +++++
 drivers/media/platform/qcom/venus/venc.c | 5 +++++
 2 files changed, 10 insertions(+)
drivers/media/platform/qcom/venus/vdec.c +3 -0
index 4a6641fdffcf..63f6ae1ff6ac 100644
@@ -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));
Quoted 8 lines

drivers/media/platform/qcom/venus/vdec.c vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s) · line 443

Quoted 3 lines
drivers/media/platform/qcom/venus/vdec.c +2 -0
 	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.

?

maintainer
#9 lore raw
Quoted 43 lines · Jorge Ramirez
Quoted 29 lines · Dikshita Agarwal
Quoted 26 lines · Jorge Ramirez-Ortiz

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

---
 drivers/media/platform/qcom/venus/vdec.c | 5 +++++
 drivers/media/platform/qcom/venus/venc.c | 5 +++++
 2 files changed, 10 insertions(+)
drivers/media/platform/qcom/venus/vdec.c +3 -0
index 4a6641fdffcf..63f6ae1ff6ac 100644
@@ -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));
Quoted 8 lines

drivers/media/platform/qcom/venus/vdec.c vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s) · line 443

Quoted 3 lines
drivers/media/platform/qcom/venus/vdec.c +2 -0
 	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

Quoted 8 lines

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/[email protected]/

Thanks,
Dikshita

Quoted 3 lines

?

#10 lore raw
Quoted 52 lines · Dikshita Agarwal
Quoted 49 lines · Jorge Ramirez
Quoted 29 lines · Dikshita Agarwal
Quoted 26 lines · Jorge Ramirez-Ortiz

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

---
 drivers/media/platform/qcom/venus/vdec.c | 5 +++++
 drivers/media/platform/qcom/venus/venc.c | 5 +++++
 2 files changed, 10 insertions(+)
drivers/media/platform/qcom/venus/vdec.c +3 -0
index 4a6641fdffcf..63f6ae1ff6ac 100644
@@ -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));
Quoted 8 lines

drivers/media/platform/qcom/venus/vdec.c vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s) · line 443

Quoted 3 lines
drivers/media/platform/qcom/venus/vdec.c +2 -0
 	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

Quoted 7 lines
Quoted 2 lines

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/[email protected]/

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
maintainer
#11 lore raw
Quoted 71 lines · Jorge Ramirez
Quoted 52 lines · Dikshita Agarwal
Quoted 49 lines · Jorge Ramirez
Quoted 29 lines · Dikshita Agarwal
Quoted 26 lines · Jorge Ramirez-Ortiz

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

---
 drivers/media/platform/qcom/venus/vdec.c | 5 +++++
 drivers/media/platform/qcom/venus/venc.c | 5 +++++
 2 files changed, 10 insertions(+)
drivers/media/platform/qcom/venus/vdec.c +3 -0
index 4a6641fdffcf..63f6ae1ff6ac 100644
@@ -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));
Quoted 8 lines

drivers/media/platform/qcom/venus/vdec.c vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s) · line 443

Quoted 3 lines
drivers/media/platform/qcom/venus/vdec.c +2 -0
 	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

Quoted 7 lines
Quoted 2 lines

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/[email protected]/

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  
Quoted 8 lines

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