Commit c3cdc019 authored by Deepak R Varma's avatar Deepak R Varma Committed by Mauro Carvalho Chehab
Browse files

media: atomisp: pci: reposition braces as per coding style

Misplaced braces makes it difficult to follow the code easily. This also
goes against the code style guidelines. This resolved following checkpatch
complaints:

ERROR: open brace '{' following function definitions go on the next line
ERROR: that open brace { should be on the previous line

Link: https://lore.kernel.org/linux-media/YIwk3KbVGRPJwKa4@dU2104



[mchehab: dropped a hunk with a merge conflict]
Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, drv@mailo.com # X-LSpam-Score: -7.3 (-------)
Signed-off-by: default avatarDeepak R Varma <drv@mailo.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent f83f86e7
Loading
Loading
Loading
Loading
+29 −40
Original line number Diff line number Diff line
@@ -91,7 +91,8 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
				 const enum atomisp_input_format format,
				 const bool hasSOLandEOL,
				 const unsigned int embedded_data_size_words,
				 unsigned int *size_mem_words) {
				 unsigned int *size_mem_words)
{
	int err = 0;

	unsigned int bits_per_pixel = 0;
@@ -118,8 +119,7 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
	IA_CSS_ENTER("padded_width=%d, height=%d, format=%d, hasSOLandEOL=%d, embedded_data_size_words=%d\n",
		     width_padded, height, format, hasSOLandEOL, embedded_data_size_words);

	switch (format)
	{
	switch (format) {
	case ATOMISP_INPUT_FORMAT_RAW_6:		/* 4p, 3B, 24bits */
		bits_per_pixel = 6;
		break;
@@ -178,12 +178,10 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
	/* Even lines for YUV420 formats are double in bits_per_pixel. */
	if (format == ATOMISP_INPUT_FORMAT_YUV420_8
	    || format == ATOMISP_INPUT_FORMAT_YUV420_10
	    || format == ATOMISP_INPUT_FORMAT_YUV420_16)
	{
	    || format == ATOMISP_INPUT_FORMAT_YUV420_16) {
		even_line_bytes = (width_padded * 2 * bits_per_pixel + 7) >>
			3; /* ceil ( bits per line / 8) */
	} else
	{
	} else {
		even_line_bytes = odd_line_bytes;
	}

@@ -236,7 +234,8 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
#if !defined(ISP2401)
int
ia_css_mipi_frame_enable_check_on_size(const enum mipi_port_id port,
				       const unsigned int	size_mem_words) {
				       const unsigned int	size_mem_words)
{
	u32 idx;

	int err = -EBUSY;
@@ -246,11 +245,9 @@ ia_css_mipi_frame_enable_check_on_size(const enum mipi_port_id port,

	for (idx = 0; idx < IA_CSS_MIPI_SIZE_CHECK_MAX_NOF_ENTRIES_PER_PORT &&
	     my_css.mipi_sizes_for_check[port][idx] != 0;
	     idx++)   /* do nothing */
	{
	     idx++) { /* do nothing */
	}
	if (idx < IA_CSS_MIPI_SIZE_CHECK_MAX_NOF_ENTRIES_PER_PORT)
	{
	if (idx < IA_CSS_MIPI_SIZE_CHECK_MAX_NOF_ENTRIES_PER_PORT) {
		my_css.mipi_sizes_for_check[port][idx] = size_mem_words;
		err = 0;
	}
@@ -271,7 +268,8 @@ mipi_init(void)
int
calculate_mipi_buff_size(
    struct ia_css_stream_config *stream_cfg,
    unsigned int *size_mem_words) {
    unsigned int *size_mem_words)
{
#if !defined(ISP2401)
	int err = -EINVAL;
	(void)stream_cfg;
@@ -346,12 +344,10 @@ calculate_mipi_buff_size(

	/* Even lines for YUV420 formats are double in bits_per_pixel. */
	if (format == ATOMISP_INPUT_FORMAT_YUV420_8
	    || format == ATOMISP_INPUT_FORMAT_YUV420_10)
	{
	    || format == ATOMISP_INPUT_FORMAT_YUV420_10) {
		even_line_bytes = (width_padded * 2 * bits_per_pixel + 7) >>
			3; /* ceil ( bits per line / 8) */
	} else
	{
	} else {
		even_line_bytes = odd_line_bytes;
	}

@@ -393,7 +389,8 @@ static bool buffers_needed(struct ia_css_pipe *pipe)

int
allocate_mipi_frames(struct ia_css_pipe *pipe,
		     struct ia_css_stream_info *info) {
		     struct ia_css_stream_info *info)
{
	int err = -EINVAL;
	unsigned int port;

@@ -402,8 +399,7 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,

	assert(pipe);
	assert(pipe->stream);
	if ((!pipe) || (!pipe->stream))
	{
	if ((!pipe) || (!pipe->stream)) {
		ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
				    "allocate_mipi_frames(%p) exit: pipe or stream is null.\n",
				    pipe);
@@ -411,8 +407,7 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
	}

#ifdef ISP2401
	if (pipe->stream->config.online)
	{
	if (pipe->stream->config.online) {
		ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
				    "allocate_mipi_frames(%p) exit: no buffers needed for 2401 pipe mode.\n",
				    pipe);
@@ -449,8 +444,7 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
#endif

#if !defined(ISP2401)
	if (ref_count_mipi_allocation[port] != 0)
	{
	if (ref_count_mipi_allocation[port] != 0) {
		ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
				    "allocate_mipi_frames(%p) exit: already allocated for this port (port=%d).\n",
				    pipe, port);
@@ -462,8 +456,7 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
	 * TODO AM: Once that is changed (removed) this code should be removed as well.
	 * In that case only 2400 related code should remain.
	 */
	if (ref_count_mipi_allocation[port] != 0)
	{
	if (ref_count_mipi_allocation[port] != 0) {
		ref_count_mipi_allocation[port]++;
		ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
				    "allocate_mipi_frames(%p) leave: nothing to do, already allocated for this port (port=%d).\n",
@@ -481,8 +474,7 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
	{ /* limit the scope of i,j */
		unsigned int i, j;

		for (i = 0; i < my_css.num_mipi_frames[port]; i++)
		{
		for (i = 0; i < my_css.num_mipi_frames[port]; i++) {
			/* free previous frame */
			if (my_css.mipi_frames[port][i]) {
				ia_css_frame_free(my_css.mipi_frames[port][i]);
@@ -535,7 +527,8 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
}

int
free_mipi_frames(struct ia_css_pipe *pipe) {
free_mipi_frames(struct ia_css_pipe *pipe)
{
	int err = -EINVAL;
	unsigned int port;

@@ -543,8 +536,7 @@ free_mipi_frames(struct ia_css_pipe *pipe) {
			    "free_mipi_frames(%p) enter:\n", pipe);

	/* assert(pipe != NULL); TEMP: TODO: Should be assert only. */
	if (pipe)
	{
	if (pipe) {
		assert(pipe->stream);
		if ((!pipe) || (!pipe->stream)) {
			ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
@@ -620,8 +612,7 @@ free_mipi_frames(struct ia_css_pipe *pipe) {
			}
#endif
		}
	} else   /* pipe ==NULL */
	{
	} else { /* pipe ==NULL */
		/* AM TEMP: free-ing all mipi buffers just like a legacy code. */
		for (port = CSI_PORT0_ID; port < N_CSI_PORTS; port++) {
			unsigned int i;
@@ -645,7 +636,8 @@ free_mipi_frames(struct ia_css_pipe *pipe) {
}

int
send_mipi_frames(struct ia_css_pipe *pipe) {
send_mipi_frames(struct ia_css_pipe *pipe)
{
	int err = -EINVAL;
	unsigned int i;
#ifndef ISP2401
@@ -658,8 +650,7 @@ send_mipi_frames(struct ia_css_pipe *pipe) {

	assert(pipe);
	assert(pipe->stream);
	if (!pipe || !pipe->stream)
	{
	if (!pipe || !pipe->stream) {
		IA_CSS_ERROR("pipe or stream is null");
		return -EINVAL;
	}
@@ -686,8 +677,7 @@ send_mipi_frames(struct ia_css_pipe *pipe) {
	}

	/* Hand-over the SP-internal mipi buffers */
	for (i = 0; i < my_css.num_mipi_frames[port]; i++)
	{
	for (i = 0; i < my_css.num_mipi_frames[port]; i++) {
		/* Need to include the ofset for port. */
		sh_css_update_host2sp_mipi_frame(port * NUM_MIPI_FRAMES_PER_STREAM + i,
						 my_css.mipi_frames[port][i]);
@@ -700,8 +690,7 @@ send_mipi_frames(struct ia_css_pipe *pipe) {
	 * Send an event to inform the SP
	 * that all MIPI frames are passed.
	 **********************************/
	if (!sh_css_sp_is_running())
	{
	if (!sh_css_sp_is_running()) {
		/* SP is not running. The queues are not valid */
		IA_CSS_ERROR("sp is not running");
		return err;
+76 −95
Original line number Diff line number Diff line
@@ -813,15 +813,15 @@ convert_allocate_fpntbl(struct ia_css_isp_parameters *params)
}

static int
store_fpntbl(struct ia_css_isp_parameters *params, ia_css_ptr ptr) {
store_fpntbl(struct ia_css_isp_parameters *params, ia_css_ptr ptr)
{
	struct ia_css_host_data *isp_data;

	assert(params);
	assert(ptr != mmgr_NULL);

	isp_data = convert_allocate_fpntbl(params);
	if (!isp_data)
	{
	if (!isp_data) {
		IA_CSS_LEAVE_ERR_PRIVATE(-ENOMEM);
		return -ENOMEM;
	}
@@ -894,7 +894,8 @@ ia_css_process_kernel(struct ia_css_stream *stream,

static int
sh_css_select_dp_10bpp_config(const struct ia_css_pipe *pipe,
			      bool *is_dp_10bpp) {
			      bool *is_dp_10bpp)
{
	int err = 0;
	/* Currently we check if 10bpp DPC configuration is required based
	 * on the use case,i.e. if BDS and DPC is both enabled. The more cleaner
@@ -903,12 +904,10 @@ sh_css_select_dp_10bpp_config(const struct ia_css_pipe *pipe,
	 * implementation. (This is because the configuration is set before a
	 * binary is selected, and the binary info is not available)
	 */
	if ((!pipe) || (!is_dp_10bpp))
	{
	if ((!pipe) || (!is_dp_10bpp)) {
		IA_CSS_LEAVE_ERR_PRIVATE(-EINVAL);
		err = -EINVAL;
	} else
	{
	} else {
		*is_dp_10bpp = false;

		/* check if DPC is enabled from the host */
@@ -936,7 +935,8 @@ sh_css_select_dp_10bpp_config(const struct ia_css_pipe *pipe,

int
sh_css_set_black_frame(struct ia_css_stream *stream,
		       const struct ia_css_frame *raw_black_frame) {
		       const struct ia_css_frame *raw_black_frame)
{
	struct ia_css_isp_parameters *params;
	/* this function desperately needs to be moved to the ISP or SP such
	 * that it can use the DMA.
@@ -957,13 +957,11 @@ sh_css_set_black_frame(struct ia_css_stream *stream,
	IA_CSS_ENTER_PRIVATE("black_frame=%p", raw_black_frame);

	if (params->fpn_config.data &&
	    (params->fpn_config.width != width || params->fpn_config.height != height))
	{
	    (params->fpn_config.width != width || params->fpn_config.height != height)) {
		kvfree(params->fpn_config.data);
		params->fpn_config.data = NULL;
	}
	if (!params->fpn_config.data)
	{
	if (!params->fpn_config.data) {
		params->fpn_config.data = kvmalloc(height * width *
						   sizeof(short), GFP_KERNEL);
		if (!params->fpn_config.data) {
@@ -977,8 +975,7 @@ sh_css_set_black_frame(struct ia_css_stream *stream,
	}

	/* store raw to fpntbl */
	for (y = 0; y < height; y++)
	{
	for (y = 0; y < height; y++) {
		for (x = 0; x < width; x += (ISP_VEC_NELEMS * 2)) {
			int ofs = y * width + x;

@@ -1181,7 +1178,8 @@ sh_css_enable_pipeline(const struct ia_css_binary *binary)
static int
ia_css_process_zoom_and_motion(
    struct ia_css_isp_parameters *params,
    const struct ia_css_pipeline_stage *first_stage) {
    const struct ia_css_pipeline_stage *first_stage)
{
	/* first_stage can be  NULL */
	const struct ia_css_pipeline_stage *stage;
	int err = 0;
@@ -1195,8 +1193,7 @@ ia_css_process_zoom_and_motion(
	IA_CSS_ENTER_PRIVATE("");

	/* Go through all stages to udate uds and cropping */
	for (stage = first_stage; stage; stage = stage->next)
	{
	for (stage = first_stage; stage; stage = stage->next) {
		struct ia_css_binary *binary;
		/* note: the var below is made static as it is quite large;
		   if it is not static it ends up on the stack which could
@@ -1581,7 +1578,8 @@ ia_css_isp_3a_statistics_map_allocate(

int
ia_css_get_3a_statistics(struct ia_css_3a_statistics           *host_stats,
			 const struct ia_css_isp_3a_statistics *isp_stats) {
			 const struct ia_css_isp_3a_statistics *isp_stats)
{
	struct ia_css_isp_3a_statistics_map *map;
	int ret = 0;

@@ -1591,13 +1589,11 @@ ia_css_get_3a_statistics(struct ia_css_3a_statistics *host_stats,
	assert(isp_stats);

	map = ia_css_isp_3a_statistics_map_allocate(isp_stats, NULL);
	if (map)
	{
	if (map) {
		hmm_load(isp_stats->data_ptr, map->data_ptr, isp_stats->size);
		ia_css_translate_3a_statistics(host_stats, map);
		ia_css_isp_3a_statistics_map_free(map);
	} else
	{
	} else {
		IA_CSS_ERROR("out of memory");
		ret = -ENOMEM;
	}
@@ -1894,7 +1890,8 @@ sh_css_pipe_isp_config_get(struct ia_css_pipe *pipe)
int
ia_css_stream_set_isp_config(
    struct ia_css_stream *stream,
    const struct ia_css_isp_config *config) {
    const struct ia_css_isp_config *config)
{
	return ia_css_stream_set_isp_config_on_pipe(stream, config, NULL);
}

@@ -1902,7 +1899,8 @@ int
ia_css_stream_set_isp_config_on_pipe(
    struct ia_css_stream *stream,
    const struct ia_css_isp_config *config,
    struct ia_css_pipe *pipe) {
    struct ia_css_pipe *pipe)
{
	int err = 0;

	if ((!stream) || (!config))
@@ -1923,7 +1921,8 @@ ia_css_stream_set_isp_config_on_pipe(

int
ia_css_pipe_set_isp_config(struct ia_css_pipe *pipe,
			   struct ia_css_isp_config *config) {
			   struct ia_css_isp_config *config)
{
	struct ia_css_pipe *pipe_in = pipe;
	int err = 0;

@@ -1948,7 +1947,8 @@ static int
sh_css_set_global_isp_config_on_pipe(
    struct ia_css_pipe *curr_pipe,
    const struct ia_css_isp_config *config,
    struct ia_css_pipe *pipe) {
    struct ia_css_pipe *pipe)
{
	int err = 0;
	int err1 = 0;
	int err2 = 0;
@@ -1977,7 +1977,8 @@ static int
sh_css_set_per_frame_isp_config_on_pipe(
    struct ia_css_stream *stream,
    const struct ia_css_isp_config *config,
    struct ia_css_pipe *pipe) {
    struct ia_css_pipe *pipe)
{
	unsigned int i;
	bool per_frame_config_created = false;
	int err = 0;
@@ -1991,8 +1992,7 @@ sh_css_set_per_frame_isp_config_on_pipe(

	IA_CSS_ENTER_PRIVATE("stream=%p, config=%p, pipe=%p", stream, config, pipe);

	if (!pipe)
	{
	if (!pipe) {
		err = -EINVAL;
		goto exit;
	}
@@ -2000,8 +2000,7 @@ sh_css_set_per_frame_isp_config_on_pipe(
	/* create per-frame ISP params object with default values
	 * from stream->isp_params_configs if one doesn't already exist
	*/
	if (!stream->per_frame_isp_params_configs)
	{
	if (!stream->per_frame_isp_params_configs) {
		err = sh_css_create_isp_params(stream,
					       &stream->per_frame_isp_params_configs);
		if (err)
@@ -2012,15 +2011,13 @@ sh_css_set_per_frame_isp_config_on_pipe(
	params = stream->per_frame_isp_params_configs;

	/* update new ISP params object with the new config */
	if (!sh_css_init_isp_params_from_global(stream, params, false, pipe))
	{
	if (!sh_css_init_isp_params_from_global(stream, params, false, pipe)) {
		err1 = -EINVAL;
	}

	err2 = sh_css_init_isp_params_from_config(stream->pipes[0], params, config, pipe);

	if (per_frame_config_created)
	{
	if (per_frame_config_created) {
		ddr_ptrs = &params->ddr_ptrs;
		ddr_ptrs_size = &params->ddr_ptrs_size;
		/* create per pipe reference to general ddr_ptrs */
@@ -2051,7 +2048,8 @@ static int
sh_css_init_isp_params_from_config(struct ia_css_pipe *pipe,
				   struct ia_css_isp_parameters *params,
				   const struct ia_css_isp_config *config,
				   struct ia_css_pipe *pipe_in) {
				   struct ia_css_pipe *pipe_in)
{
	int err = 0;
	bool is_dp_10bpp = true;

@@ -2096,8 +2094,7 @@ sh_css_init_isp_params_from_config(struct ia_css_pipe *pipe,
	}

	if (0 ==
	    sh_css_select_dp_10bpp_config(pipe, &is_dp_10bpp))
	{
	    sh_css_select_dp_10bpp_config(pipe, &is_dp_10bpp)) {
		/* return an error when both DPC and BDS is enabled by the
		 * user. */
		/* we do not exit from this point immediately to allow internal
@@ -2105,8 +2102,7 @@ sh_css_init_isp_params_from_config(struct ia_css_pipe *pipe,
		if (is_dp_10bpp) {
			err = -EINVAL;
		}
	} else
	{
	} else {
		err = -EINVAL;
		goto exit;
	}
@@ -2359,7 +2355,8 @@ static unsigned int g_param_buffer_dequeue_count;
static unsigned int g_param_buffer_enqueue_count;

int
ia_css_stream_isp_parameters_init(struct ia_css_stream *stream) {
ia_css_stream_isp_parameters_init(struct ia_css_stream *stream)
{
	int err = 0;
	unsigned int i;
	struct sh_css_ddr_address_map *ddr_ptrs;
@@ -2369,8 +2366,7 @@ ia_css_stream_isp_parameters_init(struct ia_css_stream *stream) {
	assert(stream);
	IA_CSS_ENTER_PRIVATE("void");

	if (!stream)
	{
	if (!stream) {
		IA_CSS_LEAVE_ERR_PRIVATE(-EINVAL);
		return -EINVAL;
	}
@@ -2385,8 +2381,7 @@ ia_css_stream_isp_parameters_init(struct ia_css_stream *stream) {
		goto ERR;

	params = stream->isp_params_configs;
	if (!sh_css_init_isp_params_from_global(stream, params, true, NULL))
	{
	if (!sh_css_init_isp_params_from_global(stream, params, true, NULL)) {
		/* we do not return the error immediately to enable internal
		 * firmware feature testing */
		err = -EINVAL;
@@ -2396,8 +2391,7 @@ ia_css_stream_isp_parameters_init(struct ia_css_stream *stream) {
	ddr_ptrs_size = &params->ddr_ptrs_size;

	/* create per pipe reference to general ddr_ptrs */
	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++)
	{
	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++) {
		ref_sh_css_ddr_address_map(ddr_ptrs, &params->pipe_ddr_ptrs[i]);
		params->pipe_ddr_ptrs_size[i] = *ddr_ptrs_size;
	}
@@ -2431,7 +2425,8 @@ ia_css_set_sdis2_config(

static int
sh_css_create_isp_params(struct ia_css_stream *stream,
			 struct ia_css_isp_parameters **isp_params_out) {
			 struct ia_css_isp_parameters **isp_params_out)
{
	bool succ = true;
	unsigned int i;
	struct sh_css_ddr_address_map *ddr_ptrs;
@@ -2441,23 +2436,20 @@ sh_css_create_isp_params(struct ia_css_stream *stream,
	struct ia_css_isp_parameters *params =
	kvmalloc(sizeof(struct ia_css_isp_parameters), GFP_KERNEL);

	if (!params)
	{
	if (!params) {
		*isp_params_out = NULL;
		err = -ENOMEM;
		IA_CSS_ERROR("%s:%d error: cannot allocate memory", __FILE__, __LINE__);
		IA_CSS_LEAVE_ERR_PRIVATE(err);
		return err;
	} else
	{
	} else {
		memset(params, 0, sizeof(struct ia_css_isp_parameters));
	}

	ddr_ptrs = &params->ddr_ptrs;
	ddr_ptrs_size = &params->ddr_ptrs_size;

	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++)
	{
	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++) {
		memset(&params->pipe_ddr_ptrs[i], 0,
		       sizeof(params->pipe_ddr_ptrs[i]));
		memset(&params->pipe_ddr_ptrs_size[i], 0,
@@ -2714,7 +2706,8 @@ sh_css_init_isp_params_from_global(struct ia_css_stream *stream,
}

int
sh_css_params_init(void) {
sh_css_params_init(void)
{
	int i, p;

	IA_CSS_ENTER_PRIVATE("void");
@@ -2723,8 +2716,7 @@ sh_css_params_init(void) {
	g_param_buffer_dequeue_count = 0;
	g_param_buffer_enqueue_count = 0;

	for (p = 0; p < IA_CSS_PIPE_ID_NUM; p++)
	{
	for (p = 0; p < IA_CSS_PIPE_ID_NUM; p++) {
		for (i = 0; i < SH_CSS_MAX_STAGES; i++) {
			xmem_sp_stage_ptrs[p][i] =
			ia_css_refcount_increment(-1,
@@ -2762,8 +2754,7 @@ sh_css_params_init(void) {
								 ATOMISP_MAP_FLAG_CLEARED));

	if ((sp_ddr_ptrs == mmgr_NULL) ||
	    (xmem_sp_group_ptrs == mmgr_NULL))
	{
	    (xmem_sp_group_ptrs == mmgr_NULL)) {
		ia_css_uninit();
		IA_CSS_LEAVE_ERR_PRIVATE(-ENOMEM);
		return -ENOMEM;
@@ -3094,14 +3085,14 @@ store_morph_plane(
    unsigned int width,
    unsigned int height,
    ia_css_ptr dest,
    unsigned int aligned_width) {
    unsigned int aligned_width)
{
	struct ia_css_host_data *isp_data;

	assert(dest != mmgr_NULL);

	isp_data = convert_allocate_morph_plane(data, width, height, aligned_width);
	if (!isp_data)
	{
	if (!isp_data) {
		IA_CSS_LEAVE_ERR_PRIVATE(-ENOMEM);
		return -ENOMEM;
	}
@@ -3221,7 +3212,8 @@ int
sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
			       struct ia_css_isp_parameters *params,
			       bool commit,
			       struct ia_css_pipe *pipe_in) {
			       struct ia_css_pipe *pipe_in)
{
	int err = 0;
	ia_css_ptr cpy;
	int i;
@@ -3238,15 +3230,13 @@ sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe,
	raw_bit_depth = ia_css_stream_input_format_bits_per_pixel(curr_pipe->stream);

	/* now make the map available to the sp */
	if (!commit)
	{
	if (!commit) {
		IA_CSS_LEAVE_ERR_PRIVATE(err);
		return err;
	}
	/* enqueue a copies of the mem_map to
	   the designated pipelines */
	for (i = 0; i < curr_pipe->stream->num_pipes; i++)
	{
	for (i = 0; i < curr_pipe->stream->num_pipes; i++) {
		struct ia_css_pipe *pipe;
		struct sh_css_ddr_address_map *cur_map;
		struct sh_css_ddr_address_map_size *cur_map_size;
@@ -3430,7 +3420,8 @@ sh_css_params_write_to_ddr_internal(
    struct ia_css_isp_parameters *params,
    const struct ia_css_pipeline_stage *stage,
    struct sh_css_ddr_address_map *ddr_map,
    struct sh_css_ddr_address_map_size *ddr_map_size) {
    struct sh_css_ddr_address_map_size *ddr_map_size)
{
	int err;
	const struct ia_css_binary *binary;

@@ -3452,8 +3443,7 @@ sh_css_params_write_to_ddr_internal(

	stage_num = stage->stage_num;

	if (binary->info->sp.enable.fpnr)
	{
	if (binary->info->sp.enable.fpnr) {
		buff_realloced = reallocate_buffer(&ddr_map->fpn_tbl,
						   &ddr_map_size->fpn_tbl,
						   (size_t)(FPNTBL_BYTES(binary)),
@@ -3474,8 +3464,7 @@ sh_css_params_write_to_ddr_internal(
		}
	}

	if (binary->info->sp.enable.sc)
	{
	if (binary->info->sp.enable.sc) {
		u32 enable_conv;
		size_t bytes;

@@ -3577,8 +3566,7 @@ sh_css_params_write_to_ddr_internal(
	 * DPC kernel. The code below sets the pipe specific configuration to
	 * individual binaries. */
	if (IS_ISP2401 &&
	    params->pipe_dpc_config_changed[pipe_id] && binary->info->sp.enable.dpc)
	{
	    params->pipe_dpc_config_changed[pipe_id] && binary->info->sp.enable.dpc) {
		unsigned int size   =
		    stage->binary->info->mem_offsets.offsets.param->dmem.dp.size;

@@ -3596,8 +3584,7 @@ sh_css_params_write_to_ddr_internal(
		}
	}

	if (params->config_changed[IA_CSS_MACC_ID] && binary->info->sp.enable.macc)
	{
	if (params->config_changed[IA_CSS_MACC_ID] && binary->info->sp.enable.macc) {
		unsigned int i, j, idx;
		unsigned int idx_map[] = {
			0, 1, 3, 2, 6, 7, 5, 4, 12, 13, 15, 14, 10, 11, 9, 8
@@ -3646,8 +3633,7 @@ sh_css_params_write_to_ddr_internal(
			   sizeof(converted_macc_table.data));
	}

	if (binary->info->sp.enable.dvs_6axis)
	{
	if (binary->info->sp.enable.dvs_6axis) {
		/* because UV is packed into the Y plane, calc total
		 * YYU size = /2 gives size of UV-only,
		 * total YYU size = UV-only * 3.
@@ -3705,8 +3691,7 @@ sh_css_params_write_to_ddr_internal(
		}
	}

	if (binary->info->sp.enable.ca_gdc)
	{
	if (binary->info->sp.enable.ca_gdc) {
		unsigned int i;
		ia_css_ptr *virt_addr_tetra_x[

@@ -3811,8 +3796,7 @@ sh_css_params_write_to_ddr_internal(
	}

	/* After special cases like SC, FPN since they may change parameters */
	for (mem = 0; mem < N_IA_CSS_MEMORIES; mem++)
	{
	for (mem = 0; mem < N_IA_CSS_MEMORIES; mem++) {
		const struct ia_css_isp_data *isp_data =
		    ia_css_isp_param_get_isp_mem_init(&binary->info->sp.mem_initializers,
						    IA_CSS_PARAM_CLASS_PARAM, mem);
@@ -4025,7 +4009,8 @@ static int write_ia_css_isp_parameter_set_info_to_ddr(

static int
free_ia_css_isp_parameter_set_info(
    ia_css_ptr ptr) {
    ia_css_ptr ptr)
{
	int err = 0;
	struct ia_css_isp_parameter_set_info isp_params_info;
	unsigned int i;
@@ -4034,8 +4019,7 @@ free_ia_css_isp_parameter_set_info(
	IA_CSS_ENTER_PRIVATE("ptr = %u", ptr);

	/* sanity check - ptr must be valid */
	if (!ia_css_refcount_is_valid(ptr))
	{
	if (!ia_css_refcount_is_valid(ptr)) {
		IA_CSS_ERROR("%s: IA_CSS_REFCOUNT_PARAM_SET_POOL(0x%x) invalid arg", __func__,
			     ptr);
		err = -EINVAL;
@@ -4046,8 +4030,7 @@ free_ia_css_isp_parameter_set_info(
	hmm_load(ptr, &isp_params_info.mem_map, sizeof(struct sh_css_ddr_address_map));
	/* copy map using size info */
	for (i = 0; i < (sizeof(struct sh_css_ddr_address_map_size) /
			 sizeof(size_t)); i++)
	{
			 sizeof(size_t)); i++) {
		if (addrs[i] == mmgr_NULL)
			continue;

@@ -4254,7 +4237,8 @@ sh_css_update_uds_and_crop_info_based_on_zoom_region(
    struct sh_css_uds_info *uds,		/* out */
    struct sh_css_crop_pos *sp_out_crop_pos,	/* out */
    struct ia_css_resolution pipe_in_res,
    bool enable_zoom) {
    bool enable_zoom)
{
	unsigned int x0 = 0, y0 = 0, x1 = 0, y1 = 0;
	int err = 0;
	/* Note:
@@ -4285,19 +4269,16 @@ sh_css_update_uds_and_crop_info_based_on_zoom_region(
	if ((x0 > x1) || (y0 > y1) || (x1 > pipe_in_res.width) || (y1 > pipe_in_res.height))
		return -EINVAL;

	if (!enable_zoom)
	{
	if (!enable_zoom) {
		uds->curr_dx = HRT_GDC_N;
		uds->curr_dy = HRT_GDC_N;
	}

	if (info->enable.dvs_envelope)
	{
	if (info->enable.dvs_envelope) {
		/* Zoom region is only supported by the UDS module on ISP
		 * 2 and higher. It is not supported in video mode on ISP 1 */
		return -EINVAL;
	} else
	{
	} else {
		if (enable_zoom) {
			/* A. Calculate dx/dy based on crop region using in_frame_info
			* Scale the crop region if in_frame_info to the stage is not same as
+48 −60

File changed.

Preview size limit exceeded, changes collapsed.

+2 −1
Original line number Diff line number Diff line
@@ -21,7 +21,8 @@
#include "sh_css_firmware.h"

int
ia_css_get_version(char *version, int max_size) {
ia_css_get_version(char *version, int max_size)
{
	char *css_version;

	if (!IS_ISP2401)