mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 21:07:02 +09:00
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:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user