summaryrefslogtreecommitdiff
Diffstat
-rw-r--r--[-rwxr-xr-x]Media.mk1
-rw-r--r--drivers/amvdec_ports/Makefile1
-rw-r--r--drivers/amvdec_ports/aml_vcodec_adapt.c112
-rw-r--r--drivers/amvdec_ports/aml_vcodec_adapt.h5
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec.c992
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec.h2
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec_drv.c122
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec_pm.c206
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec_pm.h34
-rw-r--r--drivers/amvdec_ports/aml_vcodec_drv.h188
-rw-r--r--drivers/amvdec_ports/aml_vcodec_util.c34
-rw-r--r--drivers/amvdec_ports/aml_vcodec_util.h90
-rw-r--r--drivers/amvdec_ports/aml_vcodec_vfm.c28
-rw-r--r--drivers/amvdec_ports/decoder/aml_h264_parser.c81
-rw-r--r--drivers/amvdec_ports/decoder/aml_h264_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/aml_hevc_parser.c133
-rw-r--r--drivers/amvdec_ports/decoder/aml_hevc_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/aml_mjpeg_parser.c34
-rw-r--r--drivers/amvdec_ports/decoder/aml_mjpeg_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg12_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg4_parser.c178
-rw-r--r--drivers/amvdec_ports/decoder/aml_mpeg4_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/aml_vp9_parser.c26
-rw-r--r--drivers/amvdec_ports/decoder/aml_vp9_parser.h1
-rw-r--r--drivers/amvdec_ports/decoder/vdec_h264_if.c223
-rw-r--r--drivers/amvdec_ports/decoder/vdec_hevc_if.c194
-rw-r--r--drivers/amvdec_ports/decoder/vdec_mjpeg_if.c210
-rw-r--r--drivers/amvdec_ports/decoder/vdec_mpeg12_if.c304
-rw-r--r--drivers/amvdec_ports/decoder/vdec_mpeg4_if.c209
-rw-r--r--drivers/amvdec_ports/decoder/vdec_vp9_if.c195
-rw-r--r--drivers/amvdec_ports/vdec_drv_if.c6
-rw-r--r--drivers/amvdec_ports/vdec_drv_if.h21
-rw-r--r--drivers/common/chips/chips.c1
-rw-r--r--drivers/common/chips/decoder_cpu_ver_info.c8
-rw-r--r--drivers/common/chips/decoder_cpu_ver_info.h1
-rw-r--r--drivers/common/firmware/firmware_drv.c9
-rw-r--r--drivers/common/firmware/firmware_type.c1
-rw-r--r--drivers/common/firmware/firmware_type.h1
-rw-r--r--drivers/common/media_clock/clk/clk.c3
-rw-r--r--drivers/common/media_clock/clk/clkg12.c5
-rw-r--r--drivers/frame_provider/decoder/Makefile1
-rw-r--r--drivers/frame_provider/decoder/avs/avs.c60
-rw-r--r--drivers/frame_provider/decoder/avs2/avs2_bufmgr.c12
-rw-r--r--drivers/frame_provider/decoder/avs2/avs2_global.h3
-rw-r--r--drivers/frame_provider/decoder/avs2/vavs2.c115
-rw-r--r--drivers/frame_provider/decoder/avs_multi/Makefile2
-rw-r--r--drivers/frame_provider/decoder/avs_multi/avs_multi.c1633
-rw-r--r--drivers/frame_provider/decoder/avs_multi/avsp_trans_multi.c5065
-rw-r--r--drivers/frame_provider/decoder/h264/vh264.c58
-rw-r--r--drivers/frame_provider/decoder/h264_multi/h264_dpb.c50
-rw-r--r--drivers/frame_provider/decoder/h264_multi/h264_dpb.h34
-rw-r--r--drivers/frame_provider/decoder/h264_multi/vmh264.c1043
-rw-r--r--drivers/frame_provider/decoder/h265/vh265.c707
-rw-r--r--drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c60
-rw-r--r--drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c595
-rw-r--r--drivers/frame_provider/decoder/mpeg4/vmpeg4.c5
-rw-r--r--drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c80
-rw-r--r--drivers/frame_provider/decoder/utils/amvdec.c5
-rw-r--r--drivers/frame_provider/decoder/utils/frame_check.c178
-rw-r--r--drivers/frame_provider/decoder/utils/frame_check.h4
-rw-r--r--drivers/frame_provider/decoder/utils/vdec.c530
-rw-r--r--drivers/frame_provider/decoder/utils/vdec.h18
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_input.c12
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_input.h3
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_v4l2_buffer_ops.c92
-rw-r--r--drivers/frame_provider/decoder/utils/vdec_v4l2_buffer_ops.h7
-rw-r--r--drivers/frame_provider/decoder/vav1/Makefile2
-rw-r--r--drivers/frame_provider/decoder/vav1/aom_av1_define.h171
-rw-r--r--drivers/frame_provider/decoder/vav1/av1_bufmgr.c3392
-rw-r--r--drivers/frame_provider/decoder/vav1/av1_global.h2310
-rw-r--r--drivers/frame_provider/decoder/vav1/vav1.c9946
-rw-r--r--drivers/frame_provider/decoder/vav1/vav1.h22
-rw-r--r--drivers/frame_provider/decoder/vc1/vvc1.c46
-rw-r--r--drivers/frame_provider/decoder/vp9/vvp9.c449
-rw-r--r--drivers/frame_sink/encoder/h264/encoder.c2
-rw-r--r--drivers/stream_input/Makefile5
-rw-r--r--drivers/stream_input/amports/amstream.c263
-rw-r--r--drivers/stream_input/parser/demux/aml_dvb.h5
-rw-r--r--drivers/stream_input/parser/demux/hw_demux/demod_gt.h62
-rw-r--r--drivers/stream_input/parser/demux/hw_demux/frontend.c293
-rw-r--r--drivers/stream_input/parser/dvb_common.c17
-rw-r--r--drivers/stream_input/parser/dvb_common.h26
-rw-r--r--drivers/stream_input/parser/esparser.c15
-rw-r--r--drivers/stream_input/parser/hw_demux/aml_demod_gt.h87
-rw-r--r--drivers/stream_input/parser/hw_demux/aml_dmx.c270
-rw-r--r--drivers/stream_input/parser/hw_demux/aml_dvb.c445
-rw-r--r--drivers/stream_input/parser/hw_demux/aml_dvb.h32
-rw-r--r--drivers/stream_input/parser/streambuf.c9
-rw-r--r--drivers/stream_input/parser/tsdemux.c14
-rw-r--r--drivers/stream_input/parser/tsdemux.h1
-rw-r--r--drivers/stream_input/tv_frontend/Makefile16
-rw-r--r--drivers/stream_input/tv_frontend/aml_fe.c1372
-rw-r--r--drivers/stream_input/tv_frontend/aml_fe.h213
-rw-r--r--drivers/stream_input/tv_frontend/atv_demod/atvdemod_frontend.c791
-rw-r--r--drivers/stream_input/tv_frontend/atv_demod/atvdemod_func.c2163
-rw-r--r--drivers/stream_input/tv_frontend/atv_demod/atvdemod_func.h323
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/aml_demod.c725
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/amlfrontend.c1402
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/demod_func.c2996
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/dvbc_func.c1331
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/dvbt_func.c2188
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/i2c_func.c42
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/acf_filter_coefficient.h414
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_che.h77
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_che_bit.h266
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_front.h70
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_front_bit.h331
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_sync.h53
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_sync_bit.h110
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_top.h90
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/addr_dtmb_top_bit.h178
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/aml_dtv_demod_reg.h28
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/amlfrontend.h86
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/include/demod_func.h626
-rw-r--r--drivers/stream_input/tv_frontend/dtv_demod/tuner_func.c189
-rw-r--r--firmware/video_ucode.bin14148
116 files changed, 25845 insertions, 36303 deletions
diff --git a/drivers/amvdec_ports/decoder/vdec_hevc_if.c b/drivers/amvdec_ports/decoder/vdec_hevc_if.c
index cd4d361..10c6b48 100644
--- a/drivers/amvdec_ports/decoder/vdec_hevc_if.c
+++ b/drivers/amvdec_ports/decoder/vdec_hevc_if.c
@@ -122,11 +122,13 @@ static void get_pic_info(struct vdec_hevc_inst *inst,
{
*pic = inst->vsi->pic;
- aml_vcodec_debug(inst, "pic(%d, %d), buf(%d, %d)",
- pic->visible_width, pic->visible_height,
- pic->coded_width, pic->coded_height);
- aml_vcodec_debug(inst, "Y(%d, %d), C(%d, %d)", pic->y_bs_sz,
- pic->y_len_sz, pic->c_bs_sz, pic->c_len_sz);
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_EXINFO,
+ "pic(%d, %d), buf(%d, %d)\n",
+ pic->visible_width, pic->visible_height,
+ pic->coded_width, pic->coded_height);
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_EXINFO,
+ "Y(%d, %d), C(%d, %d)\n", pic->y_bs_sz,
+ pic->y_len_sz, pic->c_bs_sz, pic->c_len_sz);
}
static void get_crop_info(struct vdec_hevc_inst *inst, struct v4l2_rect *cr)
@@ -136,14 +138,15 @@ static void get_crop_info(struct vdec_hevc_inst *inst, struct v4l2_rect *cr)
cr->width = inst->vsi->crop.width;
cr->height = inst->vsi->crop.height;
- aml_vcodec_debug(inst, "l=%d, t=%d, w=%d, h=%d",
- cr->left, cr->top, cr->width, cr->height);
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_EXINFO,
+ "l=%d, t=%d, w=%d, h=%d\n",
+ cr->left, cr->top, cr->width, cr->height);
}
static void get_dpb_size(struct vdec_hevc_inst *inst, unsigned int *dpb_sz)
{
*dpb_sz = inst->vsi->dec.dpb_sz;
- aml_vcodec_debug(inst, "sz=%d", *dpb_sz);
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_EXINFO, "sz=%d\n", *dpb_sz);
}
static u32 vdec_config_default_parms(u8 *parm)
@@ -223,13 +226,15 @@ static int vdec_hevc_init(struct aml_vcodec_ctx *ctx, unsigned long *h_vdec)
inst->vfm.ada_ctx = &inst->vdec;
ret = vcodec_vfm_init(&inst->vfm);
if (ret) {
- pr_err("%s, init vfm failed.\n", __func__);
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_ERROR,
+ "init vfm failed.\n");
goto err;
}
ret = video_decoder_init(&inst->vdec);
if (ret) {
- aml_vcodec_err(inst, "vdec_hevc init err=%d", ret);
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_ERROR,
+ "vdec_hevc init err=%d\n", ret);
goto err;
}
@@ -242,14 +247,15 @@ static int vdec_hevc_init(struct aml_vcodec_ctx *ctx, unsigned long *h_vdec)
/* alloc the header buffer to be used cache sps or spp etc.*/
inst->vsi->header_buf = kzalloc(HEADER_BUFFER_SIZE, GFP_KERNEL);
- if (!inst->vsi) {
+ if (!inst->vsi->header_buf) {
ret = -ENOMEM;
goto err;
}
init_completion(&inst->comp);
- aml_vcodec_debug(inst, "hevc Instance >> %p", inst);
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_PRINFO,
+ "hevc Instance >> %lx\n", (ulong) inst);
ctx->ada_ctx = &inst->vdec;
*h_vdec = (unsigned long)inst;
@@ -286,7 +292,7 @@ static int refer_buffer_num(struct h265_SPS_t *sps)
used_buf_num = sps->temporal_layer[0].num_reorder_pics;
sps_pic_buf_diff = sps->temporal_layer[0].max_dec_pic_buffering -
- sps->temporal_layer[0].num_reorder_pics + 1;
+ sps->temporal_layer[0].num_reorder_pics - 1;
if (sps_pic_buf_diff >= 4)
used_buf_num += 1;
@@ -396,20 +402,42 @@ static void fill_vdec_params(struct vdec_hevc_inst *inst, struct h265_SPS_t *sps
inst->parms.ps.dpb_size = dec->dpb_sz;
inst->parms.parms_status |= V4L2_CONFIG_PARM_DECODE_PSINFO;
- pr_info("[%d] The stream infos, dw: %d, coded:(%d x %d), visible:(%d x %d), DPB: %d, margin: %d\n",
- inst->ctx->id, dw, pic->coded_width, pic->coded_height,
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_BUFMGR,
+ "The stream infos, dw: %d, coded:(%d x %d), visible:(%d x %d), DPB: %d, margin: %d\n",
+ dw, pic->coded_width, pic->coded_height,
pic->visible_width, pic->visible_height,
dec->dpb_sz - margin, margin);
}
-static int stream_parse_by_ucode(struct vdec_hevc_inst *inst, u8 *buf, u32 size)
+static int parse_stream_ucode(struct vdec_hevc_inst *inst, u8 *buf, u32 size)
{
int ret = 0;
struct aml_vdec_adapt *vdec = &inst->vdec;
ret = vdec_vframe_write(vdec, buf, size, 0);
if (ret < 0) {
- pr_err("write frame data failed. err: %d\n", ret);
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_ERROR,
+ "write frame data failed. err: %d\n", ret);
+ return ret;
+ }
+
+ /* wait ucode parse ending. */
+ wait_for_completion_timeout(&inst->comp,
+ msecs_to_jiffies(1000));
+
+ return inst->vsi->dec.dpb_sz ? 0 : -1;
+}
+
+static int parse_stream_ucode_dma(struct vdec_hevc_inst *inst,
+ ulong buf, u32 size, u32 handle)
+{
+ int ret = 0;
+ struct aml_vdec_adapt *vdec = &inst->vdec;
+
+ ret = vdec_vframe_write_with_dma(vdec, buf, size, 0, handle);
+ if (ret < 0) {
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_ERROR,
+ "write frame data failed. err: %d\n", ret);
return ret;
}
@@ -420,7 +448,7 @@ static int stream_parse_by_ucode(struct vdec_hevc_inst *inst, u8 *buf, u32 size)
return inst->vsi->dec.dpb_sz ? 0 : -1;
}
-static int stream_parse(struct vdec_hevc_inst *inst, u8 *buf, u32 size)
+static int parse_stream_cpu(struct vdec_hevc_inst *inst, u8 *buf, u32 size)
{
int ret = 0;
struct h265_param_sets *ps = NULL;
@@ -431,7 +459,8 @@ static int stream_parse(struct vdec_hevc_inst *inst, u8 *buf, u32 size)
ret = h265_decode_extradata_ps(buf, size, ps);
if (ret) {
- pr_err("parse extra data failed. err: %d\n", ret);
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_ERROR,
+ "parse extra data failed. err: %d\n", ret);
goto out;
}
@@ -450,22 +479,35 @@ static int vdec_hevc_probe(unsigned long h_vdec,
{
struct vdec_hevc_inst *inst =
(struct vdec_hevc_inst *)h_vdec;
- struct stream_info *st;
u8 *buf = (u8 *)bs->vaddr;
u32 size = bs->size;
int ret = 0;
- st = (struct stream_info *)buf;
- if (inst->ctx->is_drm_mode && (st->magic == DRMe || st->magic == DRMn))
- return 0;
-
- if (st->magic == NORe || st->magic == NORn)
- ret = stream_parse(inst, st->data, st->length);
- else {
- if (inst->ctx->param_sets_from_ucode)
- ret = stream_parse_by_ucode(inst, buf, size);
- else
- ret = stream_parse(inst, buf, size);
+ if (inst->ctx->is_drm_mode) {
+ if (bs->model == VB2_MEMORY_MMAP) {
+ struct aml_video_stream *s =
+ (struct aml_video_stream *) buf;
+
+ if ((s->magic != AML_VIDEO_MAGIC) &&
+ (s->type != V4L_STREAM_TYPE_MATEDATA))
+ return -1;
+
+ if (inst->ctx->param_sets_from_ucode) {
+ ret = parse_stream_ucode(inst, s->data, s->len);
+ } else {
+ ret = parse_stream_cpu(inst, s->data, s->len);
+ }
+ } else if (bs->model == VB2_MEMORY_DMABUF ||
+ bs->model == VB2_MEMORY_USERPTR) {
+ ret = parse_stream_ucode_dma(inst, bs->addr, size,
+ BUFF_IDX(bs, bs->index));
+ }
+ } else {
+ if (inst->ctx->param_sets_from_ucode) {
+ ret = parse_stream_ucode(inst, buf, size);
+ } else {
+ ret = parse_stream_cpu(inst, buf, size);
+ }
}
inst->vsi->cur_pic = inst->vsi->pic;
@@ -479,8 +521,6 @@ static void vdec_hevc_deinit(unsigned long h_vdec)
struct vdec_hevc_inst *inst = (struct vdec_hevc_inst *)h_vdec;
struct aml_vcodec_ctx *ctx = inst->ctx;
- aml_vcodec_debug_enter(inst);
-
video_decoder_release(&inst->vdec);
vcodec_vfm_release(&inst->vfm);
@@ -512,14 +552,16 @@ static void vdec_hevc_get_vf(struct vdec_hevc_inst *inst, struct vdec_v4l2_buffe
vf = peek_video_frame(&inst->vfm);
if (!vf) {
- aml_vcodec_debug(inst, "there is no vframe.");
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_ERROR,
+ "there is no vframe.\n");
*out = NULL;
return;
}
vf = get_video_frame(&inst->vfm);
if (!vf) {
- aml_vcodec_debug(inst, "the vframe is avalid.");
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_ERROR,
+ "the vframe is avalid.\n");
*out = NULL;
return;
}
@@ -568,7 +610,7 @@ static bool monitor_res_change(struct vdec_hevc_inst *inst, u8 *buf, u32 size)
break;
if (type == HEVC_NAL_SPS) {
- ret = stream_parse(inst, p, len);
+ ret = parse_stream_cpu(inst, p, len);
if (ret)
break;
}
@@ -593,9 +635,8 @@ static int vdec_hevc_decode(unsigned long h_vdec, struct aml_vcodec_mem *bs,
{
struct vdec_hevc_inst *inst = (struct vdec_hevc_inst *)h_vdec;
struct aml_vdec_adapt *vdec = &inst->vdec;
- struct stream_info *st;
- u8 *buf;
- u32 size;
+ u8 *buf = (u8 *) bs->vaddr;
+ u32 size = bs->size;
int ret = -1;
if (bs == NULL)
@@ -604,23 +645,37 @@ static int vdec_hevc_decode(unsigned long h_vdec, struct aml_vcodec_mem *bs,
if (vdec_input_full(vdec))
return -EAGAIN;
- buf = (u8 *)bs->vaddr;
- size = bs->size;
- st = (struct stream_info *)buf;
-
- if (inst->ctx->is_drm_mode && (st->magic == DRMe || st->magic == DRMn))
- ret = vdec_vbuf_write(vdec, st->m.buf, sizeof(st->m.drm));
- else if (st->magic == NORe)
- ret = vdec_vbuf_write(vdec, st->data, st->length);
- else if (st->magic == NORn)
- ret = vdec_write_nalu(inst, st->data, st->length, timestamp);
- else if (inst->ctx->is_stream_mode)
- ret = vdec_vbuf_write(vdec, buf, size);
- else {
- /*checked whether the resolution changes.*/
- if ((*res_chg = monitor_res_change(inst, buf, size)))
- return 0;
+ if (inst->ctx->is_drm_mode) {
+ if (bs->model == VB2_MEMORY_MMAP) {
+ struct aml_video_stream *s =
+ (struct aml_video_stream *) buf;
+ if (s->magic != AML_VIDEO_MAGIC)
+ return -1;
+
+ if (!inst->ctx->param_sets_from_ucode &&
+ (s->type == V4L_STREAM_TYPE_MATEDATA)) {
+ if ((*res_chg = monitor_res_change(inst,
+ s->data, s->len)))
+ return 0;
+ }
+
+ ret = vdec_vframe_write(vdec,
+ s->data,
+ s->len,
+ timestamp);
+ } else if (bs->model == VB2_MEMORY_DMABUF ||
+ bs->model == VB2_MEMORY_USERPTR) {
+ ret = vdec_vframe_write_with_dma(vdec,
+ bs->addr, size, timestamp,
+ BUFF_IDX(bs, bs->index));
+ }
+ } else {
+ if (!inst->ctx->param_sets_from_ucode) {
+ /*checked whether the resolution changes.*/
+ if ((*res_chg = monitor_res_change(inst, buf, size)))
+ return 0;
+ }
ret = vdec_write_nalu(inst, buf, size, timestamp);
}
@@ -641,7 +696,8 @@ static int vdec_hevc_decode(unsigned long h_vdec, struct aml_vcodec_mem *bs,
parms->parms_status |= inst->parms.parms_status;
- aml_vcodec_debug(inst, "parms status: %u", parms->parms_status);
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_PRINFO,
+ "parms status: %u\n", parms->parms_status);
}
static int vdec_hevc_get_param(unsigned long h_vdec,
@@ -651,7 +707,8 @@ static int vdec_hevc_get_param(unsigned long h_vdec,
struct vdec_hevc_inst *inst = (struct vdec_hevc_inst *)h_vdec;
if (!inst) {
- pr_err("the hevc inst of dec is invalid.\n");
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_ERROR,
+ "the hevc inst of dec is invalid.\n");
return -1;
}
@@ -680,7 +737,8 @@ static int vdec_hevc_get_param(unsigned long h_vdec,
get_param_config_info(inst, out);
break;
default:
- aml_vcodec_err(inst, "invalid get parameter type=%d", type);
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_ERROR,
+ "invalid get parameter type=%d\n", type);
ret = -EINVAL;
}
@@ -710,8 +768,9 @@ static void set_param_ps_info(struct vdec_hevc_inst *inst,
rect->height = pic->visible_height;
/* config canvas size that be used for decoder. */
- pic->coded_width = ALIGN(ps->coded_width, 64);
- pic->coded_height = ALIGN(ps->coded_height, 64);
+
+ pic->coded_width = ps->coded_width;
+ pic->coded_height = ps->coded_height;
pic->y_len_sz = pic->coded_width * pic->coded_height;
pic->c_len_sz = pic->y_len_sz >> 1;
@@ -724,7 +783,8 @@ static void set_param_ps_info(struct vdec_hevc_inst *inst,
/*wake up*/
complete(&inst->comp);
- pr_info("Parse from ucode, crop(%d x %d), coded(%d x %d) dpb: %d\n",
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_PRINFO,
+ "Parse from ucode, crop(%d x %d), coded(%d x %d) dpb: %d\n",
pic->visible_width, pic->visible_height,
pic->coded_width, pic->coded_height,
dec->dpb_sz);
@@ -740,14 +800,16 @@ static void set_param_hdr_info(struct vdec_hevc_inst *inst,
V4L2_CONFIG_PARM_DECODE_HDRINFO;
aml_vdec_dispatch_event(inst->ctx,
V4L2_EVENT_SRC_CH_HDRINFO);
- pr_info("H265 set HDR infos\n");
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_PRINFO,
+ "H265 set HDR infos\n");
}
}
static void set_param_post_event(struct vdec_hevc_inst *inst, u32 *event)
{
aml_vdec_dispatch_event(inst->ctx, *event);
- pr_info("H265 post event: %d\n", *event);
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_PRINFO,
+ "H265 post event: %d\n", *event);
}
static int vdec_hevc_set_param(unsigned long h_vdec,
@@ -757,7 +819,8 @@ static int vdec_hevc_set_param(unsigned long h_vdec,
struct vdec_hevc_inst *inst = (struct vdec_hevc_inst *)h_vdec;
if (!inst) {
- pr_err("the hevc inst of dec is invalid.\n");
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_ERROR,
+ "the hevc inst of dec is invalid.\n");
return -1;
}
@@ -778,7 +841,8 @@ static int vdec_hevc_set_param(unsigned long h_vdec,
set_param_post_event(inst, in);
break;
default:
- aml_vcodec_err(inst, "invalid set parameter type=%d", type);
+ v4l_dbg(inst->ctx, V4L_DEBUG_CODEC_ERROR,
+ "invalid set parameter type=%d\n", type);
ret = -EINVAL;
}