Loading drivers/media/platform/msm/vidc/msm_venc.c +4 −6 Original line number Diff line number Diff line Loading @@ -1292,11 +1292,11 @@ static int msm_venc_queue_setup(struct vb2_queue *q, new_buf_count.buffer_type = HAL_BUFFER_OUTPUT; new_buf_count.buffer_count_actual = *num_buffers; new_buf_count.buffer_count_actual += msm_dcvs_get_extra_buff_count(inst, false); msm_dcvs_get_extra_buff_count(inst); rc = call_hfi_op(hdev, session_set_property, inst->session, property_id, &new_buf_count); if (!rc) msm_dcvs_set_buff_req_handled(inst, false); msm_dcvs_set_buff_req_handled(inst); break; case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: Loading @@ -1317,12 +1317,10 @@ static int msm_venc_queue_setup(struct vb2_queue *q, if (extradata == V4L2_MPEG_VIDC_EXTRADATA_INPUT_CROP) *num_planes = *num_planes + 1; inst->fmts[OUTPUT_PORT]->num_planes = *num_planes; new_buf_count.buffer_count_actual += msm_dcvs_get_extra_buff_count(inst, true); rc = call_hfi_op(hdev, session_set_property, inst->session, property_id, &new_buf_count); if (!rc) msm_dcvs_set_buff_req_handled(inst, true); if (rc) dprintk(VIDC_ERR, "failed to set count to fw\n"); dprintk(VIDC_DBG, "size = %d, alignment = %d, count = %d\n", inst->buff_req.buffer[0].buffer_size, Loading drivers/media/platform/msm/vidc/msm_vidc_dcvs.c +5 −18 Original line number Diff line number Diff line Loading @@ -557,8 +557,7 @@ static int msm_dcvs_check_supported(struct msm_vidc_inst *inst) return rc; } int msm_dcvs_get_extra_buff_count(struct msm_vidc_inst *inst, bool is_input_buff) int msm_dcvs_get_extra_buff_count(struct msm_vidc_inst *inst) { int extra_buffer = 0; Loading @@ -569,18 +568,14 @@ int msm_dcvs_get_extra_buff_count(struct msm_vidc_inst *inst, if (inst->session_type == MSM_VIDC_ENCODER) { if (msm_dcvs_enc_check(inst)) { if (is_input_buff && !inst->dcvs.is_input_buff_added) extra_buffer = DCVS_ENC_EXTRA_INPUT_BUFFERS; else if (!is_input_buff && !inst->dcvs.is_output_buff_added) if (!inst->dcvs.is_additional_buff_added) extra_buffer = DCVS_ENC_EXTRA_OUTPUT_BUFFERS; } } return extra_buffer; } void msm_dcvs_set_buff_req_handled(struct msm_vidc_inst *inst, bool is_input_buff) void msm_dcvs_set_buff_req_handled(struct msm_vidc_inst *inst) { if (!inst) { dprintk(VIDC_ERR, "%s Invalid args\n", __func__); Loading @@ -589,18 +584,10 @@ void msm_dcvs_set_buff_req_handled(struct msm_vidc_inst *inst, if (inst->session_type == MSM_VIDC_ENCODER) { if (msm_dcvs_enc_check(inst)) { if (is_input_buff && !inst->dcvs.is_input_buff_added) inst->dcvs.is_input_buff_added = true; else if (!is_input_buff && !inst->dcvs.is_output_buff_added) inst->dcvs.is_output_buff_added = true; if (inst->dcvs.is_input_buff_added && inst->dcvs.is_output_buff_added) { if (!inst->dcvs.is_additional_buff_added) inst->dcvs.is_additional_buff_added = true; dprintk(VIDC_PROF, "ENC_DCVS: additional i/p o/p buffer added"); } "ENC_DCVS: additional o/p buffer added"); } } } Loading drivers/media/platform/msm/vidc/msm_vidc_dcvs.h +3 −7 Original line number Diff line number Diff line /* Copyright (c) 2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2015, 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 @@ -21,8 +21,6 @@ #define DCVS_ENC_LOW_THR 4 /* High threshold for encoder dcvs */ #define DCVS_ENC_HIGH_THR 9 /* extra i/p buffers in case of encoder dcvs */ #define DCVS_ENC_EXTRA_INPUT_BUFFERS 2 /* extra o/p buffers in case of encoder dcvs */ #define DCVS_ENC_EXTRA_OUTPUT_BUFFERS 2 /* Default threshold to reduce the core frequency */ Loading @@ -41,10 +39,8 @@ void msm_dcvs_init_load(struct msm_vidc_inst *inst); bool msm_dcvs_enc_check(struct msm_vidc_inst *inst); void msm_dcvs_monitor_buffer(struct msm_vidc_inst *inst); void msm_dcvs_check_and_scale_clocks(struct msm_vidc_inst *inst, bool is_etb); int msm_dcvs_get_extra_buff_count(struct msm_vidc_inst *inst, bool is_input_buff); void msm_dcvs_set_buff_req_handled(struct msm_vidc_inst *inst, bool is_input_buff); int msm_dcvs_get_extra_buff_count(struct msm_vidc_inst *inst); void msm_dcvs_set_buff_req_handled(struct msm_vidc_inst *inst); void msm_dcvs_enc_set_power_save_mode(struct msm_vidc_inst *inst, bool is_power_save_mode); #endif drivers/media/platform/msm/vidc/msm_vidc_internal.h +0 −2 Original line number Diff line number Diff line Loading @@ -201,8 +201,6 @@ struct dcvs_stats { bool is_clock_scaled; int etb_counter; bool is_power_save_mode; bool is_output_buff_added; bool is_input_buff_added; bool is_additional_buff_added; }; Loading Loading
drivers/media/platform/msm/vidc/msm_venc.c +4 −6 Original line number Diff line number Diff line Loading @@ -1292,11 +1292,11 @@ static int msm_venc_queue_setup(struct vb2_queue *q, new_buf_count.buffer_type = HAL_BUFFER_OUTPUT; new_buf_count.buffer_count_actual = *num_buffers; new_buf_count.buffer_count_actual += msm_dcvs_get_extra_buff_count(inst, false); msm_dcvs_get_extra_buff_count(inst); rc = call_hfi_op(hdev, session_set_property, inst->session, property_id, &new_buf_count); if (!rc) msm_dcvs_set_buff_req_handled(inst, false); msm_dcvs_set_buff_req_handled(inst); break; case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: Loading @@ -1317,12 +1317,10 @@ static int msm_venc_queue_setup(struct vb2_queue *q, if (extradata == V4L2_MPEG_VIDC_EXTRADATA_INPUT_CROP) *num_planes = *num_planes + 1; inst->fmts[OUTPUT_PORT]->num_planes = *num_planes; new_buf_count.buffer_count_actual += msm_dcvs_get_extra_buff_count(inst, true); rc = call_hfi_op(hdev, session_set_property, inst->session, property_id, &new_buf_count); if (!rc) msm_dcvs_set_buff_req_handled(inst, true); if (rc) dprintk(VIDC_ERR, "failed to set count to fw\n"); dprintk(VIDC_DBG, "size = %d, alignment = %d, count = %d\n", inst->buff_req.buffer[0].buffer_size, Loading
drivers/media/platform/msm/vidc/msm_vidc_dcvs.c +5 −18 Original line number Diff line number Diff line Loading @@ -557,8 +557,7 @@ static int msm_dcvs_check_supported(struct msm_vidc_inst *inst) return rc; } int msm_dcvs_get_extra_buff_count(struct msm_vidc_inst *inst, bool is_input_buff) int msm_dcvs_get_extra_buff_count(struct msm_vidc_inst *inst) { int extra_buffer = 0; Loading @@ -569,18 +568,14 @@ int msm_dcvs_get_extra_buff_count(struct msm_vidc_inst *inst, if (inst->session_type == MSM_VIDC_ENCODER) { if (msm_dcvs_enc_check(inst)) { if (is_input_buff && !inst->dcvs.is_input_buff_added) extra_buffer = DCVS_ENC_EXTRA_INPUT_BUFFERS; else if (!is_input_buff && !inst->dcvs.is_output_buff_added) if (!inst->dcvs.is_additional_buff_added) extra_buffer = DCVS_ENC_EXTRA_OUTPUT_BUFFERS; } } return extra_buffer; } void msm_dcvs_set_buff_req_handled(struct msm_vidc_inst *inst, bool is_input_buff) void msm_dcvs_set_buff_req_handled(struct msm_vidc_inst *inst) { if (!inst) { dprintk(VIDC_ERR, "%s Invalid args\n", __func__); Loading @@ -589,18 +584,10 @@ void msm_dcvs_set_buff_req_handled(struct msm_vidc_inst *inst, if (inst->session_type == MSM_VIDC_ENCODER) { if (msm_dcvs_enc_check(inst)) { if (is_input_buff && !inst->dcvs.is_input_buff_added) inst->dcvs.is_input_buff_added = true; else if (!is_input_buff && !inst->dcvs.is_output_buff_added) inst->dcvs.is_output_buff_added = true; if (inst->dcvs.is_input_buff_added && inst->dcvs.is_output_buff_added) { if (!inst->dcvs.is_additional_buff_added) inst->dcvs.is_additional_buff_added = true; dprintk(VIDC_PROF, "ENC_DCVS: additional i/p o/p buffer added"); } "ENC_DCVS: additional o/p buffer added"); } } } Loading
drivers/media/platform/msm/vidc/msm_vidc_dcvs.h +3 −7 Original line number Diff line number Diff line /* Copyright (c) 2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2015, 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 @@ -21,8 +21,6 @@ #define DCVS_ENC_LOW_THR 4 /* High threshold for encoder dcvs */ #define DCVS_ENC_HIGH_THR 9 /* extra i/p buffers in case of encoder dcvs */ #define DCVS_ENC_EXTRA_INPUT_BUFFERS 2 /* extra o/p buffers in case of encoder dcvs */ #define DCVS_ENC_EXTRA_OUTPUT_BUFFERS 2 /* Default threshold to reduce the core frequency */ Loading @@ -41,10 +39,8 @@ void msm_dcvs_init_load(struct msm_vidc_inst *inst); bool msm_dcvs_enc_check(struct msm_vidc_inst *inst); void msm_dcvs_monitor_buffer(struct msm_vidc_inst *inst); void msm_dcvs_check_and_scale_clocks(struct msm_vidc_inst *inst, bool is_etb); int msm_dcvs_get_extra_buff_count(struct msm_vidc_inst *inst, bool is_input_buff); void msm_dcvs_set_buff_req_handled(struct msm_vidc_inst *inst, bool is_input_buff); int msm_dcvs_get_extra_buff_count(struct msm_vidc_inst *inst); void msm_dcvs_set_buff_req_handled(struct msm_vidc_inst *inst); void msm_dcvs_enc_set_power_save_mode(struct msm_vidc_inst *inst, bool is_power_save_mode); #endif
drivers/media/platform/msm/vidc/msm_vidc_internal.h +0 −2 Original line number Diff line number Diff line Loading @@ -201,8 +201,6 @@ struct dcvs_stats { bool is_clock_scaled; int etb_counter; bool is_power_save_mode; bool is_output_buff_added; bool is_input_buff_added; bool is_additional_buff_added; }; Loading