linux/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.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.
 */

#include <linux/math.h>

#include <math_support.h>
#include <gdc_device.h>	/* HR_GDC_N */

#include "hmm.h"

#include "isp.h"	/* ISP_VEC_NELEMS */

#include "ia_css_binary.h"
#include "ia_css_debug.h"
#include "ia_css_util.h"
#include "ia_css_isp_param.h"
#include "sh_css_internal.h"
#include "sh_css_sp.h"
#include "sh_css_firmware.h"
#include "sh_css_defs.h"
#include "sh_css_legacy.h"

#include "atomisp_internal.h"

#include "vf/vf_1.0/ia_css_vf.host.h"
#include "sc/sc_1.0/ia_css_sc.host.h"
#include "sdis/sdis_1.0/ia_css_sdis.host.h"
#include "fixedbds/fixedbds_1.0/ia_css_fixedbds_param.h"	/* FRAC_ACC */

#include "camera/pipe/interface/ia_css_pipe_binarydesc.h"

#include "assert_support.h"

static struct ia_css_binary_xinfo *all_binaries; /* ISP binaries only (no SP) */
static struct ia_css_binary_xinfo
	*binary_infos[IA_CSS_BINARY_NUM_MODES] =;

static void
ia_css_binary_dvs_env(const struct ia_css_binary_info *info,
		      const struct ia_css_resolution *dvs_env,
		      struct ia_css_resolution *binary_dvs_env)
{}

static void
ia_css_binary_internal_res(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_resolution *dvs_env,
			   const struct ia_css_binary_info *info,
			   struct ia_css_resolution *internal_res)
{}

/* Computation results of the origin coordinate of bayer on the shading table. */
struct sh_css_shading_table_bayer_origin_compute_results {};

/* Get the requirements for the shading correction. */
static int
ia_css_binary_compute_shading_table_bayer_origin(
    const struct ia_css_binary *binary,				/* [in] */
    unsigned int required_bds_factor,				/* [in] */
    const struct ia_css_stream_config *stream_config,		/* [in] */
    struct sh_css_shading_table_bayer_origin_compute_results *res)	/* [out] */
{}

/* Get the shading information of Shading Correction Type 1. */
static int
binary_get_shading_info_type_1(const struct ia_css_binary *binary,	/* [in] */
			       unsigned int required_bds_factor,			/* [in] */
			       const struct ia_css_stream_config *stream_config,	/* [in] */
			       struct ia_css_shading_info *info)			/* [out] */
{}


int
ia_css_binary_get_shading_info(const struct ia_css_binary *binary,			/* [in] */
			       enum ia_css_shading_correction_type type,		/* [in] */
			       unsigned int required_bds_factor,			/* [in] */
			       const struct ia_css_stream_config *stream_config,	/* [in] */
			       struct ia_css_shading_info *shading_info,		/* [out] */
			       struct ia_css_pipe_config *pipe_config)			/* [out] */
{}

static void sh_css_binary_common_grid_info(const struct ia_css_binary *binary,
	struct ia_css_grid_info *info)
{}

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)
{}

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

static void
binary_init_pc_histogram(struct sh_css_pc_histogram *histo)
{}

static void
binary_init_metrics(struct sh_css_binary_metrics *metrics,
		    const struct ia_css_binary_info *info)
{}

/* move to host part of output module */
static bool
binary_supports_output_format(const struct ia_css_binary_xinfo *info,
			      enum ia_css_frame_format format)
{}

static bool
binary_supports_vf_format(const struct ia_css_binary_xinfo *info,
			  enum ia_css_frame_format format)
{}

/* move to host part of bds module */
static bool
supports_bds_factor(u32 supported_factors,
		    uint32_t bds_factor)
{}

static int
binary_init_info(struct ia_css_binary_xinfo *info, unsigned int i,
		 bool *binary_found) {}

/* When binaries are put at the beginning, they will only
 * be selected if no other primary matches.
 */
int
ia_css_binary_init_infos(void) {}

int
ia_css_binary_uninit(void) {}

/* @brief Compute decimation factor for 3A statistics and shading correction.
 *
 * @param[in]	width	Frame width in pixels.
 * @param[in]	height	Frame height in pixels.
 * @return	Log2 of decimation factor (= grid cell size) in bayer quads.
 */
static int
binary_grid_deci_factor_log2(int width, int height)
{}

static int
binary_in_frame_padded_width(int in_frame_width,
			     int isp_internal_width,
			     int dvs_env_width,
			     int stream_config_left_padding,
			     int left_cropping,
			     bool need_scaling)
{}

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, /* can be NULL */
			const struct ia_css_frame_info *bds_out_info, /* can be NULL */
			const struct ia_css_frame_info *out_info[], /* can be NULL */
			const struct ia_css_frame_info *vf_info, /* can be NULL */
			struct ia_css_binary *binary,
			struct ia_css_resolution *dvs_env,
			int stream_config_left_padding,
			bool accelerator) {}

static int __ia_css_binary_find(struct ia_css_binary_descr *descr,
				struct ia_css_binary *binary) {}

int ia_css_binary_find(struct ia_css_binary_descr *descr,
		       struct ia_css_binary *binary)
{}

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)
{}