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

Commit 216a0f9b authored by Venkat Chinta's avatar Venkat Chinta
Browse files

msm: camera: ife: Enable CSID crop for PPP path



This change enables CSID crop for PPP path for use with
type 3 PD sensor. To enable this, crop enable flag is
sent down from hw manager as part of CSID acquire args.

Change-Id: Ib615b32f7a7d067ed87ff83903e07a70a7461687
Signed-off-by: default avatarVenkat Chinta <vchinta@codeaurora.org>
parent 21602286
Loading
Loading
Loading
Loading
+21 −4
Original line number Diff line number Diff line
@@ -1503,7 +1503,8 @@ static int cam_ife_mgr_acquire_cid_res(
static int cam_ife_hw_mgr_acquire_res_ife_csid_pxl(
	struct cam_ife_hw_mgr_ctx           *ife_ctx,
	struct cam_isp_in_port_generic_info *in_port,
	bool                                is_ipp)
	bool                                 is_ipp,
	bool                                 crop_enable)
{
	int rc = -1;
	int i;
@@ -1560,6 +1561,7 @@ static int cam_ife_hw_mgr_acquire_res_ife_csid_pxl(
		csid_acquire.in_port = in_port;
		csid_acquire.out_port = in_port->data;
		csid_acquire.node_res = NULL;
		csid_acquire.crop_enable = crop_enable;

		hw_intf = cid_res->hw_res[i]->hw_intf;

@@ -1689,6 +1691,12 @@ static int cam_ife_hw_mgr_acquire_res_ife_csid_rdi(
		csid_acquire.sync_mode = CAM_ISP_HW_SYNC_NONE;
		csid_acquire.node_res = NULL;

		/* Enable RDI crop for single ife use case only */
		if (in_port->usage_type)
			csid_acquire.crop_enable = false;
		else
			csid_acquire.crop_enable = true;

		hw_intf = cid_res->hw_res[0]->hw_intf;
		rc = hw_intf->hw_ops.reserve(hw_intf->hw_priv,
			&csid_acquire, sizeof(csid_acquire));
@@ -1935,6 +1943,7 @@ static int cam_ife_mgr_acquire_hw_for_ctx(
	int ppp_count                             = 0;
	int ife_rd_count                          = 0;
	int lcr_count                             = 0;
	bool crop_enable                          = true;

	is_dual_vfe = in_port->usage_type;

@@ -1958,7 +1967,7 @@ static int cam_ife_mgr_acquire_hw_for_ctx(
	if (ipp_count || lcr_count) {
		/* get ife csid IPP resource */
		rc = cam_ife_hw_mgr_acquire_res_ife_csid_pxl(ife_ctx,
			in_port, true);
			in_port, true, crop_enable);
		if (rc) {
			CAM_ERR(CAM_ISP,
				"Acquire IFE CSID IPP/LCR resource Failed");
@@ -1967,7 +1976,7 @@ static int cam_ife_mgr_acquire_hw_for_ctx(
	}

	if (rdi_count) {
		/* get ife csid rdi resource */
		/* get ife csid RDI resource */
		rc = cam_ife_hw_mgr_acquire_res_ife_csid_rdi(ife_ctx, in_port);
		if (rc) {
			CAM_ERR(CAM_ISP,
@@ -1978,8 +1987,16 @@ static int cam_ife_mgr_acquire_hw_for_ctx(

	if (ppp_count) {
		/* get ife csid PPP resource */

		/* If both IPP and PPP paths are requested with the same vc dt
		 * it is implied that the sensor is a type 3 PD sensor. Crop
		 * must be enabled for this sensor on PPP path as well.
		 */
		if (!ipp_count)
			crop_enable = false;

		rc = cam_ife_hw_mgr_acquire_res_ife_csid_pxl(ife_ctx,
			in_port, false);
			in_port, false, crop_enable);
		if (rc) {
			CAM_ERR(CAM_ISP,
				"Acquire IFE CSID PPP resource Failed");
+1 −23
Original line number Diff line number Diff line
@@ -1014,29 +1014,7 @@ static int cam_ife_csid_path_reserve(struct cam_ife_csid_hw *csid_hw,
	path_data->height  = reserve->in_port->height;
	path_data->start_line = reserve->in_port->line_start;
	path_data->end_line = reserve->in_port->line_stop;

	/* Enable RDI crop for single ife use case only */
	switch (reserve->res_id) {
	case CAM_IFE_PIX_PATH_RES_RDI_0:
	case CAM_IFE_PIX_PATH_RES_RDI_1:
	case CAM_IFE_PIX_PATH_RES_RDI_2:
	case CAM_IFE_PIX_PATH_RES_RDI_3:
		if (reserve->in_port->usage_type)
			path_data->crop_enable = false;
		else
			path_data->crop_enable = true;

		break;
	case CAM_IFE_PIX_PATH_RES_IPP:
		path_data->crop_enable = true;
		break;
	case CAM_IFE_PIX_PATH_RES_PPP:
		path_data->crop_enable = false;
		break;
	default:
		rc = -EINVAL;
		goto end;
	}
	path_data->crop_enable = reserve->crop_enable;

	CAM_DBG(CAM_ISP,
		"Res id: %d height:%d line_start %d line_stop %d crop_en %d",
+2 −0
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ struct cam_isp_in_port_generic_info {
 * @cid:          cid (DT_ID) value for path, this is applicable for CSID path
 *                reserve
 * @node_res :    Reserved resource structure pointer
 * @crop_enable : Flag to indicate CSID crop enable
 *
 */
struct cam_csid_hw_reserve_resource_args {
@@ -125,6 +126,7 @@ struct cam_csid_hw_reserve_resource_args {
	uint32_t                                  master_idx;
	uint32_t                                  cid;
	struct cam_isp_resource_node             *node_res;
	bool                                      crop_enable;
};

/**