Loading drivers/media/platform/msm/vidc/msm_vidc.c +9 −2 Original line number Diff line number Diff line /* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2016, 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 @@ -814,8 +814,15 @@ int msm_vidc_qbuf(void *instance, struct v4l2_buffer *b) } rc = map_and_register_buf(inst, b); if (rc == -EEXIST) if (rc == -EEXIST) { if (atomic_read(&inst->in_flush) && is_dynamic_output_buffer_mode(b, inst)) { dprintk(VIDC_ERR, "Flush in progress, do not hold any buffers in driver\n"); msm_comm_flush_dynamic_buffers(inst); } return 0; } if (rc) return rc; Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +7 −2 Original line number Diff line number Diff line /* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2016, 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 @@ -1441,7 +1441,8 @@ static void handle_session_flush(enum hal_command_response cmd, void *data) } } } atomic_dec(&inst->in_flush); dprintk(VIDC_DBG, "Notify flush complete to client\n"); msm_vidc_queue_v4l2_event(inst, V4L2_EVENT_MSM_VIDC_FLUSH_DONE); put_inst(inst); } Loading Loading @@ -4422,6 +4423,8 @@ int msm_comm_flush(struct msm_vidc_inst *inst, u32 flags) "FLUSH BUG: Pending q not empty! It should be empty\n"); } mutex_unlock(&inst->pendingq.lock); atomic_inc(&inst->in_flush); dprintk(VIDC_DBG, "Send flush Output to firmware\n"); rc = call_hfi_op(hdev, session_flush, inst->session, HAL_FLUSH_OUTPUT); } else { Loading Loading @@ -4458,6 +4461,8 @@ int msm_comm_flush(struct msm_vidc_inst *inst, u32 flags) /*Do not send flush in case of session_error */ if (!(inst->state == MSM_VIDC_CORE_INVALID && core->state != VIDC_CORE_INVALID)) atomic_inc(&inst->in_flush); dprintk(VIDC_DBG, "Send flush all to firmware\n"); rc = call_hfi_op(hdev, session_flush, inst->session, HAL_FLUSH_ALL); } Loading drivers/media/platform/msm/vidc/msm_vidc_common.h +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2016, 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 @@ -48,6 +48,7 @@ void msm_comm_scale_clocks_and_bus(struct msm_vidc_inst *inst); int msm_comm_scale_clocks(struct msm_vidc_core *core); int msm_comm_scale_clocks_load(struct msm_vidc_core *core, int num_mbs_per_sec, enum load_calc_quirks quirks); void msm_comm_flush_dynamic_buffers(struct msm_vidc_inst *inst); int msm_comm_flush(struct msm_vidc_inst *inst, u32 flags); int msm_comm_release_scratch_buffers(struct msm_vidc_inst *inst, bool check_for_reuse); Loading drivers/media/platform/msm/vidc/msm_vidc_internal.h +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2016, 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 @@ -287,6 +287,7 @@ struct msm_vidc_inst { struct kref kref; unsigned long instant_bitrate; u32 buffers_held_in_driver; atomic_t in_flush; }; extern struct msm_vidc_drv *vidc_driver; Loading Loading
drivers/media/platform/msm/vidc/msm_vidc.c +9 −2 Original line number Diff line number Diff line /* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2016, 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 @@ -814,8 +814,15 @@ int msm_vidc_qbuf(void *instance, struct v4l2_buffer *b) } rc = map_and_register_buf(inst, b); if (rc == -EEXIST) if (rc == -EEXIST) { if (atomic_read(&inst->in_flush) && is_dynamic_output_buffer_mode(b, inst)) { dprintk(VIDC_ERR, "Flush in progress, do not hold any buffers in driver\n"); msm_comm_flush_dynamic_buffers(inst); } return 0; } if (rc) return rc; Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +7 −2 Original line number Diff line number Diff line /* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2016, 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 @@ -1441,7 +1441,8 @@ static void handle_session_flush(enum hal_command_response cmd, void *data) } } } atomic_dec(&inst->in_flush); dprintk(VIDC_DBG, "Notify flush complete to client\n"); msm_vidc_queue_v4l2_event(inst, V4L2_EVENT_MSM_VIDC_FLUSH_DONE); put_inst(inst); } Loading Loading @@ -4422,6 +4423,8 @@ int msm_comm_flush(struct msm_vidc_inst *inst, u32 flags) "FLUSH BUG: Pending q not empty! It should be empty\n"); } mutex_unlock(&inst->pendingq.lock); atomic_inc(&inst->in_flush); dprintk(VIDC_DBG, "Send flush Output to firmware\n"); rc = call_hfi_op(hdev, session_flush, inst->session, HAL_FLUSH_OUTPUT); } else { Loading Loading @@ -4458,6 +4461,8 @@ int msm_comm_flush(struct msm_vidc_inst *inst, u32 flags) /*Do not send flush in case of session_error */ if (!(inst->state == MSM_VIDC_CORE_INVALID && core->state != VIDC_CORE_INVALID)) atomic_inc(&inst->in_flush); dprintk(VIDC_DBG, "Send flush all to firmware\n"); rc = call_hfi_op(hdev, session_flush, inst->session, HAL_FLUSH_ALL); } Loading
drivers/media/platform/msm/vidc/msm_vidc_common.h +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2016, 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 @@ -48,6 +48,7 @@ void msm_comm_scale_clocks_and_bus(struct msm_vidc_inst *inst); int msm_comm_scale_clocks(struct msm_vidc_core *core); int msm_comm_scale_clocks_load(struct msm_vidc_core *core, int num_mbs_per_sec, enum load_calc_quirks quirks); void msm_comm_flush_dynamic_buffers(struct msm_vidc_inst *inst); int msm_comm_flush(struct msm_vidc_inst *inst, u32 flags); int msm_comm_release_scratch_buffers(struct msm_vidc_inst *inst, bool check_for_reuse); Loading
drivers/media/platform/msm/vidc/msm_vidc_internal.h +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2016, 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 @@ -287,6 +287,7 @@ struct msm_vidc_inst { struct kref kref; unsigned long instant_bitrate; u32 buffers_held_in_driver; atomic_t in_flush; }; extern struct msm_vidc_drv *vidc_driver; Loading