summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vivid
Commit message (Collapse)AuthorAgeFilesLines
...
* [media] vivid: add support for NV24 and NV42Hans Verkuil2015-04-022-2/+44
| | | | | | | Add support for the YUV 4:4:4 formats NV24 and NV42. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: add support for [A|X]RGB555XHans Verkuil2015-04-022-1/+27
| | | | | | | Only RGB555X was supported, add support for the other two variants. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: fix format commentsHans Verkuil2015-04-021-7/+7
| | | | | | | | Clarify which formats have an alpha channel and which do not by using 'x' instead of 'a' if there is no alpha channel. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: add RGB444 supportHans Verkuil2015-04-022-0/+46
| | | | | | | Add support for (A/X)RGB444 formats. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: add the new planar and monochrome formatsHans Verkuil2015-04-021-3/+111
| | | | | | | | Everything is in place to support these formats, so add them to the list. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: add downsampling supportHans Verkuil2015-04-022-32/+43
| | | | | | | | Add support in vivid for downsampling. Most of the changes are in vivid_copy_buffer which needs to know about the right line widths. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: add support for single buffer planar formatsHans Verkuil2015-04-025-79/+105
| | | | | | | | Make vivid aware of the difference of planes and buffers. Note that this does not yet add support for hor/vert downsampled formats. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: add new format fieldsHans Verkuil2015-04-024-33/+81
| | | | | | | These fields are necessary to handle the new planar formats. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: split off the pattern drawing codeHans Verkuil2015-04-021-158/+162
| | | | | | | | | The last part of the vivid-tpg refactoring: split off the pattern drawing code into a function of its own. This greatly improves the readability and maintainability of this code. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: move the 'extras' drawing to a separate functionHans Verkuil2015-04-021-112/+104
| | | | | | | | This moves the drawing code for the extras (border, square, etc) to a function of its own instead of having this in the main for loop. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: move 'extras' parameters to tpg_draw_paramsHans Verkuil2015-04-021-42/+58
| | | | | | | | Any parameters related to drawing 'extras' like the border, the square, etc. are moved to struct tpg_draw_params. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: move pattern-related fields to struct tpg_draw_paramsHans Verkuil2015-04-021-6/+24
| | | | | | | | Add a new function that fills in pattern-related fields in struct tpg_draw_params. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: move common parameters to tpg_draw_paramsHans Verkuil2015-04-021-12/+22
| | | | | | | Replace local variables by fields in the tpg_draw_params struct. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: add a new tpg_draw_params structureHans Verkuil2015-04-021-0/+29
| | | | | | | This is needed to refactor the drawing function which is much too big. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: add const where appropriateHans Verkuil2015-04-022-7/+9
| | | | | | | Added 'const' to several functions where that is possible to do. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: add helper functions to simplify common calculationsHans Verkuil2015-04-022-73/+80
| | | | | | | | Add helper functions to handle horizontal downscaling and horizontal scaling. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: add support for V4L2_PIX_FMT_GREYHans Verkuil2015-04-021-1/+8
| | | | | | | Add monochrome support to the TPG. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: add support for more planar formatsHans Verkuil2015-04-021-1/+89
| | | | | | | | | | | | | | | | | | | | | | Now that the support for hor/vert downsampled planar formats is in place we can add support for such formats to the TPG. This patch adds support for: V4L2_PIX_FMT_YUV420M V4L2_PIX_FMT_YVU420M V4L2_PIX_FMT_YUV420 V4L2_PIX_FMT_YVU420 V4L2_PIX_FMT_YUV422P V4L2_PIX_FMT_NV16 V4L2_PIX_FMT_NV61 V4L2_PIX_FMT_NV12 V4L2_PIX_FMT_NV21 V4L2_PIX_FMT_NV12P V4L2_PIX_FMT_NV21P Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: finish hor/vert downsampling supportHans Verkuil2015-04-021-18/+110
| | | | | | | | Implement horizontal and vertical downsampling when filling in the plane. The TPG is now ready to support such formats. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: add hor/vert downsampling support to tpg_gen_textHans Verkuil2015-04-021-7/+20
| | | | | | | | This will just skip lines/pixels since color fidelity is not quite as important here as it is with the test patterns themselves. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: correctly average the two pixels in gen_twopix()Hans Verkuil2015-04-021-6/+42
| | | | | | | | | | | gen_twopix() is always called twice: once for the first and once for the second pixel. Improve the code to properly average the two if the format requires horizontal downsampling. This is necessary for patterns like 1x1 red/blue checkers. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: precalculate downsampled linesHans Verkuil2015-04-022-2/+39
| | | | | | | | | | | | | | | | | When dealing with vertical downsampling two successive lines have to be averaged. In the case of the test pattern generator that only happens if the two lines are using different patterns. So precalculate the average between two pattern lines: one of pattern P and one of pattern P + 1. That way there is no need to do any on-the-fly downsampling: it's all done in the precalculate phase. This patch also implements horizontal downsampling in the precalculate phase. The only thing that needs to be done is to half the width since the actual downsampling happens when two pixels at a time are generated. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: add hor/vert downsampling fieldsHans Verkuil2015-04-022-6/+16
| | | | | | | | | | | | This is step one of supporting horizontal and vertical downsampling. This just adds support for the h/vdownsampling fields and it increases the maximum number of planes to 3. Currently none of the planar formats need horizontal or vertical downsampling, so this change has no effect at the moment. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: add helper functions for single buffer planar formatsHans Verkuil2015-04-022-2/+69
| | | | | | | | Add helpers functions to determine the line widths and image sizes for planar formats that are stores in a single buffer. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: separate planes and buffersHans Verkuil2015-04-022-0/+9
| | | | | | | | | Add a new field that contains the number of buffers. This may be less than the number of planes in case multiple planes are combined into one buffer. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: do not allow video loopback for SEQ_TB/BTHans Verkuil2015-04-021-0/+7
| | | | | | | | Sequential top-bottom/bottom-top fields are not supported as video loopback. This is too much work to implement for field settings that are rarely used. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: don't add offset when switching to monochromeHans Verkuil2015-04-021-1/+1
| | | | | | | | The grayscale values are still full range sRGB, so don't add the limited range offset. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: add new checkboard patternsHans Verkuil2015-04-022-3/+26
| | | | | | | | | Add a 2x2 checker patterns and 1x1 and 2x2 red/blue checker patterns. Useful for testing 4:2:2 and 4:2:0 formats. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: fix test pattern movement for V4L2_FIELD_ALTERNATEHans Verkuil2015-04-024-4/+12
| | | | | | | | | | | | | | The successive TOP/BOTTOM fields did not move as they should: only every other field actually changed position. The cause was that the tpg needs to know if it is dealing with a FIELD_ALTERNATE case since that requires slightly different handling. So tell the TPG whether or not the field setting is for the ALTERNATE case or not. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: use TPG_MAX_PLANES instead of hardcoding plane-arraysHans Verkuil2015-04-021-2/+2
| | | | | | | | | Two arrays of size 'max number of planes' have a hardcoded size instead of using TPG_MAX_PLANES. Fix that, since TPG_MAX_PLANES will be increased later on. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: wrong top/bottom order for FIELD_ALTERNATEHans Verkuil2015-04-021-1/+1
| | | | | | | | The condition to decide whether the current field is top or bottom was inverted. Fix this. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: fix typo in plane size checksHans Verkuil2015-04-021-2/+2
| | | | | | | | | | | The plane size check was hardcoded to plane 0 instead of using the plane index. This failed when using the NV61M format which has a larger plane size for the second plane compared to the first plane. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: the overlay API wasn't disabled completely for multiplanarHans Verkuil2015-04-021-0/+19
| | | | | | | | | If the vivid driver is loaded in multiplanar mode, then the capture overlay functionality should be disabled. This wasn't fully done, which led to v4l2-compliance errors. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: BT.2020 R'G'B' is limited rangeHans Verkuil2015-04-021-0/+4
| | | | | | | | According to the standard the R'G'B' BT.2020 colorspace is limited range, not full range. Fix this. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] drivers: media: platform: vivid: Fix possible null derefrenceTapasweni Pathak2015-04-021-1/+3
| | | | | | | | | | | | Check for dev_fmt being null before derefrencing it, to assign it to planes. Found using Coccinelle. Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid sdr: fix broken sine tone generated for sdr FMPrashant Laddha2015-03-021-1/+1
| | | | | | | | | | | | | | | | FM (frequency modulated) signal for SDR is generated by varying the phase, where phase variation is proportional to input signal. It is seen that, the larger phase increments leads to discontinuities in the signal recovered after demodulation. Reducing the extent of phase variation with respect to input signal, equivalent to reducing the modulation index. Tested using FM receiver flow graph in gnuradio-companion. Cc: Antti Palosaari <crope@iki.fi> Signed-off-by: Prashant Laddha <prladdha@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid sdr: Use LUT based implementation for sin/cos()Prashant Laddha2015-03-021-39/+27
| | | | | | | | | | | | | | | | | | | The common implementation for sin/cos in include/linux/fixp-arith.h has been improved recently to provide higher precision. Replacing native implementation of sin/cos in vivid sdr with common implementation. This serves two purposes: 1. Improved accuracy: the native implementation based on the Taylor series is more prone to rounding errors. 2. Reuse of common function: this is better compared to maintaining native versions for each driver. Suggested by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Cc: Antti Palosaari <crope@iki.fi> Signed-off-by: Prashant Laddha <prladdha@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: use consistent colorspace/Y'CbCr Encoding stringsHans Verkuil2015-02-021-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>
* [media] vivid: Y offset should depend on quant. rangeHans Verkuil2015-01-291-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>
* [media] vivid: remove unnecessary version.h inclusionFabian Frederick2015-01-271-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>
* [media] vivid: fix CROP_BOUNDS typo for video outputHans Verkuil2014-12-161-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>
* [media] vivid: add support for YCbCr encoding and quantizationHans Verkuil2014-12-025-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>
* [media] vivid: add new colorspacesHans Verkuil2014-12-023-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>
* [media] vivid-tpg: improve colorspace supportHans Verkuil2014-12-022-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>
* [media] vivid-tpg-colors: add AdobeRGB and BT.2020 supportHans Verkuil2014-12-022-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>
* [media] vivid: enable vb2_expbuf supportHans Verkuil2014-11-251-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>
* [media] media: vivid: use vb2_ops_wait_prepare/finish helperPrabhakar Lad2014-11-257-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>
* [media] media: vivid: use vb2_start_streaming_called() helperPrabhakar Lad2014-11-141-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>
* [media] vivid: add test array controlsHans Verkuil2014-11-111-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>
* [media] vivid: default to single planar device instancesHans Verkuil2014-11-031-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>
OpenPOWER on IntegriCloud