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

Commit 78dde1cb 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 camif raw path output format support"

parents fd64e02a 9bfbd22d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -722,7 +722,6 @@ struct vfe_device {
	uint32_t isp_raw0_debug;
	uint32_t isp_raw1_debug;
	uint32_t isp_raw2_debug;
	uint8_t is_camif_raw_crop_supported;

	/* irq info */
	uint32_t irq0_mask;
+37 −39
Original line number Diff line number Diff line
@@ -433,8 +433,6 @@ static void msm_vfe40_init_hardware_reg(struct vfe_device *vfe_dev)
		break;
	case VFE40_8937_VERSION:
	case VFE40_8953_VERSION:
		vfe_dev->is_camif_raw_crop_supported = 1;
		break;
	default:
		ISP_DBG("%s: No special QOS\n", __func__);
	}
@@ -1400,24 +1398,6 @@ static void msm_vfe40_cfg_camif(struct vfe_device *vfe_dev,
		msm_camera_io_w((subsample_cfg->line_skip << 16) |
			subsample_cfg->pixel_skip,
			vfe_dev->vfe_base + 0x30C);
			if (vfe_dev->is_camif_raw_crop_supported) {
				/* Pdaf output will be sent in PLAIN16 format*/
				val = msm_camera_io_r(vfe_dev->vfe_base + 0x54);
				switch (subsample_cfg->output_format) {
				case CAMIF_PLAIN_8:
					val |= 4 << 9;
					break;
				case CAMIF_PLAIN_16:
					val |= 5 << 9;
					break;
				case CAMIF_MIPI_RAW:
					val |= 1 << 9;
					break;
				case CAMIF_QCOM_RAW:
				default:
					break;
				}
				msm_camera_io_w(val, vfe_dev->vfe_base + 0x54);
		if (subsample_cfg->first_pixel ||
			subsample_cfg->last_pixel ||
			subsample_cfg->first_line ||
@@ -1436,8 +1416,26 @@ static void msm_vfe40_cfg_camif(struct vfe_device *vfe_dev,
			msm_camera_io_w(val,
				vfe_dev->vfe_base + 0x2F8);
		}
			}

		ISP_DBG("%s:camif raw op fmt %d\n",
			__func__, subsample_cfg->output_format);
		/* Pdaf output will be sent in PLAIN16 format*/
		val = msm_camera_io_r(vfe_dev->vfe_base + 0x54);
		switch (subsample_cfg->output_format) {
		case CAMIF_PLAIN_8:
			val |= 4 << 9;
			break;
		case CAMIF_PLAIN_16:
			val |= 5 << 9;
			break;
		case CAMIF_MIPI_RAW:
			val |= 1 << 9;
			break;
		case CAMIF_QCOM_RAW:
		default:
			break;
		}
		msm_camera_io_w(val, vfe_dev->vfe_base + 0x54);
	}
}

+42 −0
Original line number Diff line number Diff line
@@ -1317,6 +1317,48 @@ static void msm_vfe47_cfg_camif(struct vfe_device *vfe_dev,
		msm_camera_io_w(0xFFFFFFFF, vfe_dev->vfe_base + 0x49C);
	}

	if (subsample_cfg->first_pixel ||
		subsample_cfg->last_pixel ||
		subsample_cfg->first_line ||
		subsample_cfg->last_line) {
		msm_camera_io_w(
		subsample_cfg->first_pixel << 16 |
			subsample_cfg->last_pixel,
			vfe_dev->vfe_base + 0xCE4);
		msm_camera_io_w(
		subsample_cfg->first_line << 16 |
			subsample_cfg->last_line,
			vfe_dev->vfe_base + 0xCE4);
		val = msm_camera_io_r(
			vfe_dev->vfe_base + 0x47C);
		ISP_DBG("%s: camif raw crop enabled\n", __func__);
		val |= 1 << 22;
		msm_camera_io_w(val,
			vfe_dev->vfe_base + 0x47C);
	}

	ISP_DBG("%s: camif raw op fmt %d\n",
		__func__, subsample_cfg->output_format);
	/* Pdaf output can be sent in below formats */
	val = msm_camera_io_r(vfe_dev->vfe_base + 0x88);
	switch (subsample_cfg->output_format) {
	case CAMIF_PLAIN_8:
		val |= PLAIN8 << 9;
		break;
	case CAMIF_PLAIN_16:
		val |= PLAIN16 << 9;
		break;
	case CAMIF_MIPI_RAW:
		val |= MIPI << 9;
		break;
	case CAMIF_QCOM_RAW:
		val |= QCOM << 9;
		break;
	default:
		break;
	}
	msm_camera_io_w(val, vfe_dev->vfe_base + 0x88);

	val = msm_camera_io_r(vfe_dev->vfe_base + 0x46C);
	val |= camif_cfg->camif_input;
	msm_camera_io_w(val, vfe_dev->vfe_base + 0x46C);