Commit 3c0538fb authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: atomisp: get rid of most checks for ISP2401 version



There are lots of places inside this driver checking for
ISP2400/ISP2401 verison. Get rid of most of those, while
keep building for both.

Most of stuff in this patch is trivial to solve.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent f0648058
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -4797,10 +4797,8 @@ static void __atomisp_update_stream_env(struct atomisp_sub_device *asd,
{
	int i;

#if defined(ISP2401_NEW_INPUT_SYSTEM)
	/* assign virtual channel id return from sensor driver query */
	asd->stream_env[stream_index].ch_id = stream_info->ch_id;
#endif
	asd->stream_env[stream_index].isys_configs = stream_info->isys_configs;
	for (i = 0; i < stream_info->isys_configs; i++) {
		asd->stream_env[stream_index].isys_info[i].input_format =
+3 −6
Original line number Diff line number Diff line
@@ -196,9 +196,7 @@ bool ia_css_refcount_decrement(s32 id, hrt_vaddress ptr)
			     id, ptr, entry, entry->id, entry->count);
	else
		IA_CSS_ERROR("entry NULL\n");
#ifdef ISP2401
	assert(false);
#endif

	return false;
}
@@ -246,14 +244,13 @@ void ia_css_refcount_clear(s32 id, clear_func clear_func_ptr)
						    "ia_css_refcount_clear: using hmm_free: no clear_func\n");
				hmm_free(entry->data);
			}
#ifndef ISP2401

#else
			assert(entry->count == 0);
#endif
			if (entry->count != 0) {
				IA_CSS_WARNING("Ref count for entry %x is not zero!", entry->id);
			}

			assert(entry->count == 0);

			entry->data = mmgr_NULL;
			entry->count = 0;
			entry->id = 0;
+14 −20
Original line number Diff line number Diff line
@@ -57,10 +57,8 @@ static void pipe_binarydesc_get_offline(
	descr->enable_dz = true;
	descr->enable_xnr = false;
	descr->enable_dpc = false;
#ifdef ISP2401
	descr->enable_luma_only = false;
	descr->enable_tnr = false;
#endif
	descr->enable_capture_pp_bli = false;
	descr->enable_fractional_ds = false;
	descr->dvs_env.width = 0;
@@ -391,12 +389,10 @@ enum ia_css_err ia_css_pipe_get_video_binarydesc(
		    pipe->extra_config.enable_fractional_ds;
		video_descr->enable_dpc =
		    pipe->config.enable_dpc;
#ifdef ISP2401
		video_descr->enable_luma_only =
		    pipe->config.enable_luma_only;
		video_descr->enable_tnr =
		    pipe->config.enable_tnr;
#endif

		if (pipe->extra_config.enable_raw_binning) {
			if (pipe->config.bayer_ds_out_res.width != 0 &&
@@ -603,27 +599,24 @@ void ia_css_pipe_get_primary_binarydesc(
		prim_descr->isp_pipe_version = pipe->config.isp_pipe_version;
		prim_descr->enable_fractional_ds =
		    pipe->extra_config.enable_fractional_ds;
#ifdef ISP2401
		prim_descr->enable_luma_only =
		    pipe->config.enable_luma_only;
#endif
		/* We have both striped and non-striped primary binaries,
		 * if continuous viewfinder is required, then we must select
		 * a striped one. Otherwise we prefer to use a non-striped
		 * since it has better performance. */
		if (pipe_version == IA_CSS_PIPE_VERSION_2_6_1)
			prim_descr->striped = false;
		else
#ifndef ISP2401
		else if (!atomisp_hw_is_isp2401) {
			prim_descr->striped = prim_descr->continuous &&
					      (!pipe->stream->stop_copy_preview || !pipe->stream->disable_cont_vf);
#else
		} else {
			prim_descr->striped = prim_descr->continuous && !pipe->stream->disable_cont_vf;

			if ((pipe->config.default_capture_config.enable_xnr != 0) &&
			    (pipe->extra_config.enable_dvs_6axis == true))
				prim_descr->enable_xnr = true;
#endif
		}
	}
	IA_CSS_LEAVE_PRIVATE("");
}
@@ -855,14 +848,15 @@ void ia_css_pipe_get_ldc_binarydesc(
	assert(out_info);
	IA_CSS_ENTER_PRIVATE("");

#ifndef ISP2401
	if (!atomisp_hw_is_isp2401) {
		*in_info = *out_info;
#else
	} else {
		if (pipe->out_yuv_ds_input_info.res.width)
			*in_info = pipe->out_yuv_ds_input_info;
		else
			*in_info = *out_info;
#endif
	}

	in_info->format = IA_CSS_FRAME_FORMAT_YUV420;
	in_info->raw_bit_depth = 0;
	ia_css_frame_info_set_width(in_info, in_info->res.width, 0);
+0 −2
Original line number Diff line number Diff line
@@ -210,11 +210,9 @@ enum ia_css_err ia_css_util_check_input(
	if (!stream_config)
		return IA_CSS_ERR_INVALID_ARGUMENTS;

#ifdef IS_ISP_2400_SYSTEM
	if (stream_config->input_config.effective_res.width == 0 ||
	    stream_config->input_config.effective_res.height == 0)
		return IA_CSS_ERR_INVALID_ARGUMENTS;
#endif
	if (must_be_raw &&
	    !ia_css_util_is_input_format_raw(stream_config->input_config.format))
		return IA_CSS_ERR_INVALID_ARGUMENTS;
+1 −2
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@

#include "ia_css_dp.host.h"

#ifdef ISP2401
/* We use a different set of DPC configuration parameters when
 * DPC is used before OBC and NORM. Currently these parameters
 * are used in usecases which selects both BDS and DPC.
@@ -32,7 +31,7 @@ const struct ia_css_dp_config default_dp_10bpp_config = {
	32768,
	32768
};
#endif

const struct ia_css_dp_config default_dp_config = {
	8192,
	2048,
Loading