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

Commit 21aa959f authored by Karthik Anantha Ram's avatar Karthik Anantha Ram Committed by Vishalsingh Hajeri
Browse files

msm: camera: icp: Add support for semi real time device types



Add support for IPE/BPS semi real time device types.

Change-Id: I1d9974eb796ce1723205072651d53ecb84023e88
Signed-off-by: default avatarKarthik Anantha Ram <kartanan@codeaurora.org>
Signed-off-by: default avatarVishalsingh Hajeri <vhajeri@codeaurora.org>
parent db92782e
Loading
Loading
Loading
Loading
+31 −4
Original line number Original line Diff line number Diff line
@@ -4965,10 +4965,31 @@ static int cam_icp_get_acquire_info(struct cam_icp_hw_mgr *hw_mgr,
	return 0;
	return 0;
}
}


static uint32_t cam_icp_unify_dev_type(
	uint32_t dev_type)
{
	switch (dev_type) {
	case CAM_ICP_RES_TYPE_BPS:
		return CAM_ICP_RES_TYPE_BPS;
	case CAM_ICP_RES_TYPE_BPS_RT:
		return CAM_ICP_RES_TYPE_BPS;
	case CAM_ICP_RES_TYPE_BPS_SEMI_RT:
		return CAM_ICP_RES_TYPE_BPS;
	case CAM_ICP_RES_TYPE_IPE:
		return CAM_ICP_RES_TYPE_IPE;
	case CAM_ICP_RES_TYPE_IPE_RT:
		return CAM_ICP_RES_TYPE_IPE;
	case CAM_ICP_RES_TYPE_IPE_SEMI_RT:
		return CAM_ICP_RES_TYPE_IPE;
	default:
		return CAM_ICP_RES_TYPE_MAX;
	}
}

static int cam_icp_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
static int cam_icp_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
{
{
	int rc = 0, bitmap_size = 0;
	int rc = 0, bitmap_size = 0;
	uint32_t ctx_id = 0;
	uint32_t ctx_id = 0, dev_type;
	uint64_t io_buf_addr;
	uint64_t io_buf_addr;
	size_t io_buf_size;
	size_t io_buf_size;
	struct cam_icp_hw_mgr *hw_mgr = hw_mgr_priv;
	struct cam_icp_hw_mgr *hw_mgr = hw_mgr_priv;
@@ -5061,6 +5082,10 @@ static int cam_icp_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
		goto create_handle_failed;
		goto create_handle_failed;
	}
	}


	CAM_DBG(CAM_ICP,
		"created stream handle for dev_type %u",
		icp_dev_acquire_info->dev_type);

	cmd_mem_region.num_regions = 1;
	cmd_mem_region.num_regions = 1;
	cmd_mem_region.map_info_array[0].mem_handle =
	cmd_mem_region.map_info_array[0].mem_handle =
		icp_dev_acquire_info->io_config_cmd_handle;
		icp_dev_acquire_info->io_config_cmd_handle;
@@ -5120,10 +5145,12 @@ static int cam_icp_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
	/* Start context timer*/
	/* Start context timer*/
	cam_icp_ctx_timer_start(ctx_data);
	cam_icp_ctx_timer_start(ctx_data);
	hw_mgr->ctxt_cnt++;
	hw_mgr->ctxt_cnt++;
	dev_type = cam_icp_unify_dev_type(icp_dev_acquire_info->dev_type);
	icp_dev_acquire_info->dev_type = dev_type;
	mutex_unlock(&hw_mgr->hw_mgr_mutex);
	mutex_unlock(&hw_mgr->hw_mgr_mutex);
	CAM_DBG(CAM_ICP, "Acquire Done for ctx_id %u dev name %s dev type %d",

		ctx_data->ctx_id, cam_icp_dev_type_to_name(
	CAM_DBG(CAM_ICP, "Acquire Done for ctx_id %u dev type %d",
		icp_dev_acquire_info->dev_type),
		ctx_data->ctx_id,
		icp_dev_acquire_info->dev_type);
		icp_dev_acquire_info->dev_type);


	return 0;
	return 0;
+7 −4
Original line number Original line Diff line number Diff line
@@ -21,7 +21,10 @@
#define CAM_ICP_RES_TYPE_BPS         1
#define CAM_ICP_RES_TYPE_BPS         1
#define CAM_ICP_RES_TYPE_IPE_RT      2
#define CAM_ICP_RES_TYPE_IPE_RT      2
#define CAM_ICP_RES_TYPE_IPE         3
#define CAM_ICP_RES_TYPE_IPE         3
#define CAM_ICP_RES_TYPE_MAX        4
#define CAM_ICP_RES_TYPE_IPE_SEMI_RT 4
#define CAM_ICP_RES_TYPE_BPS_RT      5
#define CAM_ICP_RES_TYPE_BPS_SEMI_RT 6
#define CAM_ICP_RES_TYPE_MAX         7


/* packet opcode types */
/* packet opcode types */
#define CAM_ICP_OPCODE_IPE_UPDATE   0
#define CAM_ICP_OPCODE_IPE_UPDATE   0