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

Commit f7c0d155 authored by Krishna Srinivas Kundurthi's avatar Krishna Srinivas Kundurthi Committed by Krishnankutty Kolathappilly
Browse files

msm: camera: cpp: Update output buffer index of userspace frame pointer



user space frame pointer does not have info on output buffer index
when sending frame for processing. After get_buf on vb2 buffer,
update buff index to user pointer. This is required especially for
partial frame payloads where get_buff is called only for first
payload and the same output buff index should be set for
remaining partial payloads.

Change-Id: I1ffe09bc87be2209e49e6010fd55df3dd3332402
Signed-off-by: default avatarKrishna Srinivas Kundurthi <krisri@codeaurora.org>
parent bd02458c
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -2319,6 +2319,9 @@ static int msm_cpp_cfg(struct cpp_device *cpp_dev,
	struct msm_cpp_frame_info_t *frame = NULL;
	struct msm_cpp_frame_info_t k_frame_info;
	int32_t rc = 0;
	int32_t i = 0;
	int32_t num_buff = sizeof(k_frame_info.output_buffer_info)/
		sizeof(struct msm_cpp_buffer_info_t);
	if (copy_from_user(&k_frame_info,
			(void __user *)ioctl_ptr->ioctl_ptr,
			sizeof(k_frame_info)))
@@ -2330,6 +2333,12 @@ static int msm_cpp_cfg(struct cpp_device *cpp_dev,
		rc = -EINVAL;
	} else {
		rc = msm_cpp_cfg_frame(cpp_dev, frame);
		if (rc >= 0) {
			for (i = 0; i < num_buff; i++) {
				k_frame_info.output_buffer_info[i] =
					frame->output_buffer_info[i];
			}
		}
	}

	ioctl_ptr->trans_code = rc;
@@ -2338,6 +2347,13 @@ static int msm_cpp_cfg(struct cpp_device *cpp_dev,
		sizeof(int32_t)))
		pr_err("error cannot copy error\n");


	if (copy_to_user((void __user *)ioctl_ptr->ioctl_ptr,
		&k_frame_info, sizeof(k_frame_info))) {
		pr_err("Error: cannot copy k_frame_info");
		return -EFAULT;
	}

	return rc;
}