Skip to content

Commit

Permalink
[media] vivid: default to single planar device instances
Browse files Browse the repository at this point in the history
The default used to be that the first vivid device instance was
single planar, the second multi planar, the third single planar, etc.

However, that turned out to be unexpected and awkward. Change the
driver to always default to single planar.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Nov 3, 2014
1 parent d358aef commit cba63cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
12 changes: 5 additions & 7 deletions Documentation/video4linux/vivid.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,11 @@ ccs_out_mode: specify the allowed video output crop/compose/scaling combination
key, not quality.

multiplanar: select whether each device instance supports multi-planar formats,
and thus the V4L2 multi-planar API. By default the first device instance
is single-planar, the second multi-planar, and it keeps alternating.
and thus the V4L2 multi-planar API. By default device instances are
single-planar.

This module option can override that for each instance. Values are:

0: use alternating single and multi-planar devices.
1: this is a single-planar instance.
2: this is a multi-planar instance.

Expand Down Expand Up @@ -975,9 +974,8 @@ is set, then the alpha component is only used for the color red and set to
0 otherwise.

The driver has to be configured to support the multiplanar formats. By default
the first driver instance is single-planar, the second is multi-planar, and it
keeps alternating. This can be changed by setting the multiplanar module option,
see section 1 for more details on that option.
the driver instances are single-planar. This can be changed by setting the
multiplanar module option, see section 1 for more details on that option.

If the driver instance is using the multiplanar formats/API, then the first
single planar format (YUYV) and the multiplanar NV16M and NV61M formats the
Expand Down Expand Up @@ -1021,7 +1019,7 @@ the output overlay for the video output, turn on video looping and capture
to see the blended framebuffer overlay that's being written to by the second
instance. This setup would require the following commands:

$ sudo modprobe vivid n_devs=2 node_types=0x10101,0x1 multiplanar=1,1
$ sudo modprobe vivid n_devs=2 node_types=0x10101,0x1
$ v4l2-ctl -d1 --find-fb
/dev/fb1 is the framebuffer associated with base address 0x12800000
$ sudo v4l2-ctl -d2 --set-fbuf fb=1
Expand Down
11 changes: 3 additions & 8 deletions drivers/media/platform/vivid/vivid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,9 @@ MODULE_PARM_DESC(ccs_out_mode, " output crop/compose/scale mode:\n"
"\t\t bit 0=crop, 1=compose, 2=scale,\n"
"\t\t -1=user-controlled (default)");

static unsigned multiplanar[VIVID_MAX_DEVS];
static unsigned multiplanar[VIVID_MAX_DEVS] = { [0 ... (VIVID_MAX_DEVS - 1)] = 1 };
module_param_array(multiplanar, uint, NULL, 0444);
MODULE_PARM_DESC(multiplanar, " 0 (default) is alternating single and multiplanar devices,\n"
"\t\t 1 is single planar devices,\n"
"\t\t 2 is multiplanar devices");
MODULE_PARM_DESC(multiplanar, " 1 (default) creates a single planar device, 2 creates a multiplanar device.");

/* Default: video + vbi-cap (raw and sliced) + radio rx + radio tx + sdr + vbi-out + vid-out */
static unsigned node_types[VIVID_MAX_DEVS] = { [0 ... (VIVID_MAX_DEVS - 1)] = 0x1d3d };
Expand Down Expand Up @@ -669,10 +667,7 @@ static int __init vivid_create_instance(int inst)
/* start detecting feature set */

/* do we use single- or multi-planar? */
if (multiplanar[inst] == 0)
dev->multiplanar = inst & 1;
else
dev->multiplanar = multiplanar[inst] > 1;
dev->multiplanar = multiplanar[inst] > 1;
v4l2_info(&dev->v4l2_dev, "using %splanar format API\n",
dev->multiplanar ? "multi" : "single ");

Expand Down

0 comments on commit cba63cf

Please sign in to comment.