drivers/staging/media/atomisp/pci/sh_css.c

Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/sh_css.c

File Facts

System
Linux kernel
Corpus path
drivers/staging/media/atomisp/pci/sh_css.c
Extension
.c
Size
260211 bytes
Lines
9062
Domain
Driver Families
Bucket
drivers/staging
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct sh_css_stream_seed {
	struct ia_css_stream		**orig_stream;
	struct ia_css_stream		*stream;
	struct ia_css_stream_config	stream_config;
	int				num_pipes;
	struct ia_css_pipe		*pipes[IA_CSS_PIPE_ID_NUM];
	struct ia_css_pipe		**orig_pipes[IA_CSS_PIPE_ID_NUM];
	struct ia_css_pipe_config	pipe_config[IA_CSS_PIPE_ID_NUM];
};

#define MAX_ACTIVE_STREAMS	5
/*
 * A global struct for save/restore to hold all the data that should
 * sustain power-down: MMU base, IRQ type, env for routines, binary loaded FW
 * and the stream seeds.
 */
struct sh_css_save {
	enum ia_sh_css_modes		mode;
	u32		       mmu_base;		/* the last mmu_base */
	enum ia_css_irq_type           irq_type;
	struct sh_css_stream_seed      stream_seeds[MAX_ACTIVE_STREAMS];
	struct ia_css_fw	       *loaded_fw;	/* fw struct previously loaded */
	struct ia_css_env	       driver_env;	/* driver-supplied env copy */
};

static bool my_css_save_initialized;	/* if my_css_save was initialized */
static struct sh_css_save my_css_save;

/*
 * pqiao NOTICE: this is for css internal buffer recycling when stopping
 * pipeline,
 * this array is temporary and will be replaced by resource manager
 */

/* Taking the biggest Size for number of Elements */
#define MAX_HMM_BUFFER_NUM	\
	(SH_CSS_MAX_NUM_QUEUES * (IA_CSS_NUM_ELEMS_SP2HOST_BUFFER_QUEUE + 2))

struct sh_css_hmm_buffer_record {
	bool in_use;
	enum ia_css_buffer_type type;
	struct ia_css_rmgr_vbuf_handle *h_vbuf;
	hrt_address kernel_ptr;
};

static struct sh_css_hmm_buffer_record hmm_buffer_record[MAX_HMM_BUFFER_NUM];

#define GPIO_FLASH_PIN_MASK BIT(HIVE_GPIO_STROBE_TRIGGER_PIN)

/*
 * Local prototypes
 */

static int
allocate_delay_frames(struct ia_css_pipe *pipe);

static int
sh_css_pipe_start(struct ia_css_stream *stream);

/*
 * @brief Check if all "ia_css_pipe" instances in the target
 * "ia_css_stream" instance have stopped.
 *
 * @param[in] stream	Point to the target "ia_css_stream" instance.
 *
 * @return
 * - true, if all "ia_css_pipe" instances in the target "ia_css_stream"
 *   instance have ben stopped.
 * - false, otherwise.
 */

/* ISP 2401 */
static int
ia_css_pipe_check_format(struct ia_css_pipe *pipe,
			 enum ia_css_frame_format format);

/* ISP 2401 */
static void
ia_css_reset_defaults(struct sh_css *css);

static void
sh_css_init_host_sp_control_vars(void);

static int
set_num_primary_stages(unsigned int *num, enum ia_css_pipe_version version);

static bool
need_capture_pp(const struct ia_css_pipe *pipe);

static bool

Annotation

Implementation Notes