summaryrefslogtreecommitdiff
authorPeng Yixin <yixin.peng@amlogic.com>2018-06-21 11:40:26 (GMT)
committer yang.xu <yang.xu@amlogic.com>2018-07-02 07:39:11 (GMT)
commit214dd44003b6339cf251210c86de68cb69f489cc (patch)
tree9e2c962818d192eef0b3f18b99ecc28dfa6e028f
parent8c4a4b09284ac8b5ff128ecebec0e1724704b420 (diff)
downloadmedia_modules-ampere-20180815.zip
media_modules-ampere-20180815.tar.gz
media_modules-ampere-20180815.tar.bz2
PD#168285: mh264: fix cann't play UHD video on widevine.
1.tee video firmware be loaded twice, cause the decoder isn't working properly. Delete the one in the vh264_init function. 2.Remove needn't debug code and optimize code logic. Change-Id: Ifa19b3334a25d0b52d9173537e1b2a1a6a5cea3d Signed-off-by: Peng Yixin <yixin.peng@amlogic.com>
Diffstat
-rw-r--r--drivers/frame_provider/decoder/h264_multi/vmh264.c49
1 files changed, 19 insertions, 30 deletions
diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c
index 7ee7a7c..51c9b1f 100644
--- a/drivers/frame_provider/decoder/h264_multi/vmh264.c
+++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c
@@ -4995,7 +4995,6 @@ static void vh264_local_init(struct vdec_h264_hw_s *hw)
static s32 vh264_init(struct vdec_h264_hw_s *hw)
{
/* int trickmode_fffb = 0; */
- int firmwareloaded = 0;
/* pr_info("\nvh264_init\n"); */
/* init_timer(&hw->recycle_timer); */
@@ -5036,38 +5035,28 @@ static s32 vh264_init(struct vdec_h264_hw_s *hw)
return -ENOMEM;
}
}
- if (tee_enabled() && !firmwareloaded) {
- pr_info("VMH264 start tee load sec firmware ...\n");
- if (hw->mmu_enable &&
- tee_load_video_fw((u32)VIDEO_DEC_H264_MULTI_MMU, 2)
- != 0) {
+ if (!tee_enabled()) {
+ int ret = 0, size = -1;
+ int fw_size = 0x1000 * 16;
+ struct firmware_s *fw = NULL;
+
+ /* -- ucode loading (amrisc and swap code) */
+ hw->mc_cpu_addr =
+ dma_alloc_coherent(amports_get_dma_device(), MC_TOTAL_SIZE,
+ &hw->mc_dma_handle, GFP_KERNEL);
+ if (!hw->mc_cpu_addr) {
amvdec_enable_flag = false;
amvdec_disable();
- pr_info("%s: Error amvdec_mmu_loadmc fail\n",
- __func__);
- return -1;
+ if (hw->mmu_enable)
+ amhevc_disable();
+ pr_info("vh264_init: Can not allocate mc memory.\n");
+ return -ENOMEM;
}
- } else {
- /* -- ucode loading (amrisc and swap code) */
- hw->mc_cpu_addr =
- dma_alloc_coherent(amports_get_dma_device(), MC_TOTAL_SIZE,
- &hw->mc_dma_handle, GFP_KERNEL);
- if (!hw->mc_cpu_addr) {
- amvdec_enable_flag = false;
- amvdec_disable();
- if (hw->mmu_enable)
- amhevc_disable();
- pr_info("vh264_init: Can not allocate mc memory.\n");
- return -ENOMEM;
- }
- /*pr_info("264 ucode swap area: phyaddr %p, cpu vaddr %p\n",
- (void *)hw->mc_dma_handle, hw->mc_cpu_addr);
- */
- if (!firmwareloaded) {
- int ret = 0, size = -1;
- int fw_size = 0x1000 * 16;
- struct firmware_s *fw = NULL;
+ /*pr_info("264 ucode swap area: phyaddr %p, cpu vaddr %p\n",
+ (void *)hw->mc_dma_handle, hw->mc_cpu_addr);
+ */
+
pr_debug("start load orignal firmware ...\n");
@@ -5151,7 +5140,7 @@ static s32 vh264_init(struct vdec_h264_hw_s *hw)
}
return -EBUSY;
}
- }
+
}
#if 1 /* #ifdef BUFFER_MGR_IN_C */
hw->lmem_addr = __get_free_page(GFP_KERNEL);