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

// SPDX-License-Identifier: GPL-2.0
/*
 * Support for Intel Camera Imaging ISP subsystem.
 * Copyright (c) 2015, Intel Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 */

/*! \file */
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>

#include "hmm.h"

#include "atomisp_internal.h"

#include "ia_css.h"
#include "sh_css_hrt.h"		/* only for file 2 MIPI */
#include "ia_css_buffer.h"
#include "ia_css_binary.h"
#include "sh_css_internal.h"
#include "sh_css_mipi.h"
#include "sh_css_sp.h"		/* sh_css_sp_group */
#include "ia_css_isys.h"
#include "ia_css_frame.h"
#include "sh_css_defs.h"
#include "sh_css_firmware.h"
#include "sh_css_params.h"
#include "sh_css_params_internal.h"
#include "sh_css_param_shading.h"
#include "ia_css_refcount.h"
#include "ia_css_rmgr.h"
#include "ia_css_debug.h"
#include "ia_css_debug_pipe.h"
#include "ia_css_device_access.h"
#include "device_access.h"
#include "sh_css_legacy.h"
#include "ia_css_pipeline.h"
#include "ia_css_stream.h"
#include "sh_css_stream_format.h"
#include "ia_css_pipe.h"
#include "ia_css_util.h"
#include "ia_css_pipe_util.h"
#include "ia_css_pipe_binarydesc.h"
#include "ia_css_pipe_stagedesc.h"

#include "tag.h"
#include "assert_support.h"
#include "math_support.h"
#include "sw_event_global.h"			/* Event IDs.*/
#include "ia_css_ifmtr.h"
#include "input_system.h"
#include "mmu_device.h"		/* mmu_set_page_table_base_index(), ... */
#include "ia_css_mmu_private.h" /* sh_css_mmu_set_page_table_base_index() */
#include "gdc_device.h"		/* HRT_GDC_N */
#include "dma.h"		/* dma_set_max_burst_size() */
#include "irq.h"		/* virq */
#include "sp.h"			/* cnd_sp_irq_enable() */
#include "isp.h"		/* cnd_isp_irq_enable, ISP_VEC_NELEMS */
#include "gp_device.h"		/* gp_device_reg_store() */
#include <gpio_global.h>
#include <gpio_private.h>
#include "timed_ctrl.h"
#include "ia_css_inputfifo.h"
#define WITH_PC_MONITORING

#define SH_CSS_VIDEO_BUFFER_ALIGNMENT


#include "ia_css_spctrl.h"
#include "ia_css_version_data.h"
#include "sh_css_struct.h"
#include "ia_css_bufq.h"
#include "ia_css_timer.h" /* clock_value_t */

#include "isp/modes/interface/input_buf.isp.h"

/* Name of the sp program: should not be built-in */
#define SP_PROG_NAME
/* Size of Refcount List */
#define REFCOUNT_SIZE

/*
 * for JPEG, we don't know the length of the image upfront,
 * but since we support sensor up to 16MP, we take this as
 * upper limit.
 */
#define JPEG_BYTES

struct sh_css my_css;

int  __printf(1, 0) (*sh_css_printf)(const char *fmt, va_list args) =;

/*
 * modes of work: stream_create and stream_destroy will update the save/restore
 * data only when in working mode, not suspend/resume
 */
enum ia_sh_css_modes {};

/**
 * struct sh_css_stream_seed - a stream seed, to save and restore the
 * stream data.
 *
 * @orig_stream:	pointer to restore the original handle
 * @stream:		handle, used as ID too.
 * @stream_config:	stream config struct
 * @num_pipes:		number of pipes
 * @pipes:		pipe handles
 * @orig_pipes:		pointer to restore original handle
 * @pipe_config:	pipe config structs
 *
 * the stream seed contains all the data required to "grow" the seed again
 * after it was closed.
*/
struct sh_css_stream_seed {};

#define MAX_ACTIVE_STREAMS
/*
 * 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 {};

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

struct sh_css_hmm_buffer_record {};

static struct sh_css_hmm_buffer_record hmm_buffer_record[MAX_HMM_BUFFER_NUM];

#define GPIO_FLASH_PIN_MASK

/*
 * 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
need_yuv_scaler_stage(const struct ia_css_pipe *pipe);

static int ia_css_pipe_create_cas_scaler_desc_single_output(
    struct ia_css_frame_info *cas_scaler_in_info,
    struct ia_css_frame_info *cas_scaler_out_info,
    struct ia_css_frame_info *cas_scaler_vf_info,
    struct ia_css_cas_binary_descr *descr);

static void ia_css_pipe_destroy_cas_scaler_desc(struct ia_css_cas_binary_descr
	*descr);

static bool
need_downscaling(const struct ia_css_resolution in_res,
		 const struct ia_css_resolution out_res);

static bool need_capt_ldc(const struct ia_css_pipe *pipe);

static int
sh_css_pipe_load_binaries(struct ia_css_pipe *pipe);

static
int sh_css_pipe_get_viewfinder_frame_info(
    struct ia_css_pipe *pipe,
    struct ia_css_frame_info *info,
    unsigned int idx);

static int
sh_css_pipe_get_output_frame_info(struct ia_css_pipe *pipe,
				  struct ia_css_frame_info *info,
				  unsigned int idx);

static int
capture_start(struct ia_css_pipe *pipe);

static int
video_start(struct ia_css_pipe *pipe);

static int
preview_start(struct ia_css_pipe *pipe);

static int
yuvpp_start(struct ia_css_pipe *pipe);

static bool copy_on_sp(struct ia_css_pipe *pipe);

static int
init_vf_frameinfo_defaults(struct ia_css_pipe *pipe,
			   struct ia_css_frame *vf_frame, unsigned int idx);

static int
init_in_frameinfo_memory_defaults(struct ia_css_pipe *pipe,
				  struct ia_css_frame *frame, enum ia_css_frame_format format);

static int
init_out_frameinfo_defaults(struct ia_css_pipe *pipe,
			    struct ia_css_frame *out_frame, unsigned int idx);

static int
alloc_continuous_frames(struct ia_css_pipe *pipe, bool init_time);

static void
pipe_global_init(void);

static int
pipe_generate_pipe_num(const struct ia_css_pipe *pipe,
		       unsigned int *pipe_number);

static void
pipe_release_pipe_num(unsigned int pipe_num);

static int
create_host_pipeline_structure(struct ia_css_stream *stream);

static int
create_host_pipeline(struct ia_css_stream *stream);

static int
create_host_preview_pipeline(struct ia_css_pipe *pipe);

static int
create_host_video_pipeline(struct ia_css_pipe *pipe);

static int
create_host_copy_pipeline(struct ia_css_pipe *pipe,
			  unsigned int max_input_width,
			  struct ia_css_frame *out_frame);

static int
create_host_isyscopy_capture_pipeline(struct ia_css_pipe *pipe);

static int
create_host_capture_pipeline(struct ia_css_pipe *pipe);

static int
create_host_yuvpp_pipeline(struct ia_css_pipe *pipe);

static unsigned int
sh_css_get_sw_interrupt_value(unsigned int irq);

static struct ia_css_binary *ia_css_pipe_get_shading_correction_binary(
    const struct ia_css_pipe *pipe);

static struct ia_css_binary *
ia_css_pipe_get_s3a_binary(const struct ia_css_pipe *pipe);

static struct ia_css_binary *
ia_css_pipe_get_sdis_binary(const struct ia_css_pipe *pipe);

static void
sh_css_hmm_buffer_record_init(void);

static void
sh_css_hmm_buffer_record_uninit(void);

static void
sh_css_hmm_buffer_record_reset(struct sh_css_hmm_buffer_record *buffer_record);

static struct sh_css_hmm_buffer_record
*sh_css_hmm_buffer_record_acquire(struct ia_css_rmgr_vbuf_handle *h_vbuf,
				  enum ia_css_buffer_type type,
				  hrt_address kernel_ptr);

static struct sh_css_hmm_buffer_record
*sh_css_hmm_buffer_record_validate(ia_css_ptr ddr_buffer_addr,
				   enum ia_css_buffer_type type);

static unsigned int get_crop_lines_for_bayer_order(const struct
	ia_css_stream_config *config);
static unsigned int get_crop_columns_for_bayer_order(const struct
	ia_css_stream_config *config);
static void get_pipe_extra_pixel(struct ia_css_pipe *pipe,
				 unsigned int *extra_row, unsigned int *extra_column);

static void
sh_css_pipe_free_shading_table(struct ia_css_pipe *pipe)
{}

static enum ia_css_frame_format yuv420_copy_formats[] =;

static enum ia_css_frame_format yuv422_copy_formats[] =;

/*
 * Verify whether the selected output format is can be produced
 * by the copy binary given the stream format.
 */
static int
verify_copy_out_frame_format(struct ia_css_pipe *pipe)
{}

unsigned int
ia_css_stream_input_format_bits_per_pixel(struct ia_css_stream *stream)
{}

static int
sh_css_config_input_network_2400(struct ia_css_stream *stream)
{}

static unsigned int csi2_protocol_calculate_max_subpixels_per_line(
    enum atomisp_input_format	format,
    unsigned int			pixels_per_line)
{}

static bool sh_css_translate_stream_cfg_to_input_system_input_port_id(
    struct ia_css_stream_config *stream_cfg,
    ia_css_isys_descr_t	*isys_stream_descr)
{}

static bool sh_css_translate_stream_cfg_to_input_system_input_port_type(
    struct ia_css_stream_config *stream_cfg,
    ia_css_isys_descr_t	*isys_stream_descr)
{}

static bool sh_css_translate_stream_cfg_to_input_system_input_port_attr(
    struct ia_css_stream_config *stream_cfg,
    ia_css_isys_descr_t	*isys_stream_descr,
    int isys_stream_idx)
{}

static bool sh_css_translate_stream_cfg_to_input_system_input_port_resolution(
    struct ia_css_stream_config *stream_cfg,
    ia_css_isys_descr_t	*isys_stream_descr,
    int isys_stream_idx)
{}

static bool sh_css_translate_stream_cfg_to_isys_stream_descr(
    struct ia_css_stream_config *stream_cfg,
    bool early_polling,
    ia_css_isys_descr_t	*isys_stream_descr,
    int isys_stream_idx)
{}

static bool sh_css_translate_binary_info_to_input_system_output_port_attr(
    struct ia_css_binary *binary,
    ia_css_isys_descr_t     *isys_stream_descr)
{}

static int
sh_css_config_input_network_2401(struct ia_css_stream *stream)
{}

static inline struct ia_css_pipe *stream_get_last_pipe(
    struct ia_css_stream *stream)
{}

static inline struct ia_css_pipe *stream_get_copy_pipe(
    struct ia_css_stream *stream)
{}

static inline struct ia_css_pipe *stream_get_target_pipe(
    struct ia_css_stream *stream)
{}

static int stream_csi_rx_helper(
    struct ia_css_stream *stream,
    int (*func)(enum mipi_port_id, uint32_t))
{}

static inline int stream_register_with_csi_rx(
    struct ia_css_stream *stream)
{}

static inline int stream_unregister_with_csi_rx(
    struct ia_css_stream *stream)
{}


static void
start_binary(struct ia_css_pipe *pipe,
	     struct ia_css_binary *binary)
{}

/* start the copy function on the SP */
static int
start_copy_on_sp(struct ia_css_pipe *pipe,
		 struct ia_css_frame *out_frame)
{}

void sh_css_binary_args_reset(struct sh_css_binary_args *args)
{}

static void start_pipe(
    struct ia_css_pipe *me,
    enum sh_css_pipe_config_override copy_ovrd,
    enum ia_css_input_mode input_mode)
{}

void
sh_css_invalidate_shading_tables(struct ia_css_stream *stream)
{}

static void
enable_interrupts(enum ia_css_irq_type irq_type)
{}

static bool sh_css_setup_spctrl_config(const struct ia_css_fw_info *fw,
				       const char *program,
				       ia_css_spctrl_cfg  *spctrl_cfg)
{}

void
ia_css_unload_firmware(void)
{}

static void
ia_css_reset_defaults(struct sh_css *css)
{}

int
ia_css_load_firmware(struct device *dev, const struct ia_css_env *env,
		     const struct ia_css_fw  *fw)
{}

int
ia_css_init(struct device *dev, const struct ia_css_env *env,
	    u32 mmu_l1_base, enum ia_css_irq_type irq_type)
{}

int
ia_css_enable_isys_event_queue(bool enable)
{}

/*
 * Mapping sp threads. Currently, this is done when a stream is created and
 * pipelines are ready to be converted to sp pipelines. Be careful if you are
 * doing it from stream_create since we could run out of sp threads due to
 * allocation on inactive pipelines.
 */
static int
map_sp_threads(struct ia_css_stream *stream, bool map)
{}

/*
 * creates a host pipeline skeleton for all pipes in a stream. Called during
 * stream_create.
 */
static int
create_host_pipeline_structure(struct ia_css_stream *stream)
{}

/*
 * creates a host pipeline for all pipes in a stream. Called during
 * stream_start.
 */
static int
create_host_pipeline(struct ia_css_stream *stream)
{}

static const struct ia_css_pipe default_pipe =;
static const struct ia_css_preview_settings preview =;
static const struct ia_css_capture_settings capture =;
static const struct ia_css_video_settings video =;
static const struct ia_css_yuvpp_settings yuvpp =;

static int
init_pipe_defaults(enum ia_css_pipe_mode mode,
		   struct ia_css_pipe *pipe,
		   bool copy_pipe)
{}

static void
pipe_global_init(void)
{}

static int
pipe_generate_pipe_num(const struct ia_css_pipe *pipe,
		       unsigned int *pipe_number)
{}

static void
pipe_release_pipe_num(unsigned int pipe_num)
{}

static int
create_pipe(enum ia_css_pipe_mode mode,
	    struct ia_css_pipe **pipe,
	    bool copy_pipe)
{}

struct ia_css_pipe *
find_pipe_by_num(uint32_t pipe_num)
{}

int
ia_css_pipe_destroy(struct ia_css_pipe *pipe)
{}

void
ia_css_uninit(void)
{}

int ia_css_irq_translate(
    unsigned int *irq_infos)
{}

int ia_css_irq_enable(
    enum ia_css_irq_info info,
    bool enable)
{}


static unsigned int
sh_css_get_sw_interrupt_value(unsigned int irq)
{}

/*
 * configure and load the copy binary, the next binary is used to
 * determine whether the copy binary needs to do left padding.
 */
static int load_copy_binary(
    struct ia_css_pipe *pipe,
    struct ia_css_binary *copy_binary,
    struct ia_css_binary *next_binary)
{}

static int
alloc_continuous_frames(struct ia_css_pipe *pipe, bool init_time)
{}

int
ia_css_alloc_continuous_frame_remain(struct ia_css_stream *stream)
{}

static int
load_preview_binaries(struct ia_css_pipe *pipe)
{}

static void
ia_css_binary_unload(struct ia_css_binary *binary)
{}

static int
unload_preview_binaries(struct ia_css_pipe *pipe)
{}

static const struct ia_css_fw_info *last_output_firmware(
    const struct ia_css_fw_info *fw)
{}

static int add_firmwares(
    struct ia_css_pipeline *me,
    struct ia_css_binary *binary,
    const struct ia_css_fw_info *fw,
    const struct ia_css_fw_info *last_fw,
    unsigned int binary_mode,
    struct ia_css_frame *in_frame,
    struct ia_css_frame *out_frame,
    struct ia_css_frame *vf_frame,
    struct ia_css_pipeline_stage **my_stage,
    struct ia_css_pipeline_stage **vf_stage)
{}

static int add_vf_pp_stage(
    struct ia_css_pipe *pipe,
    struct ia_css_frame *in_frame,
    struct ia_css_frame *out_frame,
    struct ia_css_binary *vf_pp_binary,
    struct ia_css_pipeline_stage **vf_pp_stage)
{}

static int add_yuv_scaler_stage(
    struct ia_css_pipe *pipe,
    struct ia_css_pipeline *me,
    struct ia_css_frame *in_frame,
    struct ia_css_frame *out_frame,
    struct ia_css_frame *internal_out_frame,
    struct ia_css_binary *yuv_scaler_binary,
    struct ia_css_pipeline_stage **pre_vf_pp_stage)
{}

static int add_capture_pp_stage(
    struct ia_css_pipe *pipe,
    struct ia_css_pipeline *me,
    struct ia_css_frame *in_frame,
    struct ia_css_frame *out_frame,
    struct ia_css_binary *capture_pp_binary,
    struct ia_css_pipeline_stage **capture_pp_stage)
{}

static void sh_css_setup_queues(void)
{}

static int
init_vf_frameinfo_defaults(struct ia_css_pipe *pipe,
			   struct ia_css_frame *vf_frame, unsigned int idx)
{}

static unsigned int
get_crop_lines_for_bayer_order(const struct ia_css_stream_config *config)
{}

static unsigned int
get_crop_columns_for_bayer_order(const struct ia_css_stream_config *config)
{}

/*
 * This function is to get the sum of all extra pixels in addition to the effective
 * input, it includes dvs envelop and filter run-in
 */
static void get_pipe_extra_pixel(struct ia_css_pipe *pipe,
				 unsigned int *extra_row, unsigned int *extra_column)
{}

void
ia_css_get_crop_offsets(
    struct ia_css_pipe *pipe,
    struct ia_css_frame_info *in_frame)
{}

static int
init_in_frameinfo_memory_defaults(struct ia_css_pipe *pipe,
				  struct ia_css_frame *frame, enum ia_css_frame_format format)
{}

static int
init_out_frameinfo_defaults(struct ia_css_pipe *pipe,
			    struct ia_css_frame *out_frame, unsigned int idx)
{}

/* Create stages for video pipe */
static int create_host_video_pipeline(struct ia_css_pipe *pipe)
{}

/* Create stages for preview */
static int
create_host_preview_pipeline(struct ia_css_pipe *pipe)
{}

static void send_raw_frames(struct ia_css_pipe *pipe)
{}

static int
preview_start(struct ia_css_pipe *pipe)
{}

int
ia_css_pipe_enqueue_buffer(struct ia_css_pipe *pipe,
			   const struct ia_css_buffer *buffer)
{}

/*
 * TODO: Free up the hmm memory space.
 */
int
ia_css_pipe_dequeue_buffer(struct ia_css_pipe *pipe,
			   struct ia_css_buffer *buffer)
{}

/*
 * Cannot Move this to event module as it is of ia_css_event_type which is declared in ia_css.h
 * TODO: modify and move it if possible.
 *
 * !!!IMPORTANT!!! KEEP THE FOLLOWING IN SYNC:
 * 1) "enum ia_css_event_type"					(ia_css_event_public.h)
 * 2) "enum sh_css_sp_event_type"				(sh_css_internal.h)
 * 3) "enum ia_css_event_type event_id_2_event_mask"		(event_handler.sp.c)
 * 4) "enum ia_css_event_type convert_event_sp_to_host_domain"	(sh_css.c)
 */
static enum ia_css_event_type convert_event_sp_to_host_domain[] =;

int
ia_css_dequeue_psys_event(struct ia_css_event *event)
{}

int
ia_css_dequeue_isys_event(struct ia_css_event *event)
{}

static int
sh_css_pipe_start(struct ia_css_stream *stream)
{}

/* ISP2400 */
void
sh_css_enable_cont_capt(bool enable, bool stop_copy_preview)
{}

bool
sh_css_continuous_is_enabled(uint8_t pipe_num)
{}

/* ISP2400 */
int
ia_css_stream_get_max_buffer_depth(struct ia_css_stream *stream,
				   int *buffer_depth)
{}

int
ia_css_stream_set_buffer_depth(struct ia_css_stream *stream, int buffer_depth)
{}

/* ISP2401 */
int
ia_css_stream_get_buffer_depth(struct ia_css_stream *stream,
			       int *buffer_depth)
{}

unsigned int
sh_css_get_mipi_sizes_for_check(const unsigned int port, const unsigned int idx)
{}

static int sh_css_pipe_configure_output(
    struct ia_css_pipe *pipe,
    unsigned int width,
    unsigned int height,
    unsigned int padded_width,
    enum ia_css_frame_format format,
    unsigned int idx)
{}

static int
sh_css_pipe_get_shading_info(struct ia_css_pipe *pipe,
			     struct ia_css_shading_info *shading_info,
			     struct ia_css_pipe_config *pipe_config)
{}

static int
sh_css_pipe_get_grid_info(struct ia_css_pipe *pipe,
			  struct ia_css_grid_info *info)
{}

/* ISP2401 */
/*
 * @brief Check if a format is supported by the pipe.
 *
 */
static int
ia_css_pipe_check_format(struct ia_css_pipe *pipe,
			 enum ia_css_frame_format format)
{}

static int load_video_binaries(struct ia_css_pipe *pipe)
{}

static int
unload_video_binaries(struct ia_css_pipe *pipe)
{}

static int video_start(struct ia_css_pipe *pipe)
{}

static
int sh_css_pipe_get_viewfinder_frame_info(
    struct ia_css_pipe *pipe,
    struct ia_css_frame_info *info,
    unsigned int idx)
{}

static int
sh_css_pipe_configure_viewfinder(struct ia_css_pipe *pipe, unsigned int width,
				 unsigned int height, unsigned int min_width,
				 enum ia_css_frame_format format,
				 unsigned int idx)
{}

static int load_copy_binaries(struct ia_css_pipe *pipe)
{}

static bool need_capture_pp(
    const struct ia_css_pipe *pipe)
{}

static bool need_capt_ldc(
    const struct ia_css_pipe *pipe)
{}

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

static int load_primary_binaries(
    struct ia_css_pipe *pipe)
{}

static int
allocate_delay_frames(struct ia_css_pipe *pipe)
{}

static int load_advanced_binaries(struct ia_css_pipe *pipe)
{}

static int load_bayer_isp_binaries(struct ia_css_pipe *pipe)
{}

static int load_low_light_binaries(struct ia_css_pipe *pipe)
{}

static bool copy_on_sp(struct ia_css_pipe *pipe)
{}

static int load_capture_binaries(struct ia_css_pipe *pipe)
{}

static int
unload_capture_binaries(struct ia_css_pipe *pipe)
{}

static bool
need_downscaling(const struct ia_css_resolution in_res,
		 const struct ia_css_resolution out_res)
{}

static bool
need_yuv_scaler_stage(const struct ia_css_pipe *pipe)
{}

/*
 * TODO: it is temporarily created from ia_css_pipe_create_cas_scaler_desc
 * which has some hard-coded knowledge which prevents reuse of the function.
 * Later, merge this with ia_css_pipe_create_cas_scaler_desc
 */
static int ia_css_pipe_create_cas_scaler_desc_single_output(
	    struct ia_css_frame_info *cas_scaler_in_info,
	    struct ia_css_frame_info *cas_scaler_out_info,
	    struct ia_css_frame_info *cas_scaler_vf_info,
	    struct ia_css_cas_binary_descr *descr)
{}

/* FIXME: merge most of this and single output version */
static int
ia_css_pipe_create_cas_scaler_desc(struct ia_css_pipe *pipe,
				   struct ia_css_cas_binary_descr *descr)
{}

static void ia_css_pipe_destroy_cas_scaler_desc(struct ia_css_cas_binary_descr
	*descr)
{}

static int
load_yuvpp_binaries(struct ia_css_pipe *pipe)
{}

static int
unload_yuvpp_binaries(struct ia_css_pipe *pipe)
{}

static int yuvpp_start(struct ia_css_pipe *pipe)
{}

static int
sh_css_pipe_unload_binaries(struct ia_css_pipe *pipe)
{}

static int
sh_css_pipe_load_binaries(struct ia_css_pipe *pipe)
{}

static int
create_host_yuvpp_pipeline(struct ia_css_pipe *pipe)
{}

static int
create_host_copy_pipeline(struct ia_css_pipe *pipe,
			  unsigned int max_input_width,
			  struct ia_css_frame *out_frame)
{}

static int
create_host_isyscopy_capture_pipeline(struct ia_css_pipe *pipe)
{}

static int
create_host_regular_capture_pipeline(struct ia_css_pipe *pipe)
{}

static int
create_host_capture_pipeline(struct ia_css_pipe *pipe)
{}

static int capture_start(struct ia_css_pipe *pipe)
{}

static int
sh_css_pipe_get_output_frame_info(struct ia_css_pipe *pipe,
				  struct ia_css_frame_info *info,
				  unsigned int idx)
{}

void
ia_css_stream_send_input_frame(const struct ia_css_stream *stream,
			       const unsigned short *data,
			       unsigned int width,
			       unsigned int height)
{}

void
ia_css_stream_start_input_frame(const struct ia_css_stream *stream)
{}

void
ia_css_stream_send_input_line(const struct ia_css_stream *stream,
			      const unsigned short *data,
			      unsigned int width,
			      const unsigned short *data2,
			      unsigned int width2)
{}

void
ia_css_stream_send_input_embedded_line(const struct ia_css_stream *stream,
				       enum atomisp_input_format format,
				       const unsigned short *data,
				       unsigned int width)
{}

void
ia_css_stream_end_input_frame(const struct ia_css_stream *stream)
{}

bool
ia_css_pipeline_uses_params(struct ia_css_pipeline *me)
{}

/*
 * @brief Tag a specific frame in continuous capture.
 * Refer to "sh_css_internal.h" for details.
 */
int ia_css_stream_capture_frame(struct ia_css_stream *stream,
				unsigned int exp_id)
{}

/*
 * @brief Configure the continuous capture.
 * Refer to "sh_css_internal.h" for details.
 */
int ia_css_stream_capture(struct ia_css_stream *stream, int num_captures,
			  unsigned int skip, int offset)
{}

static void
sh_css_init_host_sp_control_vars(void)
{}

/*
 * create the internal structures and fill in the configuration data
 */

static const struct
ia_css_pipe_config ia_css_pipe_default_config =;

void ia_css_pipe_config_defaults(struct ia_css_pipe_config *pipe_config)
{}

void
ia_css_pipe_extra_config_defaults(struct ia_css_pipe_extra_config *extra_config)
{}

void ia_css_stream_config_defaults(struct ia_css_stream_config *stream_config)
{}

int ia_css_pipe_create(const struct ia_css_pipe_config *config,
		       struct ia_css_pipe **pipe)
{}

int
ia_css_pipe_create_extra(const struct ia_css_pipe_config *config,
			 const struct ia_css_pipe_extra_config *extra_config,
			 struct ia_css_pipe **pipe)
{}

int
ia_css_pipe_get_info(const struct ia_css_pipe *pipe,
		     struct ia_css_pipe_info *pipe_info)
{}

bool ia_css_pipe_has_dvs_stats(struct ia_css_pipe_info *pipe_info)
{}

int
ia_css_pipe_override_frame_format(struct ia_css_pipe *pipe,
				  int pin_index,
				  enum ia_css_frame_format new_format)
{}

/* Configuration of INPUT_SYSTEM_VERSION_2401 is done on SP */
static int
ia_css_stream_configure_rx(struct ia_css_stream *stream)
{}

static struct ia_css_pipe *
find_pipe(struct ia_css_pipe *pipes[], unsigned int num_pipes,
	  enum ia_css_pipe_mode mode, bool copy_pipe)
{}

static int
metadata_info_init(const struct ia_css_metadata_config *mdc,
		   struct ia_css_metadata_info *md)
{}

int
ia_css_stream_create(const struct ia_css_stream_config *stream_config,
		     int num_pipes,
		     struct ia_css_pipe *pipes[],
		     struct ia_css_stream **stream)
{}

int
ia_css_stream_destroy(struct ia_css_stream *stream)
{}

int
ia_css_stream_get_info(const struct ia_css_stream *stream,
		       struct ia_css_stream_info *stream_info)
{}

int
ia_css_stream_start(struct ia_css_stream *stream)
{}

int
ia_css_stream_stop(struct ia_css_stream *stream)
{}

bool
ia_css_stream_has_stopped(struct ia_css_stream *stream)
{}

/* ISP2400 */
/*
 * Destroy the stream and all the pipes related to it.
 * The stream handle is used to identify the correct entry in the css_save struct
 */
int
ia_css_stream_unload(struct ia_css_stream *stream)
{}

int
ia_css_temp_pipe_to_pipe_id(const struct ia_css_pipe *pipe,
			    enum ia_css_pipe_id *pipe_id)
{}

enum atomisp_input_format
ia_css_stream_get_format(const struct ia_css_stream *stream)
{}

bool
ia_css_stream_get_two_pixels_per_clock(const struct ia_css_stream *stream)
{}

struct ia_css_binary *
ia_css_stream_get_shading_correction_binary(const struct ia_css_stream
	*stream)
{}

struct ia_css_binary *
ia_css_stream_get_dvs_binary(const struct ia_css_stream *stream)
{}

struct ia_css_binary *
ia_css_stream_get_3a_binary(const struct ia_css_stream *stream)
{}

int
ia_css_stream_set_output_padded_width(struct ia_css_stream *stream,
				      unsigned int output_padded_width)
{}

static struct ia_css_binary *
ia_css_pipe_get_shading_correction_binary(const struct ia_css_pipe *pipe)
{}

static struct ia_css_binary *
ia_css_pipe_get_s3a_binary(const struct ia_css_pipe *pipe)
{}

static struct ia_css_binary *
ia_css_pipe_get_sdis_binary(const struct ia_css_pipe *pipe)
{}

struct ia_css_pipeline *
ia_css_pipe_get_pipeline(const struct ia_css_pipe *pipe)
{}

unsigned int
ia_css_pipe_get_pipe_num(const struct ia_css_pipe *pipe)
{}

unsigned int
ia_css_pipe_get_isp_pipe_version(const struct ia_css_pipe *pipe)
{}

#define SP_START_TIMEOUT_US

int
ia_css_start_sp(void)
{}

/*
 * Time to wait SP for termincate. Only condition when this can happen
 * is a fatal hw failure, but we must be able to detect this and emit
 * a proper error trace.
 */
#define SP_SHUTDOWN_TIMEOUT_US

int
ia_css_stop_sp(void)
{}

int
ia_css_update_continuous_frames(struct ia_css_stream *stream)
{}

void ia_css_pipe_map_queue(struct ia_css_pipe *pipe, bool map)
{}


int
ia_css_unlock_raw_frame(struct ia_css_stream *stream, uint32_t exp_id)
{}

static void
sh_css_hmm_buffer_record_init(void)
{}

static void
sh_css_hmm_buffer_record_uninit(void)
{}

static void
sh_css_hmm_buffer_record_reset(struct sh_css_hmm_buffer_record *buffer_record)
{}

static struct sh_css_hmm_buffer_record
*sh_css_hmm_buffer_record_acquire(struct ia_css_rmgr_vbuf_handle *h_vbuf,
				    enum ia_css_buffer_type type,
				    hrt_address kernel_ptr)
{}

static struct sh_css_hmm_buffer_record
*sh_css_hmm_buffer_record_validate(ia_css_ptr ddr_buffer_addr,
				    enum ia_css_buffer_type type)
{}