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

Commit 66425dc0 authored by Ahmed Abdul-Salam's avatar Ahmed Abdul-Salam
Browse files

msm: VPU: Remove buffer timestamp translation



Buffer timestamps should be passed to firmware as is wihtout translation.
In the standard usage the timestamps correspond to timeval (seconds and
microseconds). But in other modes, they can be used as a simple counter,
which is made possible by removing the unnecessary translation.

Change-Id: I3ef1dde3e3a9bbaaa84771dee37fb7ae48e82738
Signed-off-by: default avatarAhmed Abdul-Salam <aabdulsa@codeaurora.org>
parent f4745006
Loading
Loading
Loading
Loading
+7 −11
Original line number Diff line number Diff line
@@ -418,10 +418,6 @@ static void on_buffer_done(struct vpu_channel_hal *phal,
				 */
				if ((i < packet->num_out_buf) &&
						(phdr->status == 0)) {
					/* IPC timestamp is in nano seconds */
					s64 time_count = pinfo->timestamp_hi;
					time_count = (time_count << 32) |
							pinfo->timestamp_lo;

					/* store EOS info if present */
					if (pinfo->flag & BUFFER_PKT_FLAG_EOS) {
@@ -431,8 +427,11 @@ static void on_buffer_done(struct vpu_channel_hal *phal,
							V4L2_QCOM_BUF_FLAG_EOS;
					}

					vb->vb.v4l2_buf.timestamp =
						ns_to_timeval(time_count);
					vb->vb.v4l2_buf.timestamp.tv_sec =
							pinfo->timestamp_hi;
					vb->vb.v4l2_buf.timestamp.tv_usec =
							pinfo->timestamp_lo;

					vb->vb.v4l2_buf.field =
						translate_field_to_api(
							packet->buf_pkt_flag);
@@ -1263,12 +1262,9 @@ static void vpu_buf_to_ipc_buf_info(struct vpu_buffer *vb, bool input,
		 * an input buffer, assign timestamp, VPU address,
		 * VCAP address if present
		 */
		const struct timeval *tv =
			(const struct timeval *)&vb->vb.v4l2_buf.timestamp;
		s64 time_nsec = timeval_to_ns(tv);

		bie->buf_info.timestamp_hi = (u32)(time_nsec >> 32);
		bie->buf_info.timestamp_lo = (u32)time_nsec;
		bie->buf_info.timestamp_hi = vb->vb.v4l2_buf.timestamp.tv_sec;
		bie->buf_info.timestamp_lo = vb->vb.v4l2_buf.timestamp.tv_usec;

		if (vb->valid_addresses_mask & ADDR_VALID_VCAP) {
			/* put each plane's VCAP address as src address */