From: minliang.lu Date: Mon, 18 May 2020 08:49:39 +0000 (+0800) Subject: vdec: use new v4lvideo path without di to support fence [2/3] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=475e80ac80c2d703590ec82342f24d954fdcbd74;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_media.git vdec: use new v4lvideo path without di to support fence [2/3] PD#SWPL-26962 Problem: New feature to support decoder output fence, the di can't be contained in the video path. Solution: Use new v4lvideo path without di to support fence. Verify: newton Change-Id: Ic38c84e5c31ff1ca4416f18bfe5453cab54a1feb Signed-off-by: minliang.lu --- diff --git a/drivers/frame_provider/decoder/utils/vdec.c b/drivers/frame_provider/decoder/utils/vdec.c index 345d4a2..dc89179 100644 --- a/drivers/frame_provider/decoder/utils/vdec.c +++ b/drivers/frame_provider/decoder/utils/vdec.c @@ -2471,6 +2471,26 @@ s32 vdec_init(struct vdec_s *vdec, int is_4k) } snprintf(vdec->vfm_map_id, VDEC_MAP_NAME_SIZE, "vdec-map-%d", vdec->id); + } else if (p->frame_base_video_path == + FRAME_BASE_PATH_V4LVIDEO) { +#ifdef CONFIG_AMLOGIC_V4L_VIDEO3 + r = v4lvideo_assign_map(&vdec->vf_receiver_name, + &vdec->vf_receiver_inst); +#else + r = -1; +#endif + if (r < 0) { + pr_err("V4lVideo frame receiver allocation failed.\n"); + mutex_lock(&vdec_mutex); + inited_vcodec_num--; + mutex_unlock(&vdec_mutex); + goto error; + } + snprintf(vdec->vfm_map_chain, VDEC_MAP_NAME_SIZE, + "%s %s", vdec->vf_provider_name, + vdec->vf_receiver_name); + snprintf(vdec->vfm_map_id, VDEC_MAP_NAME_SIZE, + "vdec-map-%d", vdec->id); } if (vfm_map_add(vdec->vfm_map_id,