PD#167020: vdec: fix cann't play all video after use aiqiyi play video

1.Delete redundant code to set the connected statu in mh264
2.add mutex, to fix core schedule statu is active but no decoder being scheduled, it cause all video cann't play.

Change-Id: Ica094d8068be78d36699749c5b32e8e3ad34d4ca
Signed-off-by: Peng Yixin <yixin.peng@amlogic.com>
This commit is contained in:
Peng Yixin
2018-07-09 17:58:51 +08:00
committed by Dongjin Kim
parent 3be62d451e
commit a7aeb2aa48
2 changed files with 8 additions and 7 deletions

View File

@@ -6236,7 +6236,7 @@ static void vmh264_reset_userdata_fifo(struct vdec_s *vdec, int bInit)
if (hw) {
mutex_lock(&hw->userdata_mutex);
pr_info("vmpeg12_reset_userdata_fifo: bInit: %d, ri: %d, wi: %d\n",
pr_info("vmh264_reset_userdata_fifo: bInit: %d, ri: %d, wi: %d\n",
bInit,
hw->userdata_info.read_index,
hw->userdata_info.write_index);
@@ -6490,7 +6490,6 @@ result_done:
hw->stat &= ~STAT_TIMER_ARM;
/* mark itself has all HW resource released and input released */
vdec_set_status(hw_to_vdec(hw), VDEC_STATUS_CONNECTED);
#ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION
if (hw->switch_dvlayer_flag) {

View File

@@ -1357,7 +1357,7 @@ int vdec_disconnect(struct vdec_s *vdec)
(vdec->status != VDEC_STATUS_ACTIVE)) {
return 0;
}
mutex_lock(&vdec_mutex);
/*
*when a vdec is under the management of scheduler
* the status change will only be from vdec_core_thread
@@ -1368,7 +1368,7 @@ int vdec_disconnect(struct vdec_s *vdec)
vdec_set_next_status(vdec->slave, VDEC_STATUS_DISCONNECTED);
else if (vdec->master)
vdec_set_next_status(vdec->master, VDEC_STATUS_DISCONNECTED);
mutex_unlock(&vdec_mutex);
up(&vdec_core->sem);
wait_for_completion(&vdec->inactive_done);
@@ -1799,7 +1799,7 @@ void vdec_core_finish_run(struct vdec_s *vdec, unsigned long mask)
{
unsigned long i;
unsigned long t = mask;
mutex_lock(&vdec_mutex);
while (t) {
i = __ffs(t);
clear_bit(i, &vdec->active_mask);
@@ -1808,6 +1808,8 @@ void vdec_core_finish_run(struct vdec_s *vdec, unsigned long mask)
if (vdec->active_mask == 0)
vdec_set_status(vdec, VDEC_STATUS_CONNECTED);
mutex_unlock(&vdec_mutex);
}
EXPORT_SYMBOL(vdec_core_finish_run);
/*
@@ -2077,7 +2079,7 @@ static int vdec_core_thread(void *data)
if (kthread_should_stop())
break;
mutex_lock(&vdec_mutex);
/* clean up previous active vdec's input */
list_for_each_entry(vdec, &core->connected_vdec_list, list) {
unsigned long mask = vdec->sched_mask &
@@ -2139,7 +2141,7 @@ static int vdec_core_thread(void *data)
list_move(&vdec->list, &disconnecting_list);
}
}
mutex_unlock(&vdec_mutex);
/* elect next vdec to be scheduled */
vdec = core->active_vdec;
if (vdec) {