vdec: use new v4lvideo path without di to support fence [2/3]
authorminliang.lu <minliang.lu@amlogic.com>
Mon, 18 May 2020 08:49:39 +0000 (16:49 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Fri, 29 May 2020 13:37:51 +0000 (06:37 -0700)
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 <minliang.lu@amlogic.com>
drivers/frame_provider/decoder/utils/vdec.c

index 345d4a24fa786ee82ed96eb6eb3612f55196910e..dc891794a88f4a54adc0cadd6861c727c5a17c64 100644 (file)
@@ -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,