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

Commit eb66c848 authored by Maheshwar Ajja's avatar Maheshwar Ajja
Browse files

msm: vidc: amend reconfiguration buffer requirements



Do not reset buffer counts while session is running and
modify in case of insufficient event processing.

Change-Id: I5425e54702339e768f3c3a6182fa62dd7a8b484a
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent 82b12123
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -606,6 +606,10 @@ int msm_vidc_calculate_input_buffer_count(struct msm_vidc_inst *inst)
	if (!is_decode_session(inst) && !is_encode_session(inst))
		return 0;

	/* do not change buffer count while session is running  */
	if (inst->state == MSM_VIDC_START_DONE)
		return 0;

	if (is_thumbnail_session(inst)) {
		fmt->count_min = fmt->count_min_host = fmt->count_actual =
			MIN_NUM_THUMBNAIL_MODE_INPUT_BUFFERS;
@@ -650,6 +654,10 @@ int msm_vidc_calculate_output_buffer_count(struct msm_vidc_inst *inst)
	if (!is_decode_session(inst) && !is_encode_session(inst))
		return 0;

	/* do not change buffer count while session is running  */
	if (inst->state == MSM_VIDC_START_DONE)
		return 0;

	if (is_thumbnail_session(inst)) {
		if (codec == V4L2_PIX_FMT_VP9) {
			fmt->count_min =
+10 −9
Original line number Diff line number Diff line
@@ -1765,15 +1765,6 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
	fmt = &inst->fmts[OUTPUT_PORT];
	fmt->v4l2_fmt.fmt.pix_mp.height = event_notify->height;
	fmt->v4l2_fmt.fmt.pix_mp.width = event_notify->width;
	extra_buff_count = msm_vidc_get_extra_buff_count(inst,
					HAL_BUFFER_OUTPUT);
	fmt->count_min = event_notify->capture_buf_count;
	fmt->count_min_host = fmt->count_min + extra_buff_count;

	dprintk(VIDC_HIGH, "%s: buffer[%d] count: min %d min_host %d\n",
		__func__, HAL_BUFFER_OUTPUT, fmt->count_min,
		fmt->count_min_host);

	mutex_unlock(&inst->lock);

	if (event == V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT) {
@@ -1785,6 +1776,16 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
		dprintk(VIDC_HIGH, "%s: %x : batching %s\n",
			__func__, hash32_ptr(inst->session),
			inst->batch.enable ? "enabled" : "disabled");

		extra_buff_count = msm_vidc_get_extra_buff_count(inst,
				HAL_BUFFER_OUTPUT);
		fmt->count_min = event_notify->capture_buf_count;
		fmt->count_min_host = fmt->count_min + extra_buff_count;
		dprintk(VIDC_HIGH,
			"%s: %x : hal buffer[%d] count: min %d min_host %d\n",
			__func__, hash32_ptr(inst->session),
			HAL_BUFFER_OUTPUT, fmt->count_min,
			fmt->count_min_host);
	}

	rc = msm_vidc_check_session_supported(inst);