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

Commit 9ef77e44 authored by Camera Software Integration's avatar Camera Software Integration Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: isp: Add support for SFE HW layer in ISP driver" into camera-kernel.lnx.4.0

parents 50f5e56d 1232bfaa
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (c) 2020, The Linux Foundation. All rights reserved.

export CONFIG_SPECTRA_CAMERA=m

export CONFIG_SPECTRA_ISP=y
export CONFIG_SPECTRA_SFE=y
export CONFIG_SPECTRA_SENSOR=y
export CONFIG_SPECTRA_ICP=y
export CONFIG_SPECTRA_JPEG=y
+11 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2020, The Linux Foundation. All rights reserved.
 */

#define CONFIG_SPECTRA_CAMERA 1
#define CONFIG_SPECTRA_ISP    1
#define CONFIG_SPECTRA_SFE    1
#define CONFIG_SPECTRA_SENSOR 1
#define CONFIG_SPECTRA_ICP    1
#define CONFIG_SPECTRA_JPEG   1
+7 −5
Original line number Diff line number Diff line
@@ -85,6 +85,13 @@ camera-$(CONFIG_SPECTRA_ISP) += \
	cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_fe_ver1.o \
	cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_camif_lite_ver3.o \
	cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe.o \
	cam_isp/isp_hw_mgr/isp_hw/sfe_hw/cam_sfe_soc.o \
	cam_isp/isp_hw_mgr/isp_hw/sfe_hw/cam_sfe_dev.o \
	cam_isp/isp_hw_mgr/isp_hw/sfe_hw/cam_sfe_core.o \
	cam_isp/isp_hw_mgr/isp_hw/sfe_hw/sfe_top/cam_sfe_top.o \
	cam_isp/isp_hw_mgr/isp_hw/sfe_hw/sfe_bus/cam_sfe_bus.o \
	cam_isp/isp_hw_mgr/isp_hw/sfe_hw/sfe_bus/cam_sfe_bus_rd.o \
	cam_isp/isp_hw_mgr/isp_hw/sfe_hw/sfe_bus/cam_sfe_bus_wr.o \
	cam_isp/isp_hw_mgr/isp_hw/top_tpg/cam_top_tpg_dev.o \
	cam_isp/isp_hw_mgr/isp_hw/top_tpg/cam_top_tpg_soc.o \
	cam_isp/isp_hw_mgr/isp_hw/top_tpg/cam_top_tpg_core.o \
@@ -97,11 +104,6 @@ camera-$(CONFIG_SPECTRA_ISP) += \
	cam_isp/cam_isp_dev.o \
	cam_isp/cam_isp_context.o

camera-$(CONFIG_SPECTRA_SFE) += \
	cam_isp/isp_hw_mgr/isp_hw/sfe_hw/cam_sfe_soc.o \
	cam_isp/isp_hw_mgr/isp_hw/sfe_hw/cam_sfe_dev.o \
	cam_isp/isp_hw_mgr/isp_hw/sfe_hw/cam_sfe_core.o

camera-$(CONFIG_SPECTRA_ICP) += \
	cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.o \
	cam_icp/icp_hw/ipe_hw/ipe_dev.o \
+18 −4
Original line number Diff line number Diff line
@@ -86,6 +86,9 @@ enum cam_isp_resource_type {
	CAM_ISP_RESOURCE_TPG,
	CAM_ISP_RESOURCE_TFE_IN,
	CAM_ISP_RESOURCE_TFE_OUT,
	CAM_ISP_RESOURCE_SFE_IN,
	CAM_ISP_RESOURCE_SFE_RD,
	CAM_ISP_RESOURCE_SFE_OUT,
	CAM_ISP_RESOURCE_MAX,
};

@@ -131,6 +134,7 @@ enum cam_isp_hw_cmd_type {
	CAM_ISP_HW_CMD_TPG_CORE_CFG_CMD,
	CAM_ISP_HW_CMD_CSID_CHANGE_HALT_MODE,
	CAM_ISP_HW_CMD_DISABLE_UBWC_COMP,
	CAM_ISP_HW_CMD_SET_SFE_DEBUG_CFG,
	CAM_ISP_HW_CMD_MAX,
};

@@ -245,6 +249,10 @@ struct cam_isp_hw_cmd_buf_update {
 * @ num_buf:          Number of buffers in the image_buf array
 * @ frame_header:     frame header iova
 * @ local_id:         local id for the wm
 * @ width:            width of scratch buffer
 * @ height:           height of scratch buffer
 * @ stride:           stride of scratch buffer
 * @ slice_height:     slice height of scratch buffer
 * @ io_cfg:           IO buffer config information sent from UMD
 *
 */
@@ -254,6 +262,10 @@ struct cam_isp_hw_get_wm_update {
	uint32_t                        num_buf;
	uint64_t                        frame_header;
	uint32_t                        local_id;
	uint32_t                        width;
	uint32_t                        height;
	uint32_t                        stride;
	uint32_t                        slice_height;
	struct cam_buf_io_cfg          *io_cfg;
};

@@ -280,6 +292,7 @@ struct cam_isp_hw_get_res_for_mid {
 * @cmd_type:        Command type for which to get update
 * @cdm_id:          CDM id
 * @cmd:             Command buffer information
 * @use_scratch_cfg: To indicate if it's scratch buffer config
 *
 */
struct cam_isp_hw_get_cmd_update {
@@ -287,6 +300,7 @@ struct cam_isp_hw_get_cmd_update {
	enum cam_isp_hw_cmd_type          cmd_type;
	enum cam_cdm_id                   cdm_id;
	struct cam_isp_hw_cmd_buf_update  cmd;
	bool                              use_scratch_cfg;
	union {
		void                                 *data;
		struct cam_isp_hw_get_wm_update      *wm_update;
+87 −8
Original line number Diff line number Diff line
@@ -8,8 +8,9 @@

#include "cam_isp_hw.h"

#define CAM_SFE_HW_NUM_MAX            2
#define SFE_CORE_BASE_IDX           0
#define SFE_RT_CDM_BASE_IDX         1
#define CAM_SFE_HW_NUM_MAX          2

enum cam_isp_hw_sfe_in {
	CAM_ISP_HW_SFE_IN_PIX,
@@ -32,6 +33,86 @@ enum cam_sfe_hw_irq_status {
	CAM_SFE_IRQ_STATUS_MAX,
};

enum cam_sfe_bw_control_action {
	CAM_SFE_BW_CONTROL_EXCLUDE,
	CAM_SFE_BW_CONTROL_INCLUDE,
};

enum cam_sfe_hw_irq_regs {
	CAM_SFE_IRQ_TOP_REG_STATUS0,
	CAM_SFE_IRQ_REGISTERS_MAX,
};

enum cam_sfe_bus_irq_regs {
	CAM_SFE_IRQ_BUS_REG_STATUS0,
	CAM_SFE_BUS_IRQ_REGISTERS_MAX,
};

/*
 * struct cam_sfe_fe_update_args:
 *
 * @node_res:             Resource to get fetch configuration
 * @fe_config:            fetch engine configuration
 *
 */
struct cam_sfe_fe_update_args {
	struct cam_isp_resource_node      *node_res;
	struct cam_fe_config               fe_config;
};

/*
 * struct cam_sfe_clock_update_args:
 *
 * @node_res:                ISP Resource
 * @clk_rate:                Clock rate requested
 */
struct cam_sfe_clock_update_args {
	struct cam_isp_resource_node      *node_res;
	uint64_t                           clk_rate;
};

/*
 * struct cam_sfe_core_config_args:
 *
 * @node_res:                ISP Resource
 * @core_config:             Core config for SFE
 */
struct cam_sfe_core_config_args {
	struct cam_isp_resource_node      *node_res;
	struct cam_isp_sfe_core_config     core_config;
};

/*
 * struct cam_sfe_irq_evt_payload:
 *
 * @Brief:                   This structure is used to save payload for IRQ
 *                           related to SFE resources
 *
 * @list:                    list_head node for the payload
 * @core_index:              Index of SFE HW that generated this IRQ event
 * @evt_id:                  IRQ event
 * @irq_reg_val:             IRQ and Error register values, read when IRQ was
 *                           handled
 * @bus_irq_val              Bus irq register status
 * @ccif_violation_status    ccif violation status
 * @overflow_status          bus overflow status
 * @image_size_vio_sts       image size violations status
 * @error_type:              Identify different errors
 * @ts:                      Timestamp
 */
struct cam_sfe_irq_evt_payload {
	struct list_head           list;
	uint32_t                   core_index;
	uint32_t                   evt_id;
	uint32_t                   irq_reg_val[CAM_SFE_IRQ_REGISTERS_MAX];
	uint32_t                   bus_irq_val[CAM_SFE_BUS_IRQ_REGISTERS_MAX];
	uint32_t                   ccif_violation_status;
	uint32_t                   overflow_status;
	uint32_t                   image_size_vio_sts;
	uint32_t                   error_type;
	struct cam_isp_timestamp   ts;
};

/*
 * struct cam_sfe_hw_get_hw_cap:
 *
@@ -54,18 +135,18 @@ struct cam_sfe_hw_get_hw_cap {
 *                           is successful
 * @res_id:                  Unique Identity of port to associate with this
 *                           resource.
 * @is_dual:                 Flag to indicate dual SFE usecase
 * @cdm_ops:                 CDM operations
 * @unpacket_fmt:            Unpacker format for read engine
 * @is_offline:              Flag to indicate offline usecase
 * @secure_mode:             If fetch is from secure/non-secure buffer
 */
struct cam_sfe_hw_sfe_bus_rd_acquire_args {
	struct cam_isp_resource_node         *rsrc_node;
	uint32_t                              res_id;
	uint32_t                              is_dual;
	struct cam_cdm_utils_ops             *cdm_ops;
	uint32_t                              unpacker_fmt;
	bool                                  is_offline;
	bool                                  secure_mode;
};

/*
@@ -77,9 +158,7 @@ struct cam_sfe_hw_sfe_bus_rd_acquire_args {
 *                           resource.
 * @cdm_ops:                 CDM operations
 * @is_dual:                 Dual mode usecase
 * @sync_mode:               If in dual mode, indicates master/slave
 * @in_port:                 in port info
 * @is_fe_enabled:           Flag to indicate if FE is enabled
 * @is_offline:              Flag to indicate Offline IFE
 */
struct cam_sfe_hw_sfe_in_acquire_args {
@@ -87,9 +166,7 @@ struct cam_sfe_hw_sfe_in_acquire_args {
	uint32_t                              res_id;
	struct cam_cdm_utils_ops             *cdm_ops;
	uint32_t                              is_dual;
	enum cam_isp_hw_sync_mode             sync_mode;
	struct cam_isp_in_port_generic_info  *in_port;
	bool                                  is_fe_enabled;
	bool                                  is_offline;
};

@@ -126,6 +203,7 @@ struct cam_sfe_hw_sfe_out_acquire_args {
 *                           with this resource.
 * @priv:                    Context data
 * @event_cb:                Callback function to hw mgr in case of hw events
 * @buf_done_controller:     Buf done controller
 * @sfe_out:                 Acquire args for SFE_OUT
 * @sfe_bus_rd               Acquire args for SFE_BUS_READ
 * @sfe_in:                  Acquire args for SFE_IN
@@ -135,6 +213,7 @@ struct cam_sfe_acquire_args {
	void                                *tasklet;
	void                                *priv;
	cam_hw_mgr_event_cb_func             event_cb;
	void                                *buf_done_controller;
	union {
		struct cam_sfe_hw_sfe_out_acquire_args     sfe_out;
		struct cam_sfe_hw_sfe_in_acquire_args      sfe_in;
Loading