aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vivid (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-02-02[media] vivid: use consistent colorspace/Y'CbCr Encoding stringsHans Verkuil1-2/+2
Keep the colorspace and encoding names consistent with what is used elsewhere (primarily the utilities in v4l-utils.git). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29[media] vivid: Y offset should depend on quant. rangeHans Verkuil1-4/+6
When converting to or from Y'CbCr and R'G'B' the Y offset depends on the quantization range: it's 0 for full and 16 for limited range. But in the code it was hardcoded to 16. This messed up the brightness of the generated pattern. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27[media] vivid: remove unnecessary version.h inclusionFabian Frederick1-1/+0
Based on versioncheck. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-16[media] vivid: fix CROP_BOUNDS typo for video outputHans Verkuil1-1/+1
An error was returned if composing was not supported, instead of if cropping was not supported. A classic copy-and-paste bug. Found with v4l2-compliance. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: <stable@vger.kernel.org> # for v3.18 Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-02[media] vivid: add support for YCbCr encoding and quantizationHans Verkuil5-19/+116
Implement controls to set the YCbCr encoding and the quantization range for the colorspace. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-02[media] vivid: add new colorspacesHans Verkuil3-18/+36
Add AdobeRGB and BT.2020 support. The colorspace control now orders the colorspaces according to how often they are used. So rarely used colorspaces are moved to the end. This makes it more logical when testing colorspace support. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-02[media] vivid-tpg: improve colorspace supportHans Verkuil2-107/+258
Add support for the new AdobeRGB and BT.2020 colorspaces. Also support explicit Y'CbCr and quantization settings. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-02[media] vivid-tpg-colors: add AdobeRGB and BT.2020 supportHans Verkuil2-43/+665
This extends the precalculated tpg_csc_colors matrix with AdobeRGB and BT.2020 colorspace support. It also adds two precalculated tables that convert between linear RGB and non-linear Rec.709 R'G'B' values, i.e. the Rec. 709 transfer function. This is needed to efficiently handle the BT.2020 Constant Luminance Yc'CbcCrc encoding and decoding. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-25[media] vivid: enable vb2_expbuf supportHans Verkuil1-1/+1
Now that vb2 supports DMABUF export for dma-sg and vmalloc memory modes, we can enable the vb2_expbuf support in vivid. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Pawel Osciak <pawel@osciak.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-25[media] media: vivid: use vb2_ops_wait_prepare/finish helperPrabhakar Lad7-27/+15
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14[media] media: vivid: use vb2_start_streaming_called() helperPrabhakar Lad1-5/+5
this patch adds support for using vb2_start_streaming_called() for vivid driver. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-11[media] vivid: add test array controlsHans Verkuil1-0/+42
Add array controls to test support for such controls. There is one array with just one element, one 8x16 matrix control and one 4 dimensional 2x3x4x5 control. This makes it possible to experiment with such controls without requiring hard-to-get hardware. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03[media] vivid: default to single planar device instancesHans Verkuil1-8/+3
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>
2014-10-21[media] vivid: fix buffer overrunHans Verkuil1-1/+1
The random_line buffer must be twice the maximum width, but it only allocated the maximum width, so it was only half the size it needed to be. Surprisingly I never saw the kernel fail on this, but the same TPG code used in qv4l2 crashed and valgrind helped me track this bug down. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-21[media] vivid: fix Kconfig FB dependencyHans Verkuil1-1/+4
The vivid driver depends on FB, update the Kconfig accordingly. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reported-by: Jim Davis <jim.epost@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] vivid: add teletext support to VBI captureHans Verkuil6-21/+111
This is useful to test teletext capture applications like alevt and mtt. It also fixes a previously undetected bug where the PAL VBI start line of the second field was off by one. Using the new field start defines helps a lot fixing such bugs. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-08[media] vivid: tpg_reset_source prototype mismatchHans Verkuil1-1/+1
Replaced enum v4l2_field by u32, just as the prototype in the header has. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-08[media] vivid: add missing includesHans Verkuil5-0/+5
Fix kbuild test robot warnings about missing vmalloc.h and string.h includes. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-08[media] vivid: remove duplicate and unused g/s_edid functionsHans Verkuil2-58/+0
I'm not sure how I missed this, but they should be removed. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03[media] vivid-tpg: use true/false for boolean varsMauro Carvalho Chehab1-2/+2
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03[media] vivid-vid-out: use memdup_user()Mauro Carvalho Chehab1-7/+3
Instead of allocating and coping from __user, do it using one atomic call. That makes the code simpler. Found by coccinelle. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02[media] vivid: comment the unused g_edid/s_edid functionsMauro Carvalho Chehab1-0/+2
Those non-static functions aren't used anywhere yet. Comment them while they're unused. Solves the following warnings: drivers/media/platform/vivid/vivid-vid-out.c:1120:5: warning: no previous prototype for 'vivid_vid_out_g_edid' [-Wmissing-prototypes] int vivid_vid_out_g_edid(struct file *file, void *_fh, ^ drivers/media/platform/vivid/vivid-vid-out.c:1152:5: warning: no previous prototype for 'vivid_vid_out_s_edid' [-Wmissing-prototypes] int vivid_vid_out_s_edid(struct file *file, void *_fh, ^ Cc: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02[media] vivid: Don't declare .vidioc_overlay twiceMauro Carvalho Chehab1-1/+0
Removes the following warnings: drivers/media/platform/vivid/vivid-core.c:581:2: warning: initialized field overwritten [-Woverride-init] .vidioc_overlay = vidioc_overlay, ^ drivers/media/platform/vivid/vivid-core.c:581:2: warning: (near initialization for 'vivid_ioctl_ops.vidioc_overlay') [-Woverride-init] Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02[media] vivid: add some missing headersMauro Carvalho Chehab2-0/+2
That remove a few warnings: drivers/media/platform/vivid/vivid-kthread-out.c:226:5: warning: no previous prototype for 'vivid_start_generating_vid_out' [-Wmissing-prototypes] int vivid_start_generating_vid_out(struct vivid_dev *dev, bool *pstreaming) ^ drivers/media/platform/vivid/vivid-kthread-out.c:260:6: warning: no previous prototype for 'vivid_stop_generating_vid_out' [-Wmissing-prototypes] void vivid_stop_generating_vid_out(struct vivid_dev *dev, bool *pstreaming) ^ drivers/media/platform/vivid/vivid-kthread-cap.c:806:5: warning: no previous prototype for 'vivid_start_generating_vid_cap' [-Wmissing-prototypes] int vivid_start_generating_vid_cap(struct vivid_dev *dev, bool *pstreaming) ^ drivers/media/platform/vivid/vivid-kthread-cap.c:841:6: warning: no previous prototype for 'vivid_stop_generating_vid_cap' [-Wmissing-prototypes] void vivid_stop_generating_vid_cap(struct vivid_dev *dev, bool *pstreaming) ^ Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02[media] vivid: enable the vivid driverHans Verkuil2-0/+25
Update the Kconfig and Makefile files so this driver can be compiled. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02[media] vivid: Don't mess with namespace adding a "get_format" functionMauro Carvalho Chehab4-12/+12
This fixes a compilation error with allyesconfig: drivers/media/platform/exynos-gsc/built-in.o: In function `get_format': (.text+0x12f5): multiple definition of `get_format' drivers/media/platform/vivid/built-in.o:(.text+0x4bf4): first defined here Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02[media] vivid: add support for software defined radioHans Verkuil2-0/+533
This adds support for an SDR capture device. It generates simple sine/cosine waves. The code for that has been contributed by Antti. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02[media] vivid: add support for radio receivers and transmittersHans Verkuil8-0/+935
This adds radio receiver and transmitter support. Part of that is common to both and so is placed in the radio-common source. These drivers also support RDS. In order to generate valid RDS data a simple RDS generator is implemented in rds-gen. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02[media] vivid: add the Test Pattern GeneratorHans Verkuil4-0/+2251
The test patterns for video capture are generated by this code. All patterns are precalculated taking into account colorspace information, pixel and video aspect ratios and scaling information. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02[media] vivid: add a simple framebuffer device for overlay testingHans Verkuil2-0/+427
In order to test capture and output overlays a simple framebuffer device is created. It's bare bone, but it does the job. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02[media] vivid: add the kthread code that controls the video rateHans Verkuil4-0/+1241
Add the kthread handlers for video/vbi capture and video/vbi output. These carefully control the rate at which frames are generated (video capture) and accepted (video output). While the short-term jitter is around the order of a jiffie, in the long term the rate matches the configured framerate exactly. The capture thread handler also takes care of the video looping and of capture and overlay support. This is probably the most complex part of this driver due to the many combinations of crop, compose and scaling on the input and output, and the blending that has to be done if overlay support is enabled as well. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02[media] vivid: add VBI capture and output codeHans Verkuil6-0/+958
This adds support for VBI capture (raw and sliced) and VBI output (raw and sliced) to the vivid driver. In addition a VBI generator is added that generates simple VBI data in either sliced or raw format. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02[media] vivid: add the video capture and output partsHans Verkuil6-0/+3694
This adds the ioctl and vb2 queue support for video capture and output. Part of this is common to both, so that is placed in a vid-common source. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02[media] vivid: add the control handling codeHans Verkuil2-0/+1536
The vivid-ctrls code sets up and processes the various V4L2 controls that are needed by this driver. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02[media] vivid: add core driver codeHans Verkuil2-0/+1910
This is the core driver code that creates all the driver instances and all the configured devices. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>