linux/drivers/staging/media/atomisp/pci/runtime/binary/interface/ia_css_binary.h

/* SPDX-License-Identifier: GPL-2.0 */
/**
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/

#ifndef _IA_CSS_BINARY_H_
#define _IA_CSS_BINARY_H_

#include <type_support.h>
#include "ia_css_types.h"
#include "ia_css_err.h"
#include "ia_css_stream_format.h"
#include "ia_css_stream_public.h"
#include "ia_css_frame_public.h"
#include "sh_css_metrics.h"
#include "isp/kernels/fixedbds/fixedbds_1.0/ia_css_fixedbds_types.h"

/* The binary mode is used in pre-processor expressions so we cannot
 * use an enum here. */
#define IA_CSS_BINARY_MODE_COPY
#define IA_CSS_BINARY_MODE_PREVIEW
#define IA_CSS_BINARY_MODE_PRIMARY
#define IA_CSS_BINARY_MODE_VIDEO
#define IA_CSS_BINARY_MODE_PRE_ISP
#define IA_CSS_BINARY_MODE_GDC
#define IA_CSS_BINARY_MODE_POST_ISP
#define IA_CSS_BINARY_MODE_ANR
#define IA_CSS_BINARY_MODE_CAPTURE_PP
#define IA_CSS_BINARY_MODE_VF_PP
#define IA_CSS_BINARY_MODE_PRE_DE
#define IA_CSS_BINARY_MODE_PRIMARY_HQ_STAGE0
#define IA_CSS_BINARY_MODE_PRIMARY_HQ_STAGE1
#define IA_CSS_BINARY_MODE_PRIMARY_HQ_STAGE2
#define IA_CSS_BINARY_MODE_PRIMARY_HQ_STAGE3
#define IA_CSS_BINARY_MODE_PRIMARY_HQ_STAGE4
#define IA_CSS_BINARY_MODE_PRIMARY_HQ_STAGE5
#define IA_CSS_BINARY_NUM_MODES

#define MAX_NUM_PRIMARY_STAGES
#define NUM_PRIMARY_HQ_STAGES
#define NUM_PRIMARY_STAGES

/* Indicate where binaries can read input from */
#define IA_CSS_BINARY_INPUT_SENSOR
#define IA_CSS_BINARY_INPUT_MEMORY
#define IA_CSS_BINARY_INPUT_VARIABLE

/* Should be included without the path.
   However, that requires adding the path to numerous makefiles
   that have nothing to do with isp parameters.
 */
#include "runtime/isp_param/interface/ia_css_isp_param_types.h"

/* now these ports only include output ports but not vf output ports */
enum {};

struct ia_css_cas_binary_descr {};

struct ia_css_binary_descr {};

struct ia_css_binary {};

#define IA_CSS_BINARY_DEFAULT_SETTINGS

int
ia_css_binary_init_infos(void);

int
ia_css_binary_uninit(void);

int
ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo,
			bool online,
			bool two_ppc,
			enum atomisp_input_format stream_format,
			const struct ia_css_frame_info *in_info,
			const struct ia_css_frame_info *bds_out_info,
			const struct ia_css_frame_info *out_info[],
			const struct ia_css_frame_info *vf_info,
			struct ia_css_binary *binary,
			struct ia_css_resolution *dvs_env,
			int stream_config_left_padding,
			bool accelerator);

int
ia_css_binary_find(struct ia_css_binary_descr *descr,
		   struct ia_css_binary *binary);

/* @brief Get the shading information of the specified shading correction type.
 *
 * @param[in] binary: The isp binary which has the shading correction.
 * @param[in] type: The shading correction type.
 * @param[in] required_bds_factor: The bayer downscaling factor required in the pipe.
 * @param[in] stream_config: The stream configuration.
 * @param[out] shading_info: The shading information.
 *		The shading information necessary as API is stored in the shading_info.
 *		The driver needs to get this information to generate
 *		the shading table directly required from ISP.
 * @param[out] pipe_config: The pipe configuration.
 *		The shading information related to ISP (but, not necessary as API) is stored in the pipe_config.
 * @return	0 or error code upon error.
 *
 */
int
ia_css_binary_get_shading_info(const struct ia_css_binary *binary,
			       enum ia_css_shading_correction_type type,
			       unsigned int required_bds_factor,
			       const struct ia_css_stream_config *stream_config,
			       struct ia_css_shading_info *shading_info,
			       struct ia_css_pipe_config *pipe_config);

int
ia_css_binary_3a_grid_info(const struct ia_css_binary *binary,
			   struct ia_css_grid_info *info,
			   struct ia_css_pipe *pipe);

void
ia_css_binary_dvs_grid_info(const struct ia_css_binary *binary,
			    struct ia_css_grid_info *info,
			    struct ia_css_pipe *pipe);

void
ia_css_binary_dvs_stat_grid_info(
    const struct ia_css_binary *binary,
    struct ia_css_grid_info *info,
    struct ia_css_pipe *pipe);

unsigned
ia_css_binary_max_vf_width(void);

void
ia_css_binary_destroy_isp_parameters(struct ia_css_binary *binary);

void
ia_css_binary_get_isp_binaries(struct ia_css_binary_xinfo **binaries,
			       uint32_t *num_isp_binaries);

#endif /* _IA_CSS_BINARY_H_ */