]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: amphion: don't change the colorspace reported by decoder.
authorMing Qian <ming.qian@nxp.com>
Tue, 26 Jul 2022 03:02:29 +0000 (05:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Oct 2022 07:57:50 +0000 (09:57 +0200)
[ Upstream commit 61c2698ee60630c6a7d2e99850fa81ff6450270a ]

decoder will report the colorspace information
which is parsed from the sequence header,
if they are unspecified, just let application to determine it,
don't change it in driver.

Fixes: 6de8d628df6ef ("media: amphion: add v4l2 m2m vpu decoder stateful driver")
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/amphion/vdec.c

index 44dbca0fe17f1587a77971214811fcbf6c12a1b3..6d6842ff12e2a1833f35722e8c19624136efea25 100644 (file)
@@ -808,14 +808,6 @@ static void vdec_init_fmt(struct vpu_inst *inst)
                inst->cap_format.field = V4L2_FIELD_NONE;
        else
                inst->cap_format.field = V4L2_FIELD_SEQ_TB;
-       if (vdec->codec_info.color_primaries == V4L2_COLORSPACE_DEFAULT)
-               vdec->codec_info.color_primaries = V4L2_COLORSPACE_REC709;
-       if (vdec->codec_info.transfer_chars == V4L2_XFER_FUNC_DEFAULT)
-               vdec->codec_info.transfer_chars = V4L2_XFER_FUNC_709;
-       if (vdec->codec_info.matrix_coeffs == V4L2_YCBCR_ENC_DEFAULT)
-               vdec->codec_info.matrix_coeffs = V4L2_YCBCR_ENC_709;
-       if (vdec->codec_info.full_range == V4L2_QUANTIZATION_DEFAULT)
-               vdec->codec_info.full_range = V4L2_QUANTIZATION_LIM_RANGE;
 }
 
 static void vdec_init_crop(struct vpu_inst *inst)
@@ -1556,6 +1548,14 @@ static int vdec_get_debug_info(struct vpu_inst *inst, char *str, u32 size, u32 i
                                vdec->codec_info.frame_rate.numerator,
                                vdec->codec_info.frame_rate.denominator);
                break;
+       case 9:
+               num = scnprintf(str, size, "colorspace: %d, %d, %d, %d (%d)\n",
+                               vdec->codec_info.color_primaries,
+                               vdec->codec_info.transfer_chars,
+                               vdec->codec_info.matrix_coeffs,
+                               vdec->codec_info.full_range,
+                               vdec->codec_info.vui_present);
+               break;
        default:
                break;
        }