summaryrefslogtreecommitdiff
path: root/drivers/media/common/v4l2-tpg
AgeCommit message (Collapse)Author
2017-12-18media: v4l2-tpg.h: rename color structsMauro Carvalho Chehab
The color structs right now are just "color" and "color16". That may lead into conflicts, and don't define precisely what they meant. As those are used by two drivers (vivid and vimc), this is even on a somewhat public header! So rename them to: color -> tpg_rbg_color8 color16 -> tpg_rbg_color16 Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-18media: v4l2-tpg*.h: move headers to include/media/tpg and merge themMauro Carvalho Chehab
The v4l2-tpg*.h headers are meant to be used only internally by vivid and vimc. There's no sense keeping them together with the V4L2 kAPI headers. Also, one header includes the other as they're meant to be used together. So, merge them. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-04[media] v4l2-tpg: add Y10 and Y12 supportHans Verkuil
Support the 10 and 12 bit luma formats. Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-08-08media: v4l2-tpg: fix the SMPTE-2084 transfer functionHans Verkuil
The SMPTE-2084 transfer functions maps to the luminance range of 0-10000 cd/m^2. Other transfer functions use the traditional range of 0-100 cd/m^2. I didn't take this into account so the luminance was off by a factor of 100. Since qv4l2 made the same mistake in reverse I never noticed this until I tested with actual SMPTE-2084 video. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-08-08media: v4l2-tpg-core.c: fix typo in bt2020_full matrixHans Verkuil
My eye fell on this wrong coefficient in the bt2020_full matrix. The bt2020 matrix (limited range) is OK. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-10[media] v4l2-tpg: don't clamp XV601/709 to lim rangeHans Verkuil
The XV601/709 encodings are special: they signal limited range, but use the full range to encode a larger gamut with R', G' and B' values outside the [0-1] range. So don't clamp to limited range for these two encodings. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-29[media] v4l2-tpg: Init hv_enc field with a valid valueRicardo Ribalda
Zero is not a valid value for hsv_enc. Set the field to a valid initial value. This is not a problem for vivid, because it sets the field to 180 via tpg_s_hsv_enc() on the control initialization, but it might be a source of errors for other drivers that use this code. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21[media] vivid: Add support for HSV encodingRicardo Ribalda Delgado
Support HSV encoding. Most of the logic is replicated from ycbcr_enc. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21[media] vivid: Local optimizationRicardo Ribalda Delgado
Avoid duplicated clamps when possible. Suggested-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21[media] vivid: Fix YUV555 and YUV565 handlingRicardo Ribalda Delgado
precalculate_color() had a optimization that avoided duplicated conversion for YUV formats. This optimization did not take into consideration YUV444, YUV555, YUV565 or limited range quantization. This patch keeps the optimization, but fixes the wrong handling. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21[media] vivid: Introduce TPG_COLOR_ENC_LUMARicardo Ribalda Delgado
Simplifies handling of Gray formats. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21[media] vivid: Rename variableRicardo Ribalda Delgado
r_y and g_u now also contain the H and V components on the HSV formats. Rename the variables to reflect this. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21[media] vivid: Add support for HSV formatsRicardo Ribalda Delgado
This patch adds support for V4L2_PIX_FMT_HSV24 and V4L2_PIX_FMT_HSV32. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21[media] vivid: Code refactor for color encodingRicardo Ribalda Delgado
Replace is_yuv with color_enc Which can be used by other color encodings such us HSV. This change should ease the review of the following patches. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24[media] v4l2-tpg-core: drop SYCC, use higher precision 601 conversion matrixHans Verkuil
The SYCC Y'CbCr encoding is identical to the 601 encoding. Since the SYCC define is about to be removed for use in the kernel we need to drop it in the TPG code as well. This patch also adds a 4th decimal to the 601 conversion matrix. That was specified by the sYCC spec and it makes sense to use this across the board. [mchehab@s-opensource.com: fix conflicts with LaTeX math expression patch] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08[media] v4l2-tpg: ignore V4L2_DV_RGB_RANGE setting for YUV formatsHans Verkuil
The V4L2_DV_RGB_RANGE_* settings are, as the name says, for RGB formats only. So they should be ignored for non-RGB formats. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-04-20[media] tpg: Export the tpg code from vivid as a moduleHelen Mae Koike Fornazier
The test pattern generator will be used by other drivers as the virtual media controller (vimc) Signed-off-by: Helen Mae Koike Fornazier <helen.koike@collabora.co.uk> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>