Loading drivers/media/platform/msm/vidc/msm_vidc.c +4 −1 Original line number Diff line number Diff line /* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -1612,6 +1612,7 @@ void *msm_vidc_open(int core_id, int session_type) mutex_init(&inst->bufq[CAPTURE_PORT].lock); mutex_init(&inst->bufq[OUTPUT_PORT].lock); mutex_init(&inst->lock); mutex_init(&inst->flush_lock); INIT_MSM_VIDC_LIST(&inst->scratchbufs); INIT_MSM_VIDC_LIST(&inst->freqs); Loading Loading @@ -1714,6 +1715,7 @@ void *msm_vidc_open(int core_id, int session_type) mutex_destroy(&inst->bufq[CAPTURE_PORT].lock); mutex_destroy(&inst->bufq[OUTPUT_PORT].lock); mutex_destroy(&inst->lock); mutex_destroy(&inst->flush_lock); DEINIT_MSM_VIDC_LIST(&inst->scratchbufs); DEINIT_MSM_VIDC_LIST(&inst->persistbufs); Loading Loading @@ -1843,6 +1845,7 @@ int msm_vidc_destroy(struct msm_vidc_inst *inst) mutex_destroy(&inst->bufq[CAPTURE_PORT].lock); mutex_destroy(&inst->bufq[OUTPUT_PORT].lock); mutex_destroy(&inst->lock); mutex_destroy(&inst->flush_lock); msm_vidc_debugfs_deinit_inst(inst); Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +9 −0 Original line number Diff line number Diff line Loading @@ -2019,6 +2019,7 @@ static void handle_session_flush(enum hal_command_response cmd, void *data) return; } mutex_lock(&inst->flush_lock); if (msm_comm_get_stream_output_mode(inst) == HAL_VIDEO_DECODER_SECONDARY) { Loading Loading @@ -2061,6 +2062,7 @@ static void handle_session_flush(enum hal_command_response cmd, void *data) v4l2_event_queue_fh(&inst->event_handler, &flush_event); exit: mutex_unlock(&inst->flush_lock); put_inst(inst); } Loading Loading @@ -4851,6 +4853,10 @@ int msm_comm_flush(struct msm_vidc_inst *inst, u32 flags) return 0; } mutex_lock(&inst->flush_lock); /* enable in flush */ inst->in_flush = true; mutex_lock(&inst->registeredbufs.lock); list_for_each_entry_safe(mbuf, next, &inst->registeredbufs.list, list) { /* don't flush input buffers if input flush is not requested */ Loading Loading @@ -4904,6 +4910,7 @@ int msm_comm_flush(struct msm_vidc_inst *inst, u32 flags) rc = call_hfi_op(hdev, session_flush, inst->session, HAL_FLUSH_OUTPUT); } mutex_unlock(&inst->flush_lock); if (rc) { dprintk(VIDC_ERR, "Sending flush to firmware failed, flush out all buffers\n"); Loading Loading @@ -6244,6 +6251,7 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, bool found = false; int i = 0; mutex_lock(&inst->flush_lock); mutex_lock(&inst->registeredbufs.lock); found = false; /* check if mbuf was not removed by any chance */ Loading Loading @@ -6324,6 +6332,7 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, print_vidc_buffer(VIDC_ERR, "rbr qbuf failed", inst, mbuf); } mutex_unlock(&inst->flush_lock); } int msm_comm_unmap_vidc_buffer(struct msm_vidc_inst *inst, Loading drivers/media/platform/msm/vidc/msm_vidc_internal.h +2 −2 Original line number Diff line number Diff line /* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -362,7 +362,7 @@ struct msm_vidc_core { struct msm_vidc_inst { struct list_head list; struct mutex sync_lock, lock; struct mutex sync_lock, lock, flush_lock; struct msm_vidc_core *core; enum session_type session_type; void *session; Loading Loading
drivers/media/platform/msm/vidc/msm_vidc.c +4 −1 Original line number Diff line number Diff line /* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -1612,6 +1612,7 @@ void *msm_vidc_open(int core_id, int session_type) mutex_init(&inst->bufq[CAPTURE_PORT].lock); mutex_init(&inst->bufq[OUTPUT_PORT].lock); mutex_init(&inst->lock); mutex_init(&inst->flush_lock); INIT_MSM_VIDC_LIST(&inst->scratchbufs); INIT_MSM_VIDC_LIST(&inst->freqs); Loading Loading @@ -1714,6 +1715,7 @@ void *msm_vidc_open(int core_id, int session_type) mutex_destroy(&inst->bufq[CAPTURE_PORT].lock); mutex_destroy(&inst->bufq[OUTPUT_PORT].lock); mutex_destroy(&inst->lock); mutex_destroy(&inst->flush_lock); DEINIT_MSM_VIDC_LIST(&inst->scratchbufs); DEINIT_MSM_VIDC_LIST(&inst->persistbufs); Loading Loading @@ -1843,6 +1845,7 @@ int msm_vidc_destroy(struct msm_vidc_inst *inst) mutex_destroy(&inst->bufq[CAPTURE_PORT].lock); mutex_destroy(&inst->bufq[OUTPUT_PORT].lock); mutex_destroy(&inst->lock); mutex_destroy(&inst->flush_lock); msm_vidc_debugfs_deinit_inst(inst); Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +9 −0 Original line number Diff line number Diff line Loading @@ -2019,6 +2019,7 @@ static void handle_session_flush(enum hal_command_response cmd, void *data) return; } mutex_lock(&inst->flush_lock); if (msm_comm_get_stream_output_mode(inst) == HAL_VIDEO_DECODER_SECONDARY) { Loading Loading @@ -2061,6 +2062,7 @@ static void handle_session_flush(enum hal_command_response cmd, void *data) v4l2_event_queue_fh(&inst->event_handler, &flush_event); exit: mutex_unlock(&inst->flush_lock); put_inst(inst); } Loading Loading @@ -4851,6 +4853,10 @@ int msm_comm_flush(struct msm_vidc_inst *inst, u32 flags) return 0; } mutex_lock(&inst->flush_lock); /* enable in flush */ inst->in_flush = true; mutex_lock(&inst->registeredbufs.lock); list_for_each_entry_safe(mbuf, next, &inst->registeredbufs.list, list) { /* don't flush input buffers if input flush is not requested */ Loading Loading @@ -4904,6 +4910,7 @@ int msm_comm_flush(struct msm_vidc_inst *inst, u32 flags) rc = call_hfi_op(hdev, session_flush, inst->session, HAL_FLUSH_OUTPUT); } mutex_unlock(&inst->flush_lock); if (rc) { dprintk(VIDC_ERR, "Sending flush to firmware failed, flush out all buffers\n"); Loading Loading @@ -6244,6 +6251,7 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, bool found = false; int i = 0; mutex_lock(&inst->flush_lock); mutex_lock(&inst->registeredbufs.lock); found = false; /* check if mbuf was not removed by any chance */ Loading Loading @@ -6324,6 +6332,7 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, print_vidc_buffer(VIDC_ERR, "rbr qbuf failed", inst, mbuf); } mutex_unlock(&inst->flush_lock); } int msm_comm_unmap_vidc_buffer(struct msm_vidc_inst *inst, Loading
drivers/media/platform/msm/vidc/msm_vidc_internal.h +2 −2 Original line number Diff line number Diff line /* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -362,7 +362,7 @@ struct msm_vidc_core { struct msm_vidc_inst { struct list_head list; struct mutex sync_lock, lock; struct mutex sync_lock, lock, flush_lock; struct msm_vidc_core *core; enum session_type session_type; void *session; Loading