Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e07ecf56 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Provide the correct buffer count to client"

parents 23be499a 11714fe8
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -1338,8 +1338,14 @@ static int msm_venc_queue_setup(struct vb2_queue *q,

		buff_req = get_buff_req_buffer(inst, HAL_BUFFER_OUTPUT);
		if (buff_req) {
			*num_buffers = buff_req->buffer_count_actual =
			max(*num_buffers, buff_req->buffer_count_min);
			/*
			 * Pretend as if the FW itself is asking for additional
			 * buffers, which are required for DCVS
			 */
			unsigned int min_req_buffers =
				buff_req->buffer_count_min +
				msm_dcvs_get_extra_buff_count(inst);
			*num_buffers = max(*num_buffers, min_req_buffers);
		}

		if (*num_buffers < MIN_NUM_CAPTURE_BUFFERS ||
@@ -1399,12 +1405,8 @@ static int msm_venc_queue_setup(struct vb2_queue *q,
		property_id = HAL_PARAM_BUFFER_COUNT_ACTUAL;
		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);
		rc = call_hfi_op(hdev, session_set_property, inst->session,
			property_id, &new_buf_count);
		if (!rc)
			msm_dcvs_set_buff_req_handled(inst);

		break;
	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
+3 −22
Original line number Diff line number Diff line
@@ -547,8 +547,7 @@ static bool msm_dcvs_check_supported(struct msm_vidc_inst *inst)
	} else if (instance_count == 1 &&
			inst->session_type == MSM_VIDC_ENCODER &&
			!msm_comm_turbo_session(inst)) {
		if (!msm_dcvs_enc_check(inst) ||
			!inst->dcvs.is_additional_buff_added)
		if (!msm_dcvs_enc_check(inst))
			return false;
	} else {
		/*
@@ -596,10 +595,8 @@ 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 (!inst->dcvs.is_additional_buff_added)
		if (msm_dcvs_enc_check(inst))
			extra_buffer = DCVS_ENC_EXTRA_OUTPUT_BUFFERS;
		}
	} else if (inst->session_type == MSM_VIDC_DECODER) {
		if (msm_dcvs_check_supported(inst))
			extra_buffer = DCVS_DEC_EXTRA_OUTPUT_BUFFERS;
@@ -607,22 +604,6 @@ int msm_dcvs_get_extra_buff_count(struct msm_vidc_inst *inst)
	return extra_buffer;
}

void msm_dcvs_set_buff_req_handled(struct msm_vidc_inst *inst)
{
	if (!inst) {
		dprintk(VIDC_ERR, "%s Invalid args\n", __func__);
		return;
	}

	if (inst->session_type == MSM_VIDC_ENCODER) {
		if (msm_dcvs_enc_check(inst)) {
			if (!inst->dcvs.is_additional_buff_added)
				inst->dcvs.is_additional_buff_added = true;
				dprintk(VIDC_PROF,
					"ENC_DCVS: additional o/p buffer added");
		}
	}
}

void msm_dcvs_enc_set_power_save_mode(struct msm_vidc_inst *inst,
					bool is_power_save_mode)
+0 −1
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ void msm_dcvs_init_load(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);
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
+0 −1
Original line number Diff line number Diff line
@@ -200,7 +200,6 @@ struct dcvs_stats {
	bool is_clock_scaled;
	int etb_counter;
	bool is_power_save_mode;
	bool is_additional_buff_added;
};

struct profile_data {