Sfoglia il codice sorgente

Merge "msm: camera: isp: Add 128 bit width support for RDI WM" into camera-kernel.lnx.5.0

Haritha Chintalapati 4 anni fa
parent
commit
0b2fea9e18

+ 1 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_hw/cam_tfe530.h

@@ -853,6 +853,7 @@ static struct cam_tfe_bus_hw_info  tfe530_bus_hw_info = {
 	},
 	.support_consumed_addr = true,
 	.pdaf_rdi2_mux_en = true,
+	.rdi_width = 64,
 };
 
 struct cam_tfe_hw_info cam_tfe530 = {

+ 1 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_hw/cam_tfe640.h

@@ -1168,6 +1168,7 @@ static struct cam_tfe_bus_hw_info  tfe640_bus_hw_info = {
 	},
 	.support_consumed_addr = true,
 	.pdaf_rdi2_mux_en = false,
+	.rdi_width = 128,
 };
 
 struct cam_tfe_hw_info cam_tfe640 = {

+ 17 - 13
drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_hw/cam_tfe_bus.c

@@ -71,6 +71,7 @@ struct cam_tfe_bus_common_data {
 	uint32_t                                    secure_mode;
 	uint32_t                                    num_sec_out;
 	uint32_t                                    comp_done_shift;
+	uint32_t                                    rdi_width;
 	bool                                        is_lite;
 	bool                                        support_consumed_addr;
 	cam_hw_mgr_event_cb_func                    event_cb;
@@ -552,12 +553,14 @@ static enum cam_tfe_bus_packer_format
 static int cam_tfe_bus_acquire_rdi_wm(
 	struct cam_tfe_bus_wm_resource_data  *rsrc_data)
 {
+	int rdi_width = rsrc_data->common_data->rdi_width;
 	switch (rsrc_data->format) {
 	case CAM_FORMAT_MIPI_RAW_6:
 		rsrc_data->pack_fmt = 0xA;
 		if (rsrc_data->mode == CAM_ISP_TFE_WM_LINE_BASED_MODE) {
 			rsrc_data->width =
-				ALIGNUP(rsrc_data->width * 6, 64) / 64;
+				ALIGNUP(rsrc_data->width * 6, rdi_width) /
+					rdi_width;
 			rsrc_data->en_cfg = 0x1;
 		} else {
 			rsrc_data->width =
@@ -573,8 +576,8 @@ static int cam_tfe_bus_acquire_rdi_wm(
 		rsrc_data->pack_fmt = 0xA;
 		if (rsrc_data->mode == CAM_ISP_TFE_WM_LINE_BASED_MODE) {
 			rsrc_data->width =
-				ALIGNUP(rsrc_data->width * 8, 64) / 64;
-
+				ALIGNUP(rsrc_data->width * 8, rdi_width) /
+					rdi_width;
 			rsrc_data->en_cfg = 0x1;
 		} else {
 			rsrc_data->width =
@@ -589,8 +592,8 @@ static int cam_tfe_bus_acquire_rdi_wm(
 		rsrc_data->pack_fmt = 0xA;
 		if (rsrc_data->mode == CAM_ISP_TFE_WM_LINE_BASED_MODE) {
 			rsrc_data->width =
-				ALIGNUP(rsrc_data->width * 10, 64) / 64;
-
+				ALIGNUP(rsrc_data->width * 10, rdi_width) /
+					rdi_width;
 			rsrc_data->en_cfg = 0x1;
 		} else {
 			rsrc_data->width =
@@ -605,8 +608,8 @@ static int cam_tfe_bus_acquire_rdi_wm(
 		rsrc_data->pack_fmt = 0xA;
 		if (rsrc_data->mode == CAM_ISP_TFE_WM_LINE_BASED_MODE) {
 			rsrc_data->width =
-				ALIGNUP(rsrc_data->width * 12, 64) / 64;
-
+				ALIGNUP(rsrc_data->width * 12, rdi_width) /
+					rdi_width;
 			rsrc_data->en_cfg = 0x1;
 		} else {
 			rsrc_data->width =
@@ -621,8 +624,8 @@ static int cam_tfe_bus_acquire_rdi_wm(
 		rsrc_data->pack_fmt = 0xA;
 		if (rsrc_data->mode == CAM_ISP_TFE_WM_LINE_BASED_MODE) {
 			rsrc_data->width =
-				ALIGNUP(rsrc_data->width * 14, 64) / 64;
-
+				ALIGNUP(rsrc_data->width * 14, rdi_width) /
+					rdi_width;
 			rsrc_data->en_cfg = 0x1;
 		} else {
 			rsrc_data->width =
@@ -641,8 +644,8 @@ static int cam_tfe_bus_acquire_rdi_wm(
 		rsrc_data->pack_fmt = 0xA;
 		if (rsrc_data->mode == CAM_ISP_TFE_WM_LINE_BASED_MODE) {
 			rsrc_data->width =
-				ALIGNUP(rsrc_data->width * 16, 64) / 64;
-
+				ALIGNUP(rsrc_data->width * 16, rdi_width) /
+					rdi_width;
 			rsrc_data->en_cfg = 0x1;
 		} else {
 			rsrc_data->width =
@@ -659,8 +662,8 @@ static int cam_tfe_bus_acquire_rdi_wm(
 		rsrc_data->pack_fmt = 0xA;
 		if (rsrc_data->mode == CAM_ISP_TFE_WM_LINE_BASED_MODE) {
 			rsrc_data->width =
-				ALIGNUP(rsrc_data->width * 64, 64) / 64;
-
+				ALIGNUP(rsrc_data->width * 64, rdi_width) /
+					rdi_width;
 			rsrc_data->en_cfg = 0x1;
 		} else {
 			rsrc_data->width =
@@ -2505,6 +2508,7 @@ int cam_tfe_bus_init(
 	bus_priv->common_data.support_consumed_addr =
 		hw_info->support_consumed_addr;
 	bus_priv->common_data.pdaf_rdi2_mux_en = hw_info->pdaf_rdi2_mux_en;
+	bus_priv->common_data.rdi_width = hw_info->rdi_width;
 
 	for (i = 0; i < CAM_TFE_BUS_IRQ_REGISTERS_MAX; i++)
 		bus_priv->bus_irq_error_mask[i] =

+ 2 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_hw/cam_tfe_bus.h

@@ -191,6 +191,7 @@ struct cam_tfe_bus_tfe_out_hw_info {
  * @comp_buf_done_mask:    Composite buf done bits mask
  * @comp_rup_done_mask:    Reg update done mask
  * @bus_irq_error_mask:    Bus irq error mask bits
+ * @rdi_width:             RDI WM width
  * @support_consumed_addr: Indicate if bus support consumed address
  * @pdaf_rdi2_mux_en:      Indicate is PDAF is muxed with RDI2
  */
@@ -208,6 +209,7 @@ struct cam_tfe_bus_hw_info {
 	uint32_t comp_buf_done_mask;
 	uint32_t comp_rup_done_mask;
 	uint32_t bus_irq_error_mask[CAM_TFE_BUS_IRQ_REGISTERS_MAX];
+	uint32_t rdi_width;
 	bool support_consumed_addr;
 	bool pdaf_rdi2_mux_en;
 };