Skip to content

Commit

Permalink
media: amphion: don't change the colorspace reported by decoder.
Browse files Browse the repository at this point in the history
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: 6de8d62 ("media: amphion: add v4l2 m2m vpu decoder stateful driver")
Signed-off-by: Ming Qian <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
mingqian-0 authored and mchehab committed Aug 30, 2022
1 parent 996f4e8 commit 61c2698
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/media/platform/amphion/vdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1555,6 +1547,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;
}
Expand Down

0 comments on commit 61c2698

Please sign in to comment.