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

Commit abd40931 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: isp: Add code for new request frame command"

parents 1d0408fb 30fe1f0d
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -461,7 +461,8 @@ static int msm_isp_buf_unprepare(struct msm_isp_buf_mgr *buf_mgr,


static int msm_isp_get_buf(struct msm_isp_buf_mgr *buf_mgr, uint32_t id,
	uint32_t bufq_handle, struct msm_isp_buffer **buf_info)
	uint32_t bufq_handle, uint32_t buf_index,
	struct msm_isp_buffer **buf_info)
{
	int rc = -1;
	unsigned long flags;
@@ -511,8 +512,12 @@ static int msm_isp_get_buf(struct msm_isp_buf_mgr *buf_mgr, uint32_t id,
		}
		break;
	case MSM_ISP_BUFFER_SRC_HAL:
		if (MSM_ISP_INVALID_BUF_INDEX == buf_index)
			vb2_buf = buf_mgr->vb2_ops->get_buf(
				bufq->session_id, bufq->stream_id);
		else
			vb2_buf = buf_mgr->vb2_ops->get_buf_by_idx(
				bufq->session_id, bufq->stream_id,  buf_index);
		if (vb2_buf) {
			if (vb2_buf->v4l2_buf.index < bufq->num_bufs) {
				*buf_info = &bufq->bufs[vb2_buf
+5 −2
Original line number Diff line number Diff line
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2016, 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
@@ -32,6 +32,8 @@
#define BUF_MGR_NUM_BUF_Q 28
#define MAX_IOMMU_CTX 2

#define MSM_ISP_INVALID_BUF_INDEX 0xFFFFFFFF

struct msm_isp_buf_mgr;

enum msm_isp_buffer_src_t {
@@ -140,7 +142,8 @@ struct msm_isp_buf_ops {
		uint32_t bufq_handle, uint32_t *buf_src);

	int (*get_buf)(struct msm_isp_buf_mgr *buf_mgr, uint32_t id,
		uint32_t bufq_handle, struct msm_isp_buffer **buf_info);
		uint32_t bufq_handle, uint32_t buf_index,
		struct msm_isp_buffer **buf_info);

	int (*get_buf_by_index)(struct msm_isp_buf_mgr *buf_mgr,
		uint32_t bufq_handle, uint32_t buf_index,
+1 −0
Original line number Diff line number Diff line
@@ -397,6 +397,7 @@ enum msm_vfe_axi_stream_type {
struct msm_vfe_frame_request_queue {
	struct list_head list;
	enum msm_vfe_buff_queue_id buff_queue_id;
	uint32_t buf_index;
	uint8_t cmd_used;
};

+26 −7
Original line number Diff line number Diff line
@@ -1599,6 +1599,7 @@ static struct msm_isp_buffer *msm_isp_get_stream_buffer(
	struct msm_isp_buffer *buf = NULL;
	struct msm_vfe_axi_stream *temp_stream_info = NULL;
	struct msm_vfe_frame_request_queue *queue_req;
	uint32_t buf_index = MSM_ISP_INVALID_BUF_INDEX;

	if (!stream_info->controllable_output) {
		bufq_handle = stream_info->bufq_handle
@@ -1621,12 +1622,13 @@ static struct msm_isp_buffer *msm_isp_get_stream_buffer(
			__func__);
			return buf;
		}
		buf_index = queue_req->buf_index;
		queue_req->cmd_used = 0;
		list_del(&queue_req->list);
		temp_stream_info->request_q_cnt--;
	}
	rc = vfe_dev->buf_mgr->ops->get_buf(vfe_dev->buf_mgr,
		vfe_dev->pdev->id, bufq_handle, &buf);
		vfe_dev->pdev->id, bufq_handle, buf_index, &buf);

	if (rc == -EFAULT) {
		msm_isp_halt_send_error(vfe_dev,
@@ -3046,7 +3048,8 @@ int msm_isp_cfg_axi_stream(struct vfe_device *vfe_dev, void *arg)

static int msm_isp_return_empty_buffer(struct vfe_device *vfe_dev,
	struct msm_vfe_axi_stream *stream_info, uint32_t user_stream_id,
	uint32_t frame_id, enum msm_vfe_input_src frame_src)
	uint32_t frame_id, uint32_t buf_index,
	enum msm_vfe_input_src frame_src)
{
	int rc = -1;
	struct msm_isp_buffer *buf = NULL;
@@ -3082,7 +3085,7 @@ static int msm_isp_return_empty_buffer(struct vfe_device *vfe_dev,


	rc = vfe_dev->buf_mgr->ops->get_buf(vfe_dev->buf_mgr,
		vfe_dev->pdev->id, bufq_handle, &buf);
		vfe_dev->pdev->id, bufq_handle, buf_index, &buf);
	if (rc == -EFAULT) {
		msm_isp_halt_send_error(vfe_dev, ISP_EVENT_BUF_FATAL_ERROR);
		return rc;
@@ -3120,7 +3123,7 @@ static int msm_isp_return_empty_buffer(struct vfe_device *vfe_dev,

static int msm_isp_request_frame(struct vfe_device *vfe_dev,
	struct msm_vfe_axi_stream *stream_info, uint32_t user_stream_id,
	uint32_t frame_id)
	uint32_t frame_id, uint32_t buf_index)
{
	struct msm_vfe_axi_stream_request_cmd stream_cfg_cmd;
	struct msm_vfe_frame_request_queue *queue_req;
@@ -3173,7 +3176,7 @@ static int msm_isp_request_frame(struct vfe_device *vfe_dev,
			vfe_dev->axi_data.src_info[VFE_PIX_0].active);

		rc = msm_isp_return_empty_buffer(vfe_dev, stream_info,
			user_stream_id, frame_id, frame_src);
			user_stream_id, frame_id, buf_index, frame_src);
		if (rc < 0)
			pr_err("%s:%d failed: return_empty_buffer src %d\n",
				__func__, __LINE__, frame_src);
@@ -3188,7 +3191,7 @@ static int msm_isp_request_frame(struct vfe_device *vfe_dev,
			stream_info->stream_id);

		rc = msm_isp_return_empty_buffer(vfe_dev, stream_info,
			user_stream_id, frame_id, frame_src);
			user_stream_id, frame_id, buf_index, frame_src);
		if (rc < 0)
			pr_err("%s:%d failed: return_empty_buffer src %d\n",
				__func__, __LINE__, frame_src);
@@ -3218,6 +3221,7 @@ static int msm_isp_request_frame(struct vfe_device *vfe_dev,
			user_stream_id, queue_req->buff_queue_id);
		return 0;
	}
	queue_req->buf_index = buf_index;
	queue_req->cmd_used = 1;

	stream_info->request_q_idx =
@@ -3555,7 +3559,8 @@ int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg)
				update_info->stream_handle)];
			rc = msm_isp_request_frame(vfe_dev, stream_info,
				update_info->user_stream_id,
				update_info->frame_id);
				update_info->frame_id,
				MSM_ISP_INVALID_BUF_INDEX);
			if (rc)
				pr_err("%s failed to request frame!\n",
					__func__);
@@ -3617,6 +3622,20 @@ int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg)
		}
		break;
	}
	case UPDATE_STREAM_REQUEST_FRAMES_VER2: {
		struct msm_vfe_axi_stream_cfg_update_info_req_frm *req_frm =
			&update_cmd->req_frm_ver2;
		stream_info = &axi_data->stream_info[HANDLE_TO_IDX(
				req_frm->stream_handle)];
		rc = msm_isp_request_frame(vfe_dev, stream_info,
			req_frm->user_stream_id,
			req_frm->frame_id,
			req_frm->buf_index);
		if (rc)
			pr_err("%s failed to request frame!\n",
				__func__);
		break;
	}
	default:
		pr_err("%s: Invalid update type\n", __func__);
		return -EINVAL;
+2 −1
Original line number Diff line number Diff line
@@ -68,7 +68,8 @@ static int msm_isp_stats_cfg_ping_pong_address(struct vfe_device *vfe_dev,
	pingpong_bit = (~(pingpong_status >> stats_pingpong_offset) & 0x1);

	rc = vfe_dev->buf_mgr->ops->get_buf(vfe_dev->buf_mgr,
			vfe_dev->pdev->id, bufq_handle, &buf);
			vfe_dev->pdev->id, bufq_handle,
			MSM_ISP_INVALID_BUF_INDEX, &buf);
	if (rc == -EFAULT) {
		msm_isp_halt_send_error(vfe_dev, ISP_EVENT_BUF_FATAL_ERROR);
		return rc;