Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: amphion: correct the unspecified color space

in the E.2.1 of Rec. ITU-T H.264 (06/2019),
0 of colour primaries is reserved, and 2 is unspecified.
driver can map V4L2_COLORSPACE_LAST to 0,
and map V4L2_COLORSPACE_DEFAULT to 2.

v4l2_xfer_func and v4l2_ycbcr_encoding are similar case.

Fixes: 3cd084519c6f ("media: amphion: add vpu v4l2 m2m support")
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Ming Qian and committed by
Mauro Carvalho Chehab
809060c8 61fe43dc

+3 -3
+3 -3
drivers/media/platform/amphion/vpu_color.c
··· 17 17 #include "vpu_helpers.h" 18 18 19 19 static const u8 colorprimaries[] = { 20 - 0, 20 + V4L2_COLORSPACE_LAST, 21 21 V4L2_COLORSPACE_REC709, /*Rec. ITU-R BT.709-6*/ 22 22 0, 23 23 0, ··· 31 31 }; 32 32 33 33 static const u8 colortransfers[] = { 34 - 0, 34 + V4L2_XFER_FUNC_LAST, 35 35 V4L2_XFER_FUNC_709, /*Rec. ITU-R BT.709-6*/ 36 36 0, 37 37 0, ··· 53 53 }; 54 54 55 55 static const u8 colormatrixcoefs[] = { 56 - 0, 56 + V4L2_YCBCR_ENC_LAST, 57 57 V4L2_YCBCR_ENC_709, /*Rec. ITU-R BT.709-6*/ 58 58 0, 59 59 0,