vdec: set sc2 no single mode profile. [1/1]
authorshihong.zheng <shihong.zheng@amlogic.com>
Thu, 2 Jul 2020 05:28:25 +0000 (13:28 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Wed, 22 Jul 2020 13:48:13 +0000 (06:48 -0700)
PD#SWPL-28657

Problem:
sc2 do not support single mode.
sc2 stream mode dv freeze at first frame.

Solution:
1. add no_single in vcodec profile.
2. update wp for el to get a right buf level.

Verify:
sc2

Change-Id: I53da1855b5245e919b0ca7379f557b975a34b0dd
Signed-off-by: shihong.zheng <shihong.zheng@amlogic.com>
(cherry picked from commit 3360b1a2411905d15e81de423c94986f2830dd1c)

drivers/frame_provider/decoder/utils/vdec.c

index b6e66f2e309eeb32eb27ab9d9fe25f2198b1cb41..ff91179cc3c17734d85872f85419adf4030f4014 100644 (file)
@@ -787,6 +787,11 @@ static void vdec_update_buff_status(void)
                } else if (input_stream_based(input)) {
                        core->stream_buff_flag |= vdec->core_mask;
                }
+               /* slave el pre_decode_level wp update */
+               if ((is_support_no_parser()) && (vdec->slave)) {
+                       STBUF_WRITE(&vdec->slave->vbuf, set_wp,
+                               STBUF_READ(&vdec->vbuf, get_wp));
+               }
        }
        vdec_inputbuff_unlock(core, flags);
 }
@@ -4913,6 +4918,11 @@ static struct platform_driver vdec_driver = {
        }
 };
 
+static struct codec_profile_t amvdec_common_profile = {
+       .name = "vdec_common",
+       .profile = "vdec"
+};
+
 static struct codec_profile_t amvdec_input_profile = {
        .name = "vdec_input",
        .profile = "drm_framemode"
@@ -4926,6 +4936,11 @@ int vdec_module_init(void)
        }
        INIT_REG_NODE_CONFIGS("media.decoder", &vdec_node,
                "vdec", vdec_configs, CONFIG_FOR_RW);
+       if (get_cpu_major_id() >= AM_MESON_CPU_MAJOR_ID_SC2) {
+               amvdec_common_profile.profile = "vdec, no_single";
+       }
+       vcodec_profile_register(&amvdec_common_profile);
+
        vcodec_profile_register(&amvdec_input_profile);
        return 0;
 }