author | Hui Zhang <hui.zhang@amlogic.com> | 2020-03-11 09:43:36 (GMT) |
---|---|---|
committer | Hui Zhang <hui.zhang@amlogic.com> | 2020-03-11 09:43:36 (GMT) |
commit | 2d55afcdb433e96b106ba4cc06dd49bf11ad92ea (patch) | |
tree | 1c0eeb081aa8003ddccedfd3331b1d3eea657485 | |
parent | 3441f4085ee5c8f435863832bab372bfad4f762d (diff) | |
download | media_modules-2d55afcdb433e96b106ba4cc06dd49bf11ad92ea.zip media_modules-2d55afcdb433e96b106ba4cc06dd49bf11ad92ea.tar.gz media_modules-2d55afcdb433e96b106ba4cc06dd49bf11ad92ea.tar.bz2 |
Revert "decoder: resolve UV revertion issue for NV12 [1/1]"
This reverts commit 3441f4085ee5c8f435863832bab372bfad4f762d.
Change-Id: If8160328fbd33c3dc73e09bb942decbd0552df81
-rw-r--r-- | drivers/amvdec_ports/aml_vcodec_dec.c | 3 | ||||
-rw-r--r-- | drivers/amvdec_ports/aml_vcodec_drv.h | 1 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/h264_multi/vmh264.c | 29 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/h265/vh265.c | 53 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c | 16 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c | 15 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/vp9/vvp9.c | 12 |
7 files changed, 36 insertions, 93 deletions
diff --git a/drivers/amvdec_ports/aml_vcodec_dec.c b/drivers/amvdec_ports/aml_vcodec_dec.c index 0cd6fb8..575c9a6 100644 --- a/drivers/amvdec_ports/aml_vcodec_dec.c +++ b/drivers/amvdec_ports/aml_vcodec_dec.c @@ -1874,9 +1874,6 @@ static int vidioc_vdec_g_fmt(struct file *file, void *priv, return -EINVAL; } - if (!V4L2_TYPE_IS_OUTPUT(f->type)) - ctx->cap_pix_fmt = pix_mp->pixelformat; - v4l_dbg(ctx, V4L_DEBUG_CODEC_PROT, "%s, type: %u, planes: %u, fmt: %u\n", __func__, f->type, f->fmt.pix_mp.num_planes, diff --git a/drivers/amvdec_ports/aml_vcodec_drv.h b/drivers/amvdec_ports/aml_vcodec_drv.h index aaac607..72505e5 100644 --- a/drivers/amvdec_ports/aml_vcodec_drv.h +++ b/drivers/amvdec_ports/aml_vcodec_drv.h @@ -464,7 +464,6 @@ struct aml_vcodec_ctx { int stop_cmd; u32 display_count; struct v4l_buff_pool cap_pool; - u32 cap_pix_fmt; }; /** diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c index a74382d..29e4346 100644 --- a/drivers/frame_provider/decoder/h264_multi/vmh264.c +++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c @@ -2619,8 +2619,6 @@ int prepare_display_buf(struct vdec_s *vdec, struct FrameStore *frame) struct vdec_h264_hw_s *hw = (struct vdec_h264_hw_s *)vdec->private; struct vframe_s *vf = NULL; int buffer_index = frame->buf_spec_num; - struct aml_vcodec_ctx * v4l2_ctx = hw->v4l2_ctx; - ulong nv_order = VIDTYPE_VIU_NV21; int vf_count = 1; int i; int bForceInterlace = 0; @@ -2631,14 +2629,6 @@ int prepare_display_buf(struct vdec_s *vdec, struct FrameStore *frame) __func__, buffer_index); return -1; } - - /* swap uv */ - if (hw->is_used_v4l) { - if ((v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV12) || - (v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV12M)) - nv_order = VIDTYPE_VIU_NV12; - } - if (force_disp_bufspec_num & 0x100) { /*recycle directly*/ if (hw->buffer_spec[frame->buf_spec_num].used != 3 && @@ -2800,7 +2790,7 @@ int prepare_display_buf(struct vdec_s *vdec, struct FrameStore *frame) if (hw->double_write_mode) { vf->type |= VIDTYPE_PROGRESSIVE | VIDTYPE_VIU_FIELD; - vf->type |= nv_order; + vf->type |= VIDTYPE_VIU_NV21; if (hw->double_write_mode == 3) vf->type |= VIDTYPE_COMPRESS; @@ -2833,7 +2823,7 @@ int prepare_display_buf(struct vdec_s *vdec, struct FrameStore *frame) vf->compHeight = hw->frame_height; } else { vf->type = VIDTYPE_PROGRESSIVE | VIDTYPE_VIU_FIELD | - nv_order; + VIDTYPE_VIU_NV21; vf->canvas0Addr = vf->canvas1Addr = spec2canvas(&hw->buffer_spec[buffer_index]); @@ -2865,7 +2855,7 @@ int prepare_display_buf(struct vdec_s *vdec, struct FrameStore *frame) if (bForceInterlace || is_interlace(frame)) { vf->type = VIDTYPE_INTERLACE_FIRST | - nv_order; + VIDTYPE_VIU_NV21; if (bForceInterlace) { if (frame->frame != NULL && frame->frame->pic_struct == PIC_TOP_BOT) { @@ -3865,19 +3855,10 @@ static struct vframe_s *vh264_vf_get(void *op_arg) struct vframe_s *vf; struct vdec_s *vdec = op_arg; struct vdec_h264_hw_s *hw = (struct vdec_h264_hw_s *)vdec->private; - struct aml_vcodec_ctx * v4l2_ctx = hw->v4l2_ctx; - ulong nv_order = VIDTYPE_VIU_NV21; if (!hw) return NULL; - /* swap uv */ - if (hw->is_used_v4l) { - if ((v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV12) || - (v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV12M)) - nv_order = VIDTYPE_VIU_NV12; - } - if (force_disp_bufspec_num & 0x100) { int buffer_index = force_disp_bufspec_num & 0xff; if (force_disp_bufspec_num & 0x200) @@ -3908,7 +3889,7 @@ static struct vframe_s *vh264_vf_get(void *op_arg) if (hw->double_write_mode) { vf->type |= VIDTYPE_PROGRESSIVE | VIDTYPE_VIU_FIELD; - vf->type |= nv_order; + vf->type |= VIDTYPE_VIU_NV21; if (hw->double_write_mode == 3) vf->type |= VIDTYPE_COMPRESS; @@ -3946,7 +3927,7 @@ static struct vframe_s *vh264_vf_get(void *op_arg) } } else { vf->type = VIDTYPE_PROGRESSIVE | VIDTYPE_VIU_FIELD | - nv_order; + VIDTYPE_VIU_NV21; vf->canvas0Addr = vf->canvas1Addr = spec2canvas(&hw->buffer_spec[buffer_index]); } diff --git a/drivers/frame_provider/decoder/h265/vh265.c b/drivers/frame_provider/decoder/h265/vh265.c index 154fbf0..64345e7 100644 --- a/drivers/frame_provider/decoder/h265/vh265.c +++ b/drivers/frame_provider/decoder/h265/vh265.c @@ -5376,8 +5376,8 @@ static void config_sao_hw(struct hevc_state_s *hevc, union param_u *params) /* swap uv */ if (hevc->is_used_v4l) { - if ((v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV21) || - (v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV21M)) + if ((v4l2_ctx->q_data[AML_Q_DATA_DST].fmt->fourcc == V4L2_PIX_FMT_NV21) || + (v4l2_ctx->q_data[AML_Q_DATA_DST].fmt->fourcc == V4L2_PIX_FMT_NV21M)) data32 &= ~(1 << 8); /* NV21 */ else data32 |= (1 << 8); /* NV12 */ @@ -5419,8 +5419,8 @@ static void config_sao_hw(struct hevc_state_s *hevc, union param_u *params) /* swap uv */ if (hevc->is_used_v4l) { - if ((v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV21) || - (v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV21M)) + if ((v4l2_ctx->q_data[AML_Q_DATA_DST].fmt->fourcc == V4L2_PIX_FMT_NV21) || + (v4l2_ctx->q_data[AML_Q_DATA_DST].fmt->fourcc == V4L2_PIX_FMT_NV21M)) data32 |= (1 << 12); /* NV21 */ else data32 &= ~(1 << 12); /* NV12 */ @@ -8663,16 +8663,7 @@ static int prepare_display_buf(struct hevc_state_s *hevc, struct PIC_s *pic) struct vframe_s *vf = NULL; int stream_offset = pic->stream_offset; unsigned short slice_type = pic->slice_type; - ulong nv_order = VIDTYPE_VIU_NV21; u32 frame_size = 0; - struct aml_vcodec_ctx * v4l2_ctx = hevc->v4l2_ctx; - - /* swap uv */ - if (hevc->is_used_v4l) { - if ((v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV12) || - (v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV12M)) - nv_order = VIDTYPE_VIU_NV12; - } if (force_disp_pic_index & 0x100) { /*recycle directly*/ @@ -8832,7 +8823,7 @@ static int prepare_display_buf(struct hevc_state_s *hevc, struct PIC_s *pic) } if (pic->double_write_mode) { vf->type = VIDTYPE_PROGRESSIVE | VIDTYPE_VIU_FIELD; - vf->type |= nv_order; + vf->type |= VIDTYPE_VIU_NV21; if ((pic->double_write_mode == 3) && (!(IS_8K_SIZE(pic->width, pic->height)))) { @@ -8898,7 +8889,7 @@ static int prepare_display_buf(struct hevc_state_s *hevc, struct PIC_s *pic) vf->bitdepth |= BITDEPTH_SAVING_MODE; #else vf->type = VIDTYPE_PROGRESSIVE | VIDTYPE_VIU_FIELD; - vf->type |= nv_order; + vf->type |= VIDTYPE_VIU_NV21; vf->canvas0Addr = vf->canvas1Addr = spec2canvas(pic); #endif set_frame_info(hevc, vf, pic); @@ -8999,14 +8990,14 @@ static int prepare_display_buf(struct hevc_state_s *hevc, struct PIC_s *pic) if (pic->pic_struct == 3) { vf->type = VIDTYPE_INTERLACE_TOP - | nv_order; + | VIDTYPE_VIU_NV21; vf2->type = VIDTYPE_INTERLACE_BOTTOM - | nv_order; + | VIDTYPE_VIU_NV21; } else { vf->type = VIDTYPE_INTERLACE_BOTTOM - | nv_order; + | VIDTYPE_VIU_NV21; vf2->type = VIDTYPE_INTERLACE_TOP - | nv_order; + | VIDTYPE_VIU_NV21; } hevc->vf_pre_count++; decoder_do_frame_check(vdec, vf); @@ -9044,18 +9035,18 @@ static int prepare_display_buf(struct hevc_state_s *hevc, struct PIC_s *pic) if (pic->pic_struct == 5) { vf->type = VIDTYPE_INTERLACE_TOP - | nv_order; + | VIDTYPE_VIU_NV21; vf2->type = VIDTYPE_INTERLACE_BOTTOM - | nv_order; + | VIDTYPE_VIU_NV21; vf3->type = VIDTYPE_INTERLACE_TOP - | nv_order; + | VIDTYPE_VIU_NV21; } else { vf->type = VIDTYPE_INTERLACE_BOTTOM - | nv_order; + | VIDTYPE_VIU_NV21; vf2->type = VIDTYPE_INTERLACE_TOP - | nv_order; + | VIDTYPE_VIU_NV21; vf3->type = VIDTYPE_INTERLACE_BOTTOM - | nv_order; + | VIDTYPE_VIU_NV21; } hevc->vf_pre_count++; decoder_do_frame_check(vdec, vf); @@ -9091,12 +9082,12 @@ static int prepare_display_buf(struct hevc_state_s *hevc, struct PIC_s *pic) vf->height <<= 1; if (pic->pic_struct == 9) { vf->type = VIDTYPE_INTERLACE_TOP - | nv_order | VIDTYPE_VIU_FIELD; + | VIDTYPE_VIU_NV21 | VIDTYPE_VIU_FIELD; process_pending_vframe(hevc, hevc->pre_bot_pic, 0); } else { vf->type = VIDTYPE_INTERLACE_BOTTOM | - nv_order | VIDTYPE_VIU_FIELD; + VIDTYPE_VIU_NV21 | VIDTYPE_VIU_FIELD; vf->index = (pic->index << 8) | 0xff; process_pending_vframe(hevc, hevc->pre_top_pic, 1); @@ -9127,10 +9118,10 @@ static int prepare_display_buf(struct hevc_state_s *hevc, struct PIC_s *pic) vf->height <<= 1; if (pic->pic_struct == 11) vf->type = VIDTYPE_INTERLACE_TOP | - nv_order | VIDTYPE_VIU_FIELD; + VIDTYPE_VIU_NV21 | VIDTYPE_VIU_FIELD; else { vf->type = VIDTYPE_INTERLACE_BOTTOM | - nv_order | VIDTYPE_VIU_FIELD; + VIDTYPE_VIU_NV21 | VIDTYPE_VIU_FIELD; vf->index = (pic->index << 8) | 0xff; } decoder_do_frame_check(vdec, vf); @@ -9164,14 +9155,14 @@ static int prepare_display_buf(struct hevc_state_s *hevc, struct PIC_s *pic) case 1: vf->height <<= 1; vf->type = VIDTYPE_INTERLACE_TOP | - nv_order | VIDTYPE_VIU_FIELD; + VIDTYPE_VIU_NV21 | VIDTYPE_VIU_FIELD; process_pending_vframe(hevc, pic, 1); hevc->pre_top_pic = pic; break; case 2: vf->height <<= 1; vf->type = VIDTYPE_INTERLACE_BOTTOM - | nv_order + | VIDTYPE_VIU_NV21 | VIDTYPE_VIU_FIELD; process_pending_vframe(hevc, pic, 0); hevc->pre_bot_pic = pic; diff --git a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c index 1a3ebf5..356506d 100644 --- a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c +++ b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c @@ -1500,21 +1500,15 @@ static int prepare_display_buf(struct vdec_mpeg12_hw_s *hw, u32 index = pic->index; u32 info = pic->buffer_info; struct vdec_s *vdec = hw_to_vdec(hw); - struct aml_vcodec_ctx * v4l2_ctx = hw->v4l2_ctx; - ulong nv_order = VIDTYPE_VIU_NV21; - - /* swap uv */ - if (hw->is_used_v4l) { - if ((v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV12) || - (v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV12M)) - nv_order = VIDTYPE_VIU_NV12; - } user_data_ready_notify(hw, pic->pts, pic->pts_valid); +#ifdef NV21 + type = VIDTYPE_VIU_NV21; +#endif if (hw->frame_prog & PICINFO_PROG) { field_num = 1; - type |= VIDTYPE_PROGRESSIVE | VIDTYPE_VIU_FIELD | nv_order; + type |= VIDTYPE_PROGRESSIVE | VIDTYPE_VIU_FIELD; } else { #ifdef INTERLACE_SEQ_ALWAYS /* once an interlace seq, force interlace, to make di easy. */ @@ -1553,7 +1547,7 @@ static int prepare_display_buf(struct vdec_mpeg12_hw_s *hw, vf->duration_pulldown = (field_num == 3) ? (vf->duration >> 1):0; if (i > 0) - type = nv_order; + type = VIDTYPE_VIU_NV21; if (i == 1) /* second field*/ type |= (first_field_type == VIDTYPE_INTERLACE_TOP) ? VIDTYPE_INTERLACE_BOTTOM : VIDTYPE_INTERLACE_TOP; diff --git a/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c b/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c index 15d8b4c..aff7852 100644 --- a/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c +++ b/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c @@ -613,17 +613,8 @@ static int prepare_display_buf(struct vdec_mpeg4_hw_s * hw, { struct vframe_s *vf = NULL; struct vdec_s *vdec = hw_to_vdec(hw); - struct aml_vcodec_ctx * v4l2_ctx = hw->v4l2_ctx; - ulong nv_order = VIDTYPE_VIU_NV21; int index = pic->index; - /* swap uv */ - if (hw->is_used_v4l) { - if ((v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV12) || - (v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV12M)) - nv_order = VIDTYPE_VIU_NV12; - } - if (pic->pic_info & INTERLACE_FLAG) { if (kfifo_get(&hw->newframe_q, &vf) == 0) { mmpeg4_debug_print(DECODE_ID(hw), 0, @@ -653,7 +644,7 @@ static int prepare_display_buf(struct vdec_mpeg4_hw_s * hw, vf->type = (pic->pic_info & TOP_FIELD_FIRST_FLAG) ? VIDTYPE_INTERLACE_TOP : VIDTYPE_INTERLACE_BOTTOM; #ifdef NV21 - vf->type |= nv_order; + vf->type |= VIDTYPE_VIU_NV21; #endif set_frame_info(hw, vf, pic->index); @@ -705,7 +696,7 @@ static int prepare_display_buf(struct vdec_mpeg4_hw_s * hw, vf->type = (pic->pic_info & TOP_FIELD_FIRST_FLAG) ? VIDTYPE_INTERLACE_BOTTOM : VIDTYPE_INTERLACE_TOP; #ifdef NV21 - vf->type |= nv_order; + vf->type |= VIDTYPE_VIU_NV21; #endif set_frame_info(hw, vf, pic->index); @@ -766,7 +757,7 @@ static int prepare_display_buf(struct vdec_mpeg4_hw_s * hw, pic->duration; #ifdef NV21 vf->type = VIDTYPE_PROGRESSIVE | - VIDTYPE_VIU_FIELD | nv_order; + VIDTYPE_VIU_FIELD | VIDTYPE_VIU_NV21; #else vf->type = VIDTYPE_PROGRESSIVE | VIDTYPE_VIU_FIELD; diff --git a/drivers/frame_provider/decoder/vp9/vvp9.c b/drivers/frame_provider/decoder/vp9/vvp9.c index 7075cd8..1c7f96b 100644 --- a/drivers/frame_provider/decoder/vp9/vvp9.c +++ b/drivers/frame_provider/decoder/vp9/vvp9.c @@ -7073,14 +7073,11 @@ static int prepare_display_buf(struct VP9Decoder_s *pbi, struct vdec_s *pvdec = hw_to_vdec(pbi); int stream_offset = pic_config->stream_offset; unsigned short slice_type = pic_config->slice_type; - struct aml_vcodec_ctx * v4l2_ctx = pbi->v4l2_ctx; - ulong nv_order = VIDTYPE_VIU_NV21; u32 pts_valid = 0, pts_us64_valid = 0; u32 pts_save; u64 pts_us64_save; u32 frame_size = 0; - if (debug & VP9_DEBUG_BUFMGR) pr_info("%s index = %d\r\n", __func__, pic_config->index); if (kfifo_get(&pbi->newframe_q, &vf) == 0) { @@ -7088,13 +7085,6 @@ static int prepare_display_buf(struct VP9Decoder_s *pbi, return -1; } - /* swap uv */ - if (pbi->is_used_v4l) { - if ((v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV12) || - (v4l2_ctx->cap_pix_fmt == V4L2_PIX_FMT_NV12M)) - nv_order = VIDTYPE_VIU_NV12; - } - if (pic_config->double_write_mode) set_canvas(pbi, pic_config); @@ -7244,7 +7234,7 @@ static int prepare_display_buf(struct VP9Decoder_s *pbi, if (pic_config->double_write_mode) { vf->type = VIDTYPE_PROGRESSIVE | VIDTYPE_VIU_FIELD; - vf->type |= nv_order; + vf->type |= VIDTYPE_VIU_NV21; if ((pic_config->double_write_mode == 3) && (!IS_8K_SIZE(pic_config->y_crop_width, pic_config->y_crop_height))) { |