Jelajahi Sumber

Merge "msm: camera: isp: Move packer format alignment value to header" into camera-kernel.lnx.5.0

Savita Patted 4 tahun lalu
induk
melakukan
196e9543f7

+ 2 - 1
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe480.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
  */
 
 
@@ -1437,6 +1437,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe480_bus_hw_info = {
 	.max_out_res = CAM_ISP_IFE_OUT_RES_BASE + 25,
 	.supported_irq =  CAM_VFE_HW_IRQ_CAP_BUF_DONE | CAM_VFE_HW_IRQ_CAP_RUP,
 	.comp_cfg_needed = true,
+	.pack_align_shift = 4,
 };
 
 static struct cam_irq_register_set vfe480_bus_rd_irq_reg[1] = {

+ 1 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe680.h

@@ -1776,6 +1776,7 @@ static struct cam_vfe_bus_ver3_hw_info vfe680_bus_hw_info = {
 	.comp_done_shift = 0,
 	.top_irq_shift   = 1,
 	.max_out_res = CAM_ISP_IFE_OUT_RES_BASE + 33,
+	.pack_align_shift = 5,
 };
 
 static struct cam_vfe_irq_hw_info vfe680_irq_hw_info = {

+ 8 - 2
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.c

@@ -108,6 +108,7 @@ struct cam_vfe_bus_ver3_common_data {
 	bool                                        init_irq_subscribed;
 	cam_hw_mgr_event_cb_func                    event_cb;
 	int                        rup_irq_handle[CAM_VFE_BUS_VER3_SRC_GRP_MAX];
+	uint32_t                                    pack_align_shift;
 };
 
 struct cam_vfe_bus_ver3_wm_resource_data {
@@ -1164,7 +1165,8 @@ static int cam_vfe_bus_ver3_acquire_wm(
 		rsrc_data->stride = rsrc_data->width;
 		rsrc_data->en_cfg = 0x1;
 		/* LSB aligned */
-		rsrc_data->pack_fmt |= 0x10;
+		rsrc_data->pack_fmt |= (1 <<
+				ver3_bus_priv->common_data.pack_align_shift);
 
 	} else if ((vfe_out_res_id == CAM_VFE_BUS_VER3_VFE_OUT_FULL) ||
 		(vfe_out_res_id == CAM_VFE_BUS_VER3_VFE_OUT_FD) ||
@@ -1271,7 +1273,9 @@ static int cam_vfe_bus_ver3_acquire_wm(
 			rsrc_data->stride = ALIGNUP(rsrc_data->width * 2, 8);
 			rsrc_data->en_cfg = 0x1;
 			/* LSB aligned */
-			rsrc_data->pack_fmt |= 0x10;
+			rsrc_data->pack_fmt |= (1 <<
+				ver3_bus_priv->common_data.pack_align_shift);
+
 			break;
 		default:
 			CAM_ERR(CAM_ISP, "Invalid format %d out_type:%d",
@@ -3860,6 +3864,8 @@ int cam_vfe_bus_ver3_init(
 	bus_priv->common_data.comp_config_needed =
 		ver3_hw_info->comp_cfg_needed;
 	bus_priv->common_data.init_irq_subscribed = false;
+	bus_priv->common_data.pack_align_shift =
+		ver3_hw_info->pack_align_shift;
 
 	if (bus_priv->num_out >= CAM_VFE_BUS_VER3_VFE_OUT_MAX) {
 		CAM_ERR(CAM_ISP, "number of vfe out:%d more than max value:%d ",

+ 2 - 0
drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.h

@@ -196,6 +196,7 @@ struct cam_vfe_bus_ver3_vfe_out_hw_info {
  * @max_out_res:           Max vfe out resource value supported for hw
  * @supported_irq:         Mask to indicate the IRQ supported
  * @comp_cfg_needed:       Composite group config is needed for hw
+ * @pack_align_shift:      Shift value for alignment of packer format
  */
 struct cam_vfe_bus_ver3_hw_info {
 	struct cam_vfe_bus_ver3_reg_offset_common common_reg;
@@ -212,6 +213,7 @@ struct cam_vfe_bus_ver3_hw_info {
 	uint32_t max_out_res;
 	uint32_t supported_irq;
 	bool comp_cfg_needed;
+	uint32_t pack_align_shift;
 };
 
 /*