From 3926ee9b6dfef7d04475a4c6f77905471e8c6fb5 Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Wed, 21 Nov 2018 14:33:19 +0800 Subject: [PATCH] media_module: fix fw teeload status issue in vmh264 [1/1] PD#SWPL-2284 Problem: there is issue in vmh264 fw teeload. which cause decoding fail. REG_G status should be saved for each instance Solution: saved reg_g at each instance ctx Verify: Verified P241 Change-Id: I7ff11951a7c53f360dfdae9a8605180f28c7bb4b --- .../media_modules/frame_provider/decoder/h264_multi/vmh264.c | 3 +++ .../amlogic/media_modules/frame_provider/decoder/utils/vdec.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/vmh264.c b/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/vmh264.c index 43ad4aaa3671..2bbc5aa40555 100644 --- a/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/vmh264.c +++ b/drivers/amlogic/media_modules/frame_provider/decoder/h264_multi/vmh264.c @@ -783,6 +783,7 @@ struct vdec_h264_hw_s { bool is_used_v4l; void *v4l2_ctx; wait_queue_head_t wait_q; + u32 reg_g_status; }; static u32 again_threshold = 0x40; @@ -6929,6 +6930,7 @@ static void run(struct vdec_s *vdec, unsigned long mask, and not changes to another. ignore reload. */ + WRITE_VREG(AV_SCRATCH_G, hw->reg_g_status); } else { ret = amvdec_vdec_loadmc_ex(VFORMAT_H264, "mh264", vdec, hw->fw->data); @@ -6944,6 +6946,7 @@ static void run(struct vdec_s *vdec, unsigned long mask, return; } vdec->mc_type = VFORMAT_H264; + hw->reg_g_status = READ_VREG(AV_SCRATCH_G); if (hw->mmu_enable) { ret = amhevc_loadmc_ex(VFORMAT_H264, "mh264_mmu", hw->fw_mmu->data); diff --git a/drivers/amlogic/media_modules/frame_provider/decoder/utils/vdec.c b/drivers/amlogic/media_modules/frame_provider/decoder/utils/vdec.c index 185c01a2d724..f4bfbe682ae5 100644 --- a/drivers/amlogic/media_modules/frame_provider/decoder/utils/vdec.c +++ b/drivers/amlogic/media_modules/frame_provider/decoder/utils/vdec.c @@ -2099,7 +2099,7 @@ void vdec_prepare_run(struct vdec_s *vdec, unsigned long mask) static int vdec_core_thread(void *data) { struct vdec_core_s *core = (struct vdec_core_s *)data; - struct vdec_s *lastvdec; + struct vdec_s *lastvdec = (struct vdec_s *) core->last_vdec; struct sched_param param = {.sched_priority = MAX_RT_PRIO/2}; sched_setscheduler(current, SCHED_FIFO, ¶m);