diff options
Diffstat (limited to 'drivers/media/platform/vivid')
-rw-r--r-- | drivers/media/platform/vivid/vivid-ctrls.c | 4 | ||||
-rw-r--r-- | drivers/media/platform/vivid/vivid-tpg.c | 10 | ||||
-rw-r--r-- | drivers/media/platform/vivid/vivid-tpg.h | 1 |
3 files changed, 8 insertions, 7 deletions
diff --git a/drivers/media/platform/vivid/vivid-ctrls.c b/drivers/media/platform/vivid/vivid-ctrls.c index 857e7866e8b..32a798f2d95 100644 --- a/drivers/media/platform/vivid/vivid-ctrls.c +++ b/drivers/media/platform/vivid/vivid-ctrls.c @@ -689,7 +689,7 @@ static const struct v4l2_ctrl_config vivid_ctrl_max_edid_blocks = { static const char * const vivid_ctrl_colorspace_strings[] = { "SMPTE 170M", - "REC 709", + "Rec. 709", "sRGB", "AdobeRGB", "BT.2020", @@ -716,7 +716,7 @@ static const char * const vivid_ctrl_ycbcr_enc_strings[] = { "xvYCC 601", "xvYCC 709", "sYCC", - "BT.2020 Non-Constant Luminance", + "BT.2020", "BT.2020 Constant Luminance", "SMPTE 240M", NULL, diff --git a/drivers/media/platform/vivid/vivid-tpg.c b/drivers/media/platform/vivid/vivid-tpg.c index fc9c6536ba0..34493f435d5 100644 --- a/drivers/media/platform/vivid/vivid-tpg.c +++ b/drivers/media/platform/vivid/vivid-tpg.c @@ -352,13 +352,14 @@ static void color_to_ycbcr(struct tpg_data *tpg, int r, int g, int b, { COEFF(0.5, 224), COEFF(-0.4629, 224), COEFF(-0.0405, 224) }, }; bool full = tpg->real_quantization == V4L2_QUANTIZATION_FULL_RANGE; + unsigned y_offset = full ? 0 : 16; int lin_y, yc; switch (tpg->real_ycbcr_enc) { case V4L2_YCBCR_ENC_601: case V4L2_YCBCR_ENC_XV601: case V4L2_YCBCR_ENC_SYCC: - rgb2ycbcr(full ? bt601_full : bt601, r, g, b, 16, y, cb, cr); + rgb2ycbcr(full ? bt601_full : bt601, r, g, b, y_offset, y, cb, cr); break; case V4L2_YCBCR_ENC_BT2020: rgb2ycbcr(bt2020, r, g, b, 16, y, cb, cr); @@ -384,7 +385,7 @@ static void color_to_ycbcr(struct tpg_data *tpg, int r, int g, int b, case V4L2_YCBCR_ENC_709: case V4L2_YCBCR_ENC_XV709: default: - rgb2ycbcr(full ? rec709_full : rec709, r, g, b, 0, y, cb, cr); + rgb2ycbcr(full ? rec709_full : rec709, r, g, b, y_offset, y, cb, cr); break; } } @@ -439,13 +440,14 @@ static void ycbcr_to_color(struct tpg_data *tpg, int y, int cb, int cr, { COEFF(1, 219), COEFF(1.8814, 224), COEFF(0, 224) }, }; bool full = tpg->real_quantization == V4L2_QUANTIZATION_FULL_RANGE; + unsigned y_offset = full ? 0 : 16; int lin_r, lin_g, lin_b, lin_y; switch (tpg->real_ycbcr_enc) { case V4L2_YCBCR_ENC_601: case V4L2_YCBCR_ENC_XV601: case V4L2_YCBCR_ENC_SYCC: - ycbcr2rgb(full ? bt601_full : bt601, y, cb, cr, 16, r, g, b); + ycbcr2rgb(full ? bt601_full : bt601, y, cb, cr, y_offset, r, g, b); break; case V4L2_YCBCR_ENC_BT2020: ycbcr2rgb(bt2020, y, cb, cr, 16, r, g, b); @@ -480,7 +482,7 @@ static void ycbcr_to_color(struct tpg_data *tpg, int y, int cb, int cr, case V4L2_YCBCR_ENC_709: case V4L2_YCBCR_ENC_XV709: default: - ycbcr2rgb(full ? rec709_full : rec709, y, cb, cr, 16, r, g, b); + ycbcr2rgb(full ? rec709_full : rec709, y, cb, cr, y_offset, r, g, b); break; } } diff --git a/drivers/media/platform/vivid/vivid-tpg.h b/drivers/media/platform/vivid/vivid-tpg.h index 9dc463a40ed..bd8b1c760b3 100644 --- a/drivers/media/platform/vivid/vivid-tpg.h +++ b/drivers/media/platform/vivid/vivid-tpg.h @@ -20,7 +20,6 @@ #ifndef _VIVID_TPG_H_ #define _VIVID_TPG_H_ -#include <linux/version.h> #include <linux/types.h> #include <linux/errno.h> #include <linux/random.h> |