Commit 69d78a80 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

media: vivid: set num_in/outputs to 0 if not supported

If node_types does not have video/vbi/meta inputs or outputs,
then set num_inputs/num_outputs to 0 instead of 1.
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Fixes: 0c90f649 (media: vivid: add vivid_create_queue() helper)
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 957148e2
...@@ -942,8 +942,12 @@ static int vivid_detect_feature_set(struct vivid_dev *dev, int inst, ...@@ -942,8 +942,12 @@ static int vivid_detect_feature_set(struct vivid_dev *dev, int inst,
/* how many inputs do we have and of what type? */ /* how many inputs do we have and of what type? */
dev->num_inputs = num_inputs[inst]; dev->num_inputs = num_inputs[inst];
if (dev->num_inputs < 1) if (node_type & 0x20007) {
dev->num_inputs = 1; if (dev->num_inputs < 1)
dev->num_inputs = 1;
} else {
dev->num_inputs = 0;
}
if (dev->num_inputs >= MAX_INPUTS) if (dev->num_inputs >= MAX_INPUTS)
dev->num_inputs = MAX_INPUTS; dev->num_inputs = MAX_INPUTS;
for (i = 0; i < dev->num_inputs; i++) { for (i = 0; i < dev->num_inputs; i++) {
...@@ -960,8 +964,12 @@ static int vivid_detect_feature_set(struct vivid_dev *dev, int inst, ...@@ -960,8 +964,12 @@ static int vivid_detect_feature_set(struct vivid_dev *dev, int inst,
/* how many outputs do we have and of what type? */ /* how many outputs do we have and of what type? */
dev->num_outputs = num_outputs[inst]; dev->num_outputs = num_outputs[inst];
if (dev->num_outputs < 1) if (node_type & 0x40300) {
dev->num_outputs = 1; if (dev->num_outputs < 1)
dev->num_outputs = 1;
} else {
dev->num_outputs = 0;
}
if (dev->num_outputs >= MAX_OUTPUTS) if (dev->num_outputs >= MAX_OUTPUTS)
dev->num_outputs = MAX_OUTPUTS; dev->num_outputs = MAX_OUTPUTS;
for (i = 0; i < dev->num_outputs; i++) { for (i = 0; i < dev->num_outputs; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment