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

Commit e66aa4b4 authored by Arun Menon's avatar Arun Menon
Browse files

msm: vidc: do not send release buffer to f/w in dynamic buffer mode



In dynamic buffer mode, the output buffers are not registered
with the firmware. So the v4l2 video driver does not need
to send release buffer command for output buffers to firmware.

Change-Id: I3b8f37fafe9fa07a45a68ded1de77e90f2764f6c
Signed-off-by: default avatarArun Menon <avmenon@codeaurora.org>
parent af83c6c7
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -805,15 +805,7 @@ int msm_vdec_release_buf(struct msm_vidc_inst *inst,
				core);
		goto exit;
	}
	if (!inst->in_reconfig) {
		rc = msm_comm_try_state(inst, MSM_VIDC_RELEASE_RESOURCES_DONE);
		if (rc) {
			dprintk(VIDC_ERR,
				"Failed to move inst: %p to relase res done\n",
				inst);
			goto exit;
		}
	}

	switch (b->type) {
	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
		break;
+22 −0
Original line number Diff line number Diff line
@@ -743,6 +743,26 @@ int msm_vidc_release_buffers(void *instance, int buffer_type)
	if (!inst)
		return -EINVAL;

	if (!inst->in_reconfig) {
		rc = msm_comm_try_state(inst, MSM_VIDC_RELEASE_RESOURCES_DONE);
		if (rc) {
			dprintk(VIDC_ERR,
					"Failed to move inst: %p to release res done\n",
					inst);
		}
	}

	/*
	* In dynamic buffer mode, driver needs to release resources,
	* but not call release buffers on firmware, as the buffers
	* were never registered with firmware.
	*/
	if ((buffer_type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) &&
		(inst->buffer_mode_set[CAPTURE_PORT] ==
				HAL_BUFFER_MODE_DYNAMIC)) {
		goto free_and_unmap;
	}

	list_for_each_safe(ptr, next, &inst->registered_bufs) {
		bool release_buf = false;
		mutex_lock(&inst->lock);
@@ -781,6 +801,8 @@ int msm_vidc_release_buffers(void *instance, int buffer_type)
				buffer_info.m.planes[0].reserved[1],
				buffer_info.m.planes[0].length);
	}

free_and_unmap:
	mutex_lock(&inst->lock);
	list_for_each_safe(ptr, next, &inst->registered_bufs) {
		bi = list_entry(ptr, struct buffer_info, list);