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

Commit 0c363da0 authored by Junzhe Zou's avatar Junzhe Zou
Browse files

mm: camera: isp: send PD stats buffer earlier



Save pdaf buf address in sof event and send it with stats
notify event.

Change-Id: If147a229f3f007f30ef563469d11b678b887ed57
Signed-off-by: default avatarShubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: default avatarJunzhe Zou <jnzhezou@codeaurora.org>
parent c1b67407
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -449,7 +449,7 @@ struct msm_vfe_axi_stream {

	uint32_t runtime_num_burst_capture;
	uint32_t runtime_output_format;
	enum msm_stream_memory_input_t  memory_input;
	enum msm_stream_rdi_input_type  rdi_input_type;
	struct msm_isp_sw_framskip sw_skip;
	uint8_t sw_ping_pong_bit;
};
@@ -781,6 +781,8 @@ struct vfe_device {
	/* before halt irq info */
	uint32_t recovery_irq0_mask;
	uint32_t recovery_irq1_mask;
	/* Store the buf_idx for pd stats RDI stream */
	uint8_t pd_buf_idx;
};

struct vfe_parent_device {
+37 −2
Original line number Diff line number Diff line
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -914,6 +914,35 @@ void msm_isp_increment_frame_id(struct vfe_device *vfe_dev,
		flags);
}

static void msm_isp_update_pd_stats_idx(struct vfe_device *vfe_dev,
	enum msm_vfe_input_src frame_src)
{
	struct msm_vfe_axi_stream *pd_stream_info = NULL;
	uint32_t pingpong_status = 0, pingpong_bit = 0;
	struct msm_isp_buffer *done_buf = NULL;

	if (frame_src < VFE_RAW_0 || frame_src >  VFE_RAW_2)
		return;

	pd_stream_info = &(vfe_dev->common_data->dual_vfe_res->
		axi_data[vfe_dev->pdev->id]->
		stream_info[RDI_INTF_0 + frame_src - VFE_RAW_0]);

	if (pd_stream_info && (pd_stream_info->state == ACTIVE) &&
		(pd_stream_info->rdi_input_type ==
		MSM_CAMERA_RDI_PDAF)) {
		pingpong_status = vfe_dev->hw_info->vfe_ops.axi_ops.
					get_pingpong_status(vfe_dev);
		pingpong_bit = ((pingpong_status >>
			pd_stream_info->wm[0]) & 0x1);
		done_buf = pd_stream_info->buf[pingpong_bit];
		if (done_buf)
			vfe_dev->pd_buf_idx = done_buf->buf_idx;
		else
			vfe_dev->pd_buf_idx = 0xF;
	}
}

void msm_isp_notify(struct vfe_device *vfe_dev, uint32_t event_type,
	enum msm_vfe_input_src frame_src, struct msm_isp_timestamp *ts)
{
@@ -1011,6 +1040,12 @@ void msm_isp_notify(struct vfe_device *vfe_dev, uint32_t event_type,
					&event_data.u.sof_info);
			}
		}
		/*
		 * Get and store the buf idx for PD stats
		 * this is to send the PD stats buffer address
		 * in BF stats done.
		 */
		msm_isp_update_pd_stats_idx(vfe_dev, frame_src);
		break;

	default:
@@ -1174,7 +1209,7 @@ int msm_isp_request_axi_stream(struct vfe_device *vfe_dev, void *arg)
		return -EINVAL;
	}

	stream_info->memory_input = stream_cfg_cmd->memory_input;
	stream_info->rdi_input_type = stream_cfg_cmd->rdi_input_type;
	vfe_dev->reg_update_requested &=
		~(BIT(SRC_TO_INTF(stream_info->stream_src)));

+4 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -250,6 +250,9 @@ static int32_t msm_isp_stats_buf_divert(struct vfe_device *vfe_dev,
			*comp_stats_type_mask |=
				1 << stream_info->stats_type;
		}
		stats_event->pd_stats_idx = 0xF;
		if (stream_info->stats_type == MSM_ISP_STATS_BF)
			stats_event->pd_stats_idx = vfe_dev->pd_buf_idx;
	}

	return rc;
+6 −4
Original line number Diff line number Diff line
@@ -292,9 +292,10 @@ struct msm_vfe_axi_plane_cfg {
	uint8_t rdi_cid;/*CID 1-16*/
};

enum msm_stream_memory_input_t {
	MEMORY_INPUT_DISABLED,
	MEMORY_INPUT_ENABLED
enum msm_stream_rdi_input_type {
	MSM_CAMERA_RDI_MIN,
	MSM_CAMERA_RDI_PDAF,
	MSM_CAMERA_RDI_MAX,
};

struct msm_vfe_axi_stream_request_cmd {
@@ -317,7 +318,7 @@ struct msm_vfe_axi_stream_request_cmd {
	uint32_t controllable_output;
	uint32_t burst_len;
	/* Flag indicating memory input stream */
	enum msm_stream_memory_input_t memory_input;
	enum msm_stream_rdi_input_type rdi_input_type;
};

struct msm_vfe_axi_stream_release_cmd {
@@ -715,6 +716,7 @@ struct msm_isp_fetch_eng_event {
struct msm_isp_stats_event {
	uint32_t stats_mask;                        /* 4 bytes */
	uint8_t stats_buf_idxs[MSM_ISP_STATS_MAX];  /* 11 bytes */
	uint8_t pd_stats_idx;
};

struct msm_isp_stream_ack {