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

Commit 39261bca authored by Meera Gande's avatar Meera Gande Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: isp: Added IOCTL frame id for FE



Existing logic for assigning frame ID was causing empty
buffer to be returned for snapshot frame for FE. Added
ioctl to update frame id for FE.

Change-Id: Id615da9f8f5e3cd89098162cd19ce65df5a861f2
Signed-off-by: default avatarMeera Gande <mgande@codeaurora.org>
parent 572d2a2b
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -351,6 +351,20 @@ int msm_isp_unsubscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
	return msm_isp_process_event_subscription(fh, sub, false);
}

static int msm_isp_update_fe_frame_id(struct vfe_device *vfe_dev,
	void *arg)
{
	struct msm_vfe_update_fe_frame_id *session_frameid = arg;
	int rc = 0;
	/*
	* For Offline VFE, HAL expects same frame id
	* for offline output which it requested in do_reprocess.
	*/
	vfe_dev->axi_data.src_info[VFE_PIX_0].frame_id =
		   session_frameid->frame_id;
	return rc;
}

static int msm_isp_start_fetch_engine(struct vfe_device *vfe_dev,
	void *arg)
{
@@ -930,6 +944,13 @@ static long msm_isp_ioctl_unlocked(struct v4l2_subdev *sd,
		rc = msm_isp_start_fetch_engine_multi_pass(vfe_dev, arg);
		mutex_unlock(&vfe_dev->core_mutex);
		break;

	case VIDIOC_MSM_ISP_UPDATE_FE_FRAME_ID:
		mutex_lock(&vfe_dev->core_mutex);
		rc = msm_isp_update_fe_frame_id(vfe_dev, arg);
		mutex_unlock(&vfe_dev->core_mutex);
		break;

	case VIDIOC_MSM_ISP_REG_UPDATE_CMD:
		if (arg) {
			enum msm_vfe_input_src frame_src =
+10 −0
Original line number Diff line number Diff line
@@ -327,6 +327,11 @@ struct msm_vfe_axi_stream_release_cmd {
	uint32_t stream_handle;
};

struct msm_vfe_update_fe_frame_id {
	uint32_t frame_id;
};


enum msm_vfe_axi_stream_cmd {
	STOP_STREAM,
	START_STREAM,
@@ -890,6 +895,7 @@ enum msm_isp_ioctl_cmd_code {
	MSM_ISP_MAP_BUF_START_MULTI_PASS_FE,
	MSM_ISP_CFG_HW_STATE,
	MSM_ISP_AHB_CLK_CFG,
	MSM_ISP_UPDATE_FE_FRAME_ID,
};

#define VIDIOC_MSM_VFE_REG_CFG \
@@ -988,6 +994,10 @@ enum msm_isp_ioctl_cmd_code {
	_IOWR('V', MSM_ISP_MAP_BUF_START_FE, \
		struct msm_vfe_fetch_eng_start)

#define VIDIOC_MSM_ISP_UPDATE_FE_FRAME_ID \
	_IOWR('V', MSM_ISP_UPDATE_FE_FRAME_ID, \
		struct msm_vfe_update_fe_frame_id)

#define VIDIOC_MSM_ISP_UNMAP_BUF \
	_IOWR('V', MSM_ISP_UNMAP_BUF, \
		struct msm_isp_unmap_buf_req)