|
@@ -46,13 +46,16 @@
|
|
|
|
|
|
#define ICP_CLK_HW_IPE 0x0
|
|
#define ICP_CLK_HW_IPE 0x0
|
|
#define ICP_CLK_HW_BPS 0x1
|
|
#define ICP_CLK_HW_BPS 0x1
|
|
-#define ICP_CLK_HW_MAX 0x2
|
|
|
|
|
|
+#define ICP_CLK_HW_OFE 0x2
|
|
|
|
+#define ICP_DEV_CLK_MAX 0x3
|
|
|
|
|
|
#define ICP_OVER_CLK_THRESHOLD 5
|
|
#define ICP_OVER_CLK_THRESHOLD 5
|
|
|
|
+#define ICP_TWO_DEV_BW_SHARE_RATIO 2
|
|
|
|
|
|
#define CPAS_IPE0_BIT 0x1000
|
|
#define CPAS_IPE0_BIT 0x1000
|
|
#define CPAS_IPE1_BIT 0x2000
|
|
#define CPAS_IPE1_BIT 0x2000
|
|
#define CPAS_BPS_BIT 0x400
|
|
#define CPAS_BPS_BIT 0x400
|
|
|
|
+#define CPAS_ICP_BIT 0x1
|
|
|
|
|
|
/* Used for targets >= 480 and its variants */
|
|
/* Used for targets >= 480 and its variants */
|
|
#define CPAS_TITAN_IPE0_CAP_BIT 0x800
|
|
#define CPAS_TITAN_IPE0_CAP_BIT 0x800
|
|
@@ -60,6 +63,7 @@
|
|
#define ICP_PWR_CLP_BPS 0x00000001
|
|
#define ICP_PWR_CLP_BPS 0x00000001
|
|
#define ICP_PWR_CLP_IPE0 0x00010000
|
|
#define ICP_PWR_CLP_IPE0 0x00010000
|
|
#define ICP_PWR_CLP_IPE1 0x00020000
|
|
#define ICP_PWR_CLP_IPE1 0x00020000
|
|
|
|
+#define ICP_PWR_CLP_OFE 0x00000001
|
|
|
|
|
|
#define CAM_ICP_CTX_STATE_FREE 0x0
|
|
#define CAM_ICP_CTX_STATE_FREE 0x0
|
|
#define CAM_ICP_CTX_STATE_IN_USE 0x1
|
|
#define CAM_ICP_CTX_STATE_IN_USE 0x1
|
|
@@ -73,6 +77,22 @@
|
|
|
|
|
|
#define CAM_ICP_HW_MGR_NAME_SIZE 32
|
|
#define CAM_ICP_HW_MGR_NAME_SIZE 32
|
|
|
|
|
|
|
|
+#define CAM_ICP_GET_HW_DEV_TYPE_FROM_HW_CLK_TYPE(hw_clk_type) \
|
|
|
|
+({ \
|
|
|
|
+ (hw_clk_type) + (CAM_ICP_DEV_START_IDX); \
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+#define CAM_ICP_GET_HW_CLK_TYPE_FROM_HW_DEV_TYPE(hw_dev_type) \
|
|
|
|
+({ \
|
|
|
|
+ (hw_dev_type) - (CAM_ICP_DEV_START_IDX); \
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+#define CAM_ICP_GET_DEV_INFO_IDX(hw_dev_type) ((hw_dev_type) - (CAM_ICP_DEV_START_IDX))
|
|
|
|
+#define CAM_ICP_IS_DEV_HW_EXIST(hw_cap_mask, hw_dev_type) \
|
|
|
|
+({ \
|
|
|
|
+ (hw_cap_mask) & BIT((hw_dev_type)); \
|
|
|
|
+})
|
|
|
|
+
|
|
struct hfi_mini_dump_info;
|
|
struct hfi_mini_dump_info;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -205,6 +225,18 @@ struct cam_icp_ctx_perf_stats {
|
|
uint64_t total_requests;
|
|
uint64_t total_requests;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * struct cam_icp_hw_ctx_dev_info -
|
|
|
|
+ * Info of ICP devices (IPE/BPS/OFE) that can be attached to a context
|
|
|
|
+ *
|
|
|
|
+ * @dev_ctxt_cnt : device context count
|
|
|
|
+ * @dev_clk_state: device clock state
|
|
|
|
+ */
|
|
|
|
+struct cam_icp_hw_ctx_dev_info {
|
|
|
|
+ uint32_t dev_ctxt_cnt;
|
|
|
|
+ bool dev_clk_state;
|
|
|
|
+};
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* struct hfi_frame_process_info
|
|
* struct hfi_frame_process_info
|
|
* @hfi_frame_cmd: Frame process command info
|
|
* @hfi_frame_cmd: Frame process command info
|
|
@@ -290,8 +322,8 @@ struct cam_ctx_clk_info {
|
|
* @last_flush_req: last flush req for this ctx
|
|
* @last_flush_req: last flush req for this ctx
|
|
* @perf_stats: performance statistics info
|
|
* @perf_stats: performance statistics info
|
|
* @evt_inject_params: Event injection data for hw_mgr_ctx
|
|
* @evt_inject_params: Event injection data for hw_mgr_ctx
|
|
- * @unified_dev_type: Unified dev type which does not hold any priority info.
|
|
|
|
- * It's either IPE/BPS
|
|
|
|
|
|
+ * @hw_dev_type: hardware device type of this context
|
|
|
|
+ * @hw_clk_type: hardware clock type for this context
|
|
* @abort_timed_out: Indicates if abort timed out
|
|
* @abort_timed_out: Indicates if abort timed out
|
|
*/
|
|
*/
|
|
struct cam_icp_hw_ctx_data {
|
|
struct cam_icp_hw_ctx_data {
|
|
@@ -308,7 +340,7 @@ struct cam_icp_hw_ctx_data {
|
|
struct cam_icp_hw_ctx_data *chain_ctx;
|
|
struct cam_icp_hw_ctx_data *chain_ctx;
|
|
struct hfi_frame_process_info hfi_frame_process;
|
|
struct hfi_frame_process_info hfi_frame_process;
|
|
struct completion wait_complete;
|
|
struct completion wait_complete;
|
|
- struct icp_dev_destroy temp_payload;
|
|
|
|
|
|
+ struct hfi_cmd_destroy temp_payload;
|
|
uint32_t ctx_id;
|
|
uint32_t ctx_id;
|
|
uint32_t bw_config_version;
|
|
uint32_t bw_config_version;
|
|
struct cam_ctx_clk_info clk_info;
|
|
struct cam_ctx_clk_info clk_info;
|
|
@@ -319,7 +351,8 @@ struct cam_icp_hw_ctx_data {
|
|
char ctx_id_string[128];
|
|
char ctx_id_string[128];
|
|
struct cam_icp_ctx_perf_stats perf_stats;
|
|
struct cam_icp_ctx_perf_stats perf_stats;
|
|
struct cam_hw_inject_evt_param evt_inject_params;
|
|
struct cam_hw_inject_evt_param evt_inject_params;
|
|
- uint32_t unified_dev_type;
|
|
|
|
|
|
+ uint32_t hw_dev_type;
|
|
|
|
+ uint32_t hw_clk_type;
|
|
bool abort_timed_out;
|
|
bool abort_timed_out;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -372,6 +405,8 @@ struct cam_icp_clk_info {
|
|
* @hw_mgr_mutex: Mutex for ICP hardware manager
|
|
* @hw_mgr_mutex: Mutex for ICP hardware manager
|
|
* @hw_mgr_lock: Spinlock for ICP hardware manager
|
|
* @hw_mgr_lock: Spinlock for ICP hardware manager
|
|
* @devices: Devices of ICP hardware manager
|
|
* @devices: Devices of ICP hardware manager
|
|
|
|
+ * @icp_dev_intf: ICP device interface
|
|
|
|
+ * @hw_dev_cnt: count number of each hw type
|
|
* @ctx_data: Context data
|
|
* @ctx_data: Context data
|
|
* @icp_caps: ICP capabilities
|
|
* @icp_caps: ICP capabilities
|
|
* @mini_dump_cb: Mini dump cb
|
|
* @mini_dump_cb: Mini dump cb
|
|
@@ -392,8 +427,6 @@ struct cam_icp_clk_info {
|
|
* @msg_work_data: Pointer to message work queue task
|
|
* @msg_work_data: Pointer to message work queue task
|
|
* @timer_work_data: Pointer to timer work queue task
|
|
* @timer_work_data: Pointer to timer work queue task
|
|
* @ctxt_cnt: Active context count
|
|
* @ctxt_cnt: Active context count
|
|
- * @ipe_ctxt_cnt: IPE Active context count
|
|
|
|
- * @bps_ctxt_cnt: BPS Active context count
|
|
|
|
* @dentry: Debugfs entry
|
|
* @dentry: Debugfs entry
|
|
* @icp_pc_flag: Flag to enable/disable power collapse
|
|
* @icp_pc_flag: Flag to enable/disable power collapse
|
|
* @dev_pc_flag: Flag to enable/disable
|
|
* @dev_pc_flag: Flag to enable/disable
|
|
@@ -408,15 +441,7 @@ struct cam_icp_clk_info {
|
|
* @icp_dbg_lvl : debug level set to FW.
|
|
* @icp_dbg_lvl : debug level set to FW.
|
|
* @icp_fw_dump_lvl : level set for dumping the FW data
|
|
* @icp_fw_dump_lvl : level set for dumping the FW data
|
|
* @icp_fw_ramdump_lvl : level set for FW ram dumps
|
|
* @icp_fw_ramdump_lvl : level set for FW ram dumps
|
|
- * @ipe0_enable: Flag for IPE0
|
|
|
|
- * @ipe1_enable: Flag for IPE1
|
|
|
|
- * @bps_enable: Flag for BPS
|
|
|
|
- * @icp_dev_intf : Device interface for ICP
|
|
|
|
- * @ipe0_dev_intf: Device interface for IPE0
|
|
|
|
- * @ipe1_dev_intf: Device interface for IPE1
|
|
|
|
- * @bps_dev_intf: Device interface for BPS
|
|
|
|
- * @ipe_clk_state: IPE clock state flag
|
|
|
|
- * @bps_clk_state: BPS clock state flag
|
|
|
|
|
|
+ * @dev_info: book keeping info relevant to devices
|
|
* @disable_ubwc_comp: Disable UBWC compression
|
|
* @disable_ubwc_comp: Disable UBWC compression
|
|
* @recovery: Flag to validate if in previous session FW
|
|
* @recovery: Flag to validate if in previous session FW
|
|
* reported a fatal error or wdt. If set FW is
|
|
* reported a fatal error or wdt. If set FW is
|
|
@@ -425,12 +450,16 @@ struct cam_icp_clk_info {
|
|
* @frame_in_process_ctx_id: Contxt id processing frame
|
|
* @frame_in_process_ctx_id: Contxt id processing frame
|
|
* @synx_signaling_en: core to core fencing is enabled
|
|
* @synx_signaling_en: core to core fencing is enabled
|
|
* using synx
|
|
* using synx
|
|
|
|
+ * @hw_cap_mask: device capability mask to indicate which devices type
|
|
|
|
+ * are available in this hw mgr
|
|
*/
|
|
*/
|
|
struct cam_icp_hw_mgr {
|
|
struct cam_icp_hw_mgr {
|
|
struct mutex hw_mgr_mutex;
|
|
struct mutex hw_mgr_mutex;
|
|
spinlock_t hw_mgr_lock;
|
|
spinlock_t hw_mgr_lock;
|
|
|
|
|
|
- struct cam_hw_intf **devices[CAM_ICP_DEV_MAX];
|
|
|
|
|
|
+ struct cam_hw_intf **devices[CAM_ICP_HW_MAX];
|
|
|
|
+ struct cam_hw_intf *icp_dev_intf;
|
|
|
|
+ uint32_t hw_dev_cnt[CAM_ICP_HW_MAX];
|
|
struct cam_icp_hw_ctx_data ctx_data[CAM_ICP_CTX_MAX];
|
|
struct cam_icp_hw_ctx_data ctx_data[CAM_ICP_CTX_MAX];
|
|
struct cam_icp_query_cap_cmd icp_caps;
|
|
struct cam_icp_query_cap_cmd icp_caps;
|
|
cam_icp_mini_dump_cb mini_dump_cb;
|
|
cam_icp_mini_dump_cb mini_dump_cb;
|
|
@@ -452,36 +481,27 @@ struct cam_icp_hw_mgr {
|
|
struct hfi_msg_work_data *msg_work_data;
|
|
struct hfi_msg_work_data *msg_work_data;
|
|
struct hfi_msg_work_data *timer_work_data;
|
|
struct hfi_msg_work_data *timer_work_data;
|
|
uint32_t ctxt_cnt;
|
|
uint32_t ctxt_cnt;
|
|
- uint32_t ipe_ctxt_cnt;
|
|
|
|
- uint32_t bps_ctxt_cnt;
|
|
|
|
struct dentry *dentry;
|
|
struct dentry *dentry;
|
|
bool icp_pc_flag;
|
|
bool icp_pc_flag;
|
|
bool dev_pc_flag;
|
|
bool dev_pc_flag;
|
|
bool icp_use_pil;
|
|
bool icp_use_pil;
|
|
uint64_t icp_debug_clk;
|
|
uint64_t icp_debug_clk;
|
|
uint64_t icp_default_clk;
|
|
uint64_t icp_default_clk;
|
|
- struct cam_icp_clk_info clk_info[ICP_CLK_HW_MAX];
|
|
|
|
|
|
+ struct cam_icp_clk_info clk_info[ICP_DEV_CLK_MAX];
|
|
uint32_t secure_mode;
|
|
uint32_t secure_mode;
|
|
bool icp_jtag_debug;
|
|
bool icp_jtag_debug;
|
|
u64 icp_debug_type;
|
|
u64 icp_debug_type;
|
|
u64 icp_dbg_lvl;
|
|
u64 icp_dbg_lvl;
|
|
u64 icp_fw_dump_lvl;
|
|
u64 icp_fw_dump_lvl;
|
|
u32 icp_fw_ramdump_lvl;
|
|
u32 icp_fw_ramdump_lvl;
|
|
- bool ipe0_enable;
|
|
|
|
- bool ipe1_enable;
|
|
|
|
- bool bps_enable;
|
|
|
|
- struct cam_hw_intf *icp_dev_intf;
|
|
|
|
- struct cam_hw_intf *ipe0_dev_intf;
|
|
|
|
- struct cam_hw_intf *ipe1_dev_intf;
|
|
|
|
- struct cam_hw_intf *bps_dev_intf;
|
|
|
|
- bool ipe_clk_state;
|
|
|
|
- bool bps_clk_state;
|
|
|
|
|
|
+ struct cam_icp_hw_ctx_dev_info dev_info[CAM_ICP_DEV_NUM];
|
|
bool disable_ubwc_comp;
|
|
bool disable_ubwc_comp;
|
|
atomic_t recovery;
|
|
atomic_t recovery;
|
|
uint64_t icp_svs_clk;
|
|
uint64_t icp_svs_clk;
|
|
atomic_t frame_in_process;
|
|
atomic_t frame_in_process;
|
|
int frame_in_process_ctx_id;
|
|
int frame_in_process_ctx_id;
|
|
bool synx_signaling_en;
|
|
bool synx_signaling_en;
|
|
|
|
+ uint32_t hw_cap_mask;
|
|
};
|
|
};
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -543,16 +563,12 @@ struct cam_icp_hw_ctx_mini_dump {
|
|
* @ctx: Context for minidump
|
|
* @ctx: Context for minidump
|
|
* @hfi_info: hfi info
|
|
* @hfi_info: hfi info
|
|
* @hfi_mem_info: hfi mem info
|
|
* @hfi_mem_info: hfi mem info
|
|
|
|
+ * @dev_info: book keeping info relevant to devices
|
|
* @fw_img: FW image
|
|
* @fw_img: FW image
|
|
* @recovery: To indicate if recovery is on
|
|
* @recovery: To indicate if recovery is on
|
|
* @icp_booted: Indicate if ICP is booted
|
|
* @icp_booted: Indicate if ICP is booted
|
|
* @icp_resumed: Indicate if ICP is resumed
|
|
* @icp_resumed: Indicate if ICP is resumed
|
|
- * @ipe_clk_state: IPE Clk state
|
|
|
|
- * @bps_clk_state: BPS clk state
|
|
|
|
* @disable_ubwc_comp: Indicate if ubws comp is disabled
|
|
* @disable_ubwc_comp: Indicate if ubws comp is disabled
|
|
- * @ipe0_enable: Is IPE0 enabled
|
|
|
|
- * @ipe1_enable: Is IPE1 enabled
|
|
|
|
- * @bps_enable: Is BPS enabled
|
|
|
|
* @icp_pc_flag: Is ICP PC enabled
|
|
* @icp_pc_flag: Is ICP PC enabled
|
|
* @dev_pc_flag: Is IPE BPS PC enabled
|
|
* @dev_pc_flag: Is IPE BPS PC enabled
|
|
* @icp_use_pil: Is PIL used
|
|
* @icp_use_pil: Is PIL used
|
|
@@ -561,17 +577,13 @@ struct cam_icp_hw_mini_dump_info {
|
|
struct cam_icp_hw_ctx_mini_dump *ctx[CAM_ICP_CTX_MAX];
|
|
struct cam_icp_hw_ctx_mini_dump *ctx[CAM_ICP_CTX_MAX];
|
|
struct hfi_mini_dump_info hfi_info;
|
|
struct hfi_mini_dump_info hfi_info;
|
|
struct icp_hfi_mem_info hfi_mem_info;
|
|
struct icp_hfi_mem_info hfi_mem_info;
|
|
|
|
+ struct cam_icp_hw_ctx_dev_info dev_info[CAM_ICP_DEV_NUM];
|
|
void *fw_img;
|
|
void *fw_img;
|
|
uint32_t recovery;
|
|
uint32_t recovery;
|
|
uint32_t num_context;
|
|
uint32_t num_context;
|
|
bool icp_booted;
|
|
bool icp_booted;
|
|
bool icp_resumed;
|
|
bool icp_resumed;
|
|
- bool ipe_clk_state;
|
|
|
|
- bool bps_clk_state;
|
|
|
|
bool disable_ubwc_comp;
|
|
bool disable_ubwc_comp;
|
|
- bool ipe0_enable;
|
|
|
|
- bool ipe1_enable;
|
|
|
|
- bool bps_enable;
|
|
|
|
bool icp_pc_flag;
|
|
bool icp_pc_flag;
|
|
bool dev_pc_flag;
|
|
bool dev_pc_flag;
|
|
bool icp_use_pil;
|
|
bool icp_use_pil;
|