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

Commit 220353de 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: do not send release buffer to f/w in dynamic buffer mode"

parents 5278e664 e66aa4b4
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
@@ -745,6 +745,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);
@@ -783,6 +803,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);