Commit 7796e455 authored by Martiros Shakhzadyan's avatar Martiros Shakhzadyan Committed by Mauro Carvalho Chehab
Browse files

media: staging: media: atomisp: Fix alignment and line length issues



Fix alignment style issues and adjacent line length issues in sh_css.c

Signed-off-by: default avatarMartiros Shakhzadyan <vrzh@vrzh.net>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent d4bc34d1
Loading
Loading
Loading
Loading
+333 −286
Original line number Diff line number Diff line
@@ -239,8 +239,8 @@ 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 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);
@@ -2996,8 +2996,7 @@ static int add_firmwares(

		ia_css_pipe_get_firmwares_stage_desc(&stage_desc, binary,
						     out, in, vf, fw, binary_mode);
		err = ia_css_pipeline_create_and_add_stage(me,
			&stage_desc,
		err = ia_css_pipeline_create_and_add_stage(me, &stage_desc,
							   &extra_stage);
		if (err)
			return err;
@@ -3106,8 +3105,7 @@ static int add_yuv_scaler_stage(
		ia_css_pipe_get_generic_stage_desc(&stage_desc,
						   yuv_scaler_binary, out_frames, in_frame, vf_frame);
	}
	err = ia_css_pipeline_create_and_add_stage(me,
		&stage_desc,
	err = ia_css_pipeline_create_and_add_stage(me, &stage_desc,
						   pre_vf_pp_stage);
	if (err)
		return err;
@@ -3166,8 +3164,7 @@ static int add_capture_pp_stage(
		ia_css_pipe_get_generic_stage_desc(&stage_desc,
						   capture_pp_binary, out_frames, NULL, vf_frame);
	}
	err = ia_css_pipeline_create_and_add_stage(me,
		&stage_desc,
	err = ia_css_pipeline_create_and_add_stage(me, &stage_desc,
						   capture_pp_stage);
	if (err)
		return err;
@@ -3523,8 +3520,7 @@ static int create_host_video_pipeline(struct ia_css_pipe *pipe)
		ia_css_pipe_util_set_output_frames(out_frames, 0, NULL);
		ia_css_pipe_get_generic_stage_desc(&stage_desc, copy_binary,
						   out_frames, NULL, NULL);
		err = ia_css_pipeline_create_and_add_stage(me,
			&stage_desc,
		err = ia_css_pipeline_create_and_add_stage(me, &stage_desc,
							   &copy_stage);
		if (err)
			goto ERR;
@@ -3552,8 +3548,7 @@ static int create_host_video_pipeline(struct ia_css_pipe *pipe)
		ia_css_pipe_get_generic_stage_desc(&stage_desc, video_binary,
						   out_frames, in_frame, vf_frame);
	}
	err = ia_css_pipeline_create_and_add_stage(me,
		&stage_desc,
	err = ia_css_pipeline_create_and_add_stage(me, &stage_desc,
						   &video_stage);
	if (err)
		goto ERR;
@@ -3619,8 +3614,8 @@ static int create_host_video_pipeline(struct ia_css_pipe *pipe)
		for (i = 0; i < num_yuv_scaler; i++) {
			tmp_out_frame = is_output_stage[i] ? out_frame : NULL;

			err = add_yuv_scaler_stage(pipe, me, tmp_in_frame, tmp_out_frame,
						   NULL,
			err = add_yuv_scaler_stage(pipe, me, tmp_in_frame,
						   tmp_out_frame, NULL,
						   &yuv_scaler_binary[i],
						   &yuv_scaler_stage);

@@ -3759,8 +3754,7 @@ create_host_preview_pipeline(struct ia_css_pipe *pipe)
		ia_css_pipe_util_set_output_frames(out_frames, 0, NULL);
		ia_css_pipe_get_generic_stage_desc(&stage_desc, copy_binary,
						   out_frames, NULL, NULL);
		err = ia_css_pipeline_create_and_add_stage(me,
			&stage_desc,
		err = ia_css_pipeline_create_and_add_stage(me, &stage_desc,
							   &copy_stage);
		if (err)
			goto ERR;
@@ -3787,8 +3781,7 @@ create_host_preview_pipeline(struct ia_css_pipe *pipe)
		ia_css_pipe_get_generic_stage_desc(&stage_desc, preview_binary,
						   out_frames, in_frame, NULL);
	}
	err = ia_css_pipeline_create_and_add_stage(me,
		&stage_desc,
	err = ia_css_pipeline_create_and_add_stage(me, &stage_desc,
						   &preview_stage);
	if (err)
		goto ERR;
@@ -6014,8 +6007,11 @@ static int load_primary_binaries(
			capt_pp_in_info = &prim_out_info;

		ia_css_pipe_get_capturepp_binarydesc(pipe,
							&capture_pp_descr, capt_pp_in_info,
							&capt_pp_out_info, &vf_info);
						     &capture_pp_descr,
						     capt_pp_in_info,
						     &capt_pp_out_info,
						     &vf_info);

		err = ia_css_binary_find(&capture_pp_descr,
					 &mycs->capture_pp_binary);
		if (err) {
@@ -6027,7 +6023,8 @@ static int load_primary_binaries(
			struct ia_css_binary_descr capt_ldc_descr;

			ia_css_pipe_get_ldc_binarydesc(pipe,
							&capt_ldc_descr, &prim_out_info,
						       &capt_ldc_descr,
						       &prim_out_info,
						       &capt_ldc_out_info);

			err = ia_css_binary_find(&capt_ldc_descr,
@@ -6048,8 +6045,9 @@ static int load_primary_binaries(
		if (pipe->enable_viewfinder[IA_CSS_PIPE_OUTPUT_STAGE_0] &&
		    (i == mycs->num_primary_stage - 1))
			local_vf_info = &vf_info;
		ia_css_pipe_get_primary_binarydesc(pipe, &prim_descr[i], &prim_in_info,
						    &prim_out_info, local_vf_info, i);
		ia_css_pipe_get_primary_binarydesc(pipe, &prim_descr[i],
						   &prim_in_info, &prim_out_info,
						   local_vf_info, i);
		err = ia_css_binary_find(&prim_descr[i], &mycs->primary_binary[i]);
		if (err) {
			IA_CSS_LEAVE_ERR_PRIVATE(err);
@@ -6231,8 +6229,9 @@ static int load_advanced_binaries(
	if (need_pp) {
		struct ia_css_binary_descr capture_pp_descr;

		ia_css_pipe_get_capturepp_binarydesc(pipe,
							&capture_pp_descr, &post_out_info, pipe_out_info, &vf_info);
		ia_css_pipe_get_capturepp_binarydesc(pipe, &capture_pp_descr,
						     &post_out_info,
						     pipe_out_info, &vf_info);
		err = ia_css_binary_find(&capture_pp_descr,
					 &pipe->pipe_settings.capture.capture_pp_binary);
		if (err)
@@ -6245,8 +6244,9 @@ static int load_advanced_binaries(
	{
		struct ia_css_binary_descr post_gdc_descr;

		ia_css_pipe_get_post_gdc_binarydesc(pipe,
						    &post_gdc_descr, &post_in_info, &post_out_info, &vf_info);
		ia_css_pipe_get_post_gdc_binarydesc(pipe, &post_gdc_descr,
						    &post_in_info,
						    &post_out_info, &vf_info);
		err = ia_css_binary_find(&post_gdc_descr,
					 &pipe->pipe_settings.capture.post_isp_binary);
		if (err)
@@ -6380,8 +6380,9 @@ static int load_low_light_binaries(
	if (need_pp) {
		struct ia_css_binary_descr capture_pp_descr;

		ia_css_pipe_get_capturepp_binarydesc(pipe,
							&capture_pp_descr, &post_out_info, pipe_out_info, &vf_info);
		ia_css_pipe_get_capturepp_binarydesc(pipe, &capture_pp_descr,
						     &post_out_info,
						     pipe_out_info, &vf_info);
		err = ia_css_binary_find(&capture_pp_descr,
					 &pipe->pipe_settings.capture.capture_pp_binary);
		if (err)
@@ -6442,8 +6443,8 @@ static int load_low_light_binaries(
	{
		struct ia_css_binary_descr vf_pp_descr;

		ia_css_pipe_get_vfpp_binarydesc(pipe,
						&vf_pp_descr, vf_pp_in_info, pipe_vf_out_info);
		ia_css_pipe_get_vfpp_binarydesc(pipe, &vf_pp_descr,
						vf_pp_in_info, pipe_vf_out_info);
		err = ia_css_binary_find(&vf_pp_descr,
					 &pipe->pipe_settings.capture.vf_pp_binary);
		if (err)
@@ -6670,31 +6671,36 @@ static int ia_css_pipe_create_cas_scaler_desc_single_output(
		i *= max_scale_factor_per_stage;
	}

	descr->in_info = kmalloc(descr->num_stage * sizeof(struct ia_css_frame_info),
	descr->in_info = kmalloc(descr->num_stage *
				 sizeof(struct ia_css_frame_info),
				 GFP_KERNEL);
	if (!descr->in_info) {
		err = -ENOMEM;
		goto ERR;
	}
	descr->internal_out_info = kmalloc(descr->num_stage * sizeof(
						struct ia_css_frame_info), GFP_KERNEL);
	descr->internal_out_info = kmalloc(descr->num_stage *
					   sizeof(struct ia_css_frame_info),
					   GFP_KERNEL);
	if (!descr->internal_out_info) {
		err = -ENOMEM;
		goto ERR;
	}
	descr->out_info = kmalloc(descr->num_stage * sizeof(struct ia_css_frame_info),
	descr->out_info = kmalloc(descr->num_stage *
				  sizeof(struct ia_css_frame_info),
				  GFP_KERNEL);
	if (!descr->out_info) {
		err = -ENOMEM;
		goto ERR;
	}
	descr->vf_info = kmalloc(descr->num_stage * sizeof(struct ia_css_frame_info),
	descr->vf_info = kmalloc(descr->num_stage *
				 sizeof(struct ia_css_frame_info),
				 GFP_KERNEL);
	if (!descr->vf_info) {
		err = -ENOMEM;
		goto ERR;
	}
	descr->is_output_stage = kmalloc(descr->num_stage * sizeof(bool), GFP_KERNEL);
	descr->is_output_stage = kmalloc(descr->num_stage * sizeof(bool),
					 GFP_KERNEL);
	if (!descr->is_output_stage) {
		err = -ENOMEM;
		goto ERR;
@@ -6816,30 +6822,35 @@ static int ia_css_pipe_create_cas_scaler_desc(
	descr->num_stage = num_stages;

	descr->in_info = kmalloc_array(descr->num_stage,
					sizeof(struct ia_css_frame_info), GFP_KERNEL);
				       sizeof(struct ia_css_frame_info),
				       GFP_KERNEL);
	if (!descr->in_info) {
		err = -ENOMEM;
		goto ERR;
	}
	descr->internal_out_info = kmalloc(descr->num_stage * sizeof(
						struct ia_css_frame_info), GFP_KERNEL);
	descr->internal_out_info = kmalloc(descr->num_stage *
					   sizeof(struct ia_css_frame_info),
					   GFP_KERNEL);
	if (!descr->internal_out_info) {
		err = -ENOMEM;
		goto ERR;
	}
	descr->out_info = kmalloc(descr->num_stage * sizeof(struct ia_css_frame_info),
	descr->out_info = kmalloc(descr->num_stage *
				  sizeof(struct ia_css_frame_info),
				  GFP_KERNEL);
	if (!descr->out_info) {
		err = -ENOMEM;
		goto ERR;
	}
	descr->vf_info = kmalloc(descr->num_stage * sizeof(struct ia_css_frame_info),
	descr->vf_info = kmalloc(descr->num_stage *
				 sizeof(struct ia_css_frame_info),
				 GFP_KERNEL);
	if (!descr->vf_info) {
		err = -ENOMEM;
		goto ERR;
	}
	descr->is_output_stage = kmalloc(descr->num_stage * sizeof(bool), GFP_KERNEL);
	descr->is_output_stage = kmalloc(descr->num_stage * sizeof(bool),
					 GFP_KERNEL);
	if (!descr->is_output_stage) {
		err = -ENOMEM;
		goto ERR;
@@ -6984,7 +6995,8 @@ load_yuvpp_binaries(struct ia_css_pipe *pipe)
		mycs->num_output = cas_scaler_descr.num_output_stage;
		mycs->num_yuv_scaler = cas_scaler_descr.num_stage;
		mycs->yuv_scaler_binary = kzalloc(cas_scaler_descr.num_stage *
						    sizeof(struct ia_css_binary), GFP_KERNEL);
						  sizeof(struct ia_css_binary),
						  GFP_KERNEL);
		if (!mycs->yuv_scaler_binary) {
			err = -ENOMEM;
			goto ERR;
@@ -6998,7 +7010,8 @@ load_yuvpp_binaries(struct ia_css_pipe *pipe)
		for (i = 0; i < cas_scaler_descr.num_stage; i++) {
			mycs->is_output_stage[i] = cas_scaler_descr.is_output_stage[i];
			ia_css_pipe_get_yuvscaler_binarydesc(pipe,
								&yuv_scaler_descr, &cas_scaler_descr.in_info[i],
							     &yuv_scaler_descr,
							     &cas_scaler_descr.in_info[i],
							     &cas_scaler_descr.out_info[i],
							     &cas_scaler_descr.internal_out_info[i],
							     &cas_scaler_descr.vf_info[i]);
@@ -7089,7 +7102,8 @@ load_yuvpp_binaries(struct ia_css_pipe *pipe)

		mycs->num_vf_pp = 1;
	}
	mycs->vf_pp_binary = kzalloc(mycs->num_vf_pp * sizeof(struct ia_css_binary),
	mycs->vf_pp_binary = kzalloc(mycs->num_vf_pp *
				     sizeof(struct ia_css_binary),
				     GFP_KERNEL);
	if (!mycs->vf_pp_binary) {
		err = -ENOMEM;
@@ -7419,13 +7433,21 @@ create_host_yuvpp_pipeline(struct ia_css_pipe *pipe)
#endif

		if (need_scaler) {
			ia_css_pipe_util_set_output_frames(bin_out_frame, 0, NULL);
			ia_css_pipe_get_generic_stage_desc(&stage_desc, copy_binary,
							    bin_out_frame, in_frame_local, NULL);
			ia_css_pipe_util_set_output_frames(bin_out_frame,
							   0, NULL);
			ia_css_pipe_get_generic_stage_desc(&stage_desc,
							   copy_binary,
							   bin_out_frame,
							   in_frame_local,
							   NULL);
		} else {
			ia_css_pipe_util_set_output_frames(bin_out_frame, 0, out_frame[0]);
			ia_css_pipe_get_generic_stage_desc(&stage_desc, copy_binary,
							    bin_out_frame, in_frame_local, NULL);
			ia_css_pipe_util_set_output_frames(bin_out_frame,
							   0, out_frame[0]);
			ia_css_pipe_get_generic_stage_desc(&stage_desc,
							   copy_binary,
							   bin_out_frame,
							   in_frame_local,
							   NULL);
		}

		err = ia_css_pipeline_create_and_add_stage(me,
@@ -7462,7 +7484,8 @@ create_host_yuvpp_pipeline(struct ia_css_pipe *pipe)
				tmp_vf_frame = NULL;
			}

			err = add_yuv_scaler_stage(pipe, me, tmp_in_frame, tmp_out_frame,
			err = add_yuv_scaler_stage(pipe, me, tmp_in_frame,
						   tmp_out_frame,
						   NULL,
						   &yuv_scaler_binary[i],
						   &yuv_scaler_stage);
@@ -7476,7 +7499,9 @@ create_host_yuvpp_pipeline(struct ia_css_pipe *pipe)
			if (pipe->pipe_settings.yuvpp.is_output_stage[i]) {
				if (tmp_vf_frame && (tmp_vf_frame->info.res.width != 0)) {
					in_frame = yuv_scaler_stage->args.out_vf_frame;
					err = add_vf_pp_stage(pipe, in_frame, tmp_vf_frame, &vf_pp_binary[j],
					err = add_vf_pp_stage(pipe, in_frame,
							      tmp_vf_frame,
							      &vf_pp_binary[j],
							      &vf_pp_stage);

					if (err) {
@@ -7490,8 +7515,8 @@ create_host_yuvpp_pipeline(struct ia_css_pipe *pipe)
	} else if (copy_stage) {
		if (vf_frame[0] && vf_frame[0]->info.res.width != 0) {
			in_frame = copy_stage->args.out_vf_frame;
			err = add_vf_pp_stage(pipe, in_frame, vf_frame[0], &vf_pp_binary[0],
						&vf_pp_stage);
			err = add_vf_pp_stage(pipe, in_frame, vf_frame[0],
					      &vf_pp_binary[0], &vf_pp_stage);
		}
		if (err) {
			IA_CSS_LEAVE_ERR_PRIVATE(err);
@@ -7499,7 +7524,8 @@ create_host_yuvpp_pipeline(struct ia_css_pipe *pipe)
		}
	}

	ia_css_pipeline_finalize_stages(&pipe->pipeline, pipe->stream->config.continuous);
	ia_css_pipeline_finalize_stages(&pipe->pipeline,
					pipe->stream->config.continuous);

	IA_CSS_LEAVE_ERR_PRIVATE(0);

@@ -7528,12 +7554,8 @@ create_host_copy_pipeline(struct ia_css_pipe *pipe,

	if (copy_on_sp(pipe) &&
	    pipe->stream->config.input_config.format == ATOMISP_INPUT_FORMAT_BINARY_8) {
		ia_css_frame_info_init(
		    &out_frame->info,
		    JPEG_BYTES,
		    1,
		    IA_CSS_FRAME_FORMAT_BINARY_8,
		    0);
		ia_css_frame_info_init(&out_frame->info, JPEG_BYTES, 1,
				       IA_CSS_FRAME_FORMAT_BINARY_8, 0);
	} else if (out_frame->info.format == IA_CSS_FRAME_FORMAT_RAW) {
		out_frame->info.raw_bit_depth =
		ia_css_pipe_util_pipe_input_format_bpp(pipe);
@@ -7544,12 +7566,12 @@ create_host_copy_pipeline(struct ia_css_pipe *pipe,
	pipe->mode  = IA_CSS_PIPE_ID_COPY;

	ia_css_pipe_get_sp_func_stage_desc(&stage_desc, out_frame,
					    IA_CSS_PIPELINE_RAW_COPY, max_input_width);
	err = ia_css_pipeline_create_and_add_stage(me,
		&stage_desc,
		NULL);
					   IA_CSS_PIPELINE_RAW_COPY,
					   max_input_width);
	err = ia_css_pipeline_create_and_add_stage(me, &stage_desc, NULL);

	ia_css_pipeline_finalize_stages(&pipe->pipeline, pipe->stream->config.continuous);
	ia_css_pipeline_finalize_stages(&pipe->pipeline,
					pipe->stream->config.continuous);

	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
			    "create_host_copy_pipeline() leave:\n");
@@ -7588,7 +7610,8 @@ create_host_isyscopy_capture_pipeline(struct ia_css_pipe *pipe)
	me->pipe_id = IA_CSS_PIPE_ID_CAPTURE;
	pipe->mode  = IA_CSS_PIPE_ID_CAPTURE;
	ia_css_pipe_get_sp_func_stage_desc(&stage_desc, out_frame,
					    IA_CSS_PIPELINE_ISYS_COPY, max_input_width);
					   IA_CSS_PIPELINE_ISYS_COPY,
					   max_input_width);
	err = ia_css_pipeline_create_and_add_stage(me,
						   &stage_desc, &out_stage);
	if (err)
@@ -7642,7 +7665,8 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe)
	IA_CSS_ENTER_PRIVATE("");
	assert(pipe);
	assert(pipe->stream);
	assert(pipe->mode == IA_CSS_PIPE_ID_CAPTURE || pipe->mode == IA_CSS_PIPE_ID_COPY);
	assert(pipe->mode == IA_CSS_PIPE_ID_CAPTURE ||
	       pipe->mode == IA_CSS_PIPE_ID_COPY);

	me = &pipe->pipeline;
	mode = pipe->config.default_capture_config.mode;
@@ -7732,21 +7756,32 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe)
			ia_css_pipe_util_set_output_frames(out_frames, 0, out_frame);
#if defined(ISP2401)
			if (!continuous) {
				ia_css_pipe_get_generic_stage_desc(&stage_desc, copy_binary,
								    out_frames, in_frame, NULL);
				ia_css_pipe_get_generic_stage_desc(&stage_desc,
								   copy_binary,
								   out_frames,
								   in_frame,
								   NULL);
			} else {
				in_frame = pipe->stream->last_pipe->continuous_frames[0];
				ia_css_pipe_get_generic_stage_desc(&stage_desc, copy_binary,
								    out_frames, in_frame, NULL);
				ia_css_pipe_get_generic_stage_desc(&stage_desc,
								   copy_binary,
								   out_frames,
								   in_frame,
								   NULL);
			}
#else
			ia_css_pipe_get_generic_stage_desc(&stage_desc, copy_binary,
							    out_frames, NULL, NULL);
			ia_css_pipe_get_generic_stage_desc(&stage_desc,
							   copy_binary,
							   out_frames,
							   NULL, NULL);
#endif
		} else {
			ia_css_pipe_util_set_output_frames(out_frames, 0, in_frame);
			ia_css_pipe_get_generic_stage_desc(&stage_desc, copy_binary,
							    out_frames, NULL, NULL);
			ia_css_pipe_util_set_output_frames(out_frames, 0,
							   in_frame);
			ia_css_pipe_get_generic_stage_desc(&stage_desc,
							   copy_binary,
							   out_frames,
							   NULL, NULL);
		}

		err = ia_css_pipeline_create_and_add_stage(me,
@@ -7788,8 +7823,11 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe)
			    * Proper investigation should be done to come up with the clean
			    * solution.
			    * */
			ia_css_pipe_get_generic_stage_desc(&stage_desc, primary_binary[i],
							    out_frames, local_in_frame, NULL);
			ia_css_pipe_get_generic_stage_desc(&stage_desc,
							   primary_binary[i],
							   out_frames,
							   local_in_frame,
							   NULL);
			err = ia_css_pipeline_create_and_add_stage(me,
								   &stage_desc,
								   &current_stage);
@@ -7809,8 +7847,8 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe)
		ia_css_pipe_util_set_output_frames(out_frames, 0, NULL);
		ia_css_pipe_get_generic_stage_desc(&stage_desc, pre_isp_binary,
						   out_frames, in_frame, NULL);
		err = ia_css_pipeline_create_and_add_stage(me,
			&stage_desc, NULL);
		err = ia_css_pipeline_create_and_add_stage(me, &stage_desc,
							   NULL);
		if (err) {
			IA_CSS_LEAVE_ERR_PRIVATE(err);
			return err;
@@ -7818,8 +7856,8 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe)
		ia_css_pipe_util_set_output_frames(out_frames, 0, NULL);
		ia_css_pipe_get_generic_stage_desc(&stage_desc, anr_gdc_binary,
						   out_frames, NULL, NULL);
		err = ia_css_pipeline_create_and_add_stage(me,
			&stage_desc, NULL);
		err = ia_css_pipeline_create_and_add_stage(me, &stage_desc,
							   NULL);
		if (err) {
			IA_CSS_LEAVE_ERR_PRIVATE(err);
			return err;
@@ -7827,16 +7865,21 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe)

		if (need_pp) {
			ia_css_pipe_util_set_output_frames(out_frames, 0, NULL);
			ia_css_pipe_get_generic_stage_desc(&stage_desc, post_isp_binary,
							    out_frames, NULL, NULL);
			ia_css_pipe_get_generic_stage_desc(&stage_desc,
							   post_isp_binary,
							   out_frames,
							   NULL, NULL);
		} else {
			ia_css_pipe_util_set_output_frames(out_frames, 0, out_frame);
			ia_css_pipe_get_generic_stage_desc(&stage_desc, post_isp_binary,
							    out_frames, NULL, NULL);
			ia_css_pipe_util_set_output_frames(out_frames, 0,
							   out_frame);
			ia_css_pipe_get_generic_stage_desc(&stage_desc,
							   post_isp_binary,
							   out_frames,
							   NULL, NULL);
		}

		err = ia_css_pipeline_create_and_add_stage(me,
			&stage_desc, &current_stage);
		err = ia_css_pipeline_create_and_add_stage(me, &stage_desc,
							   &current_stage);
		if (err) {
			IA_CSS_LEAVE_ERR_PRIVATE(err);
			return err;
@@ -7845,8 +7888,7 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe)
		ia_css_pipe_util_set_output_frames(out_frames, 0, out_frame);
		ia_css_pipe_get_generic_stage_desc(&stage_desc, pre_isp_binary,
						   out_frames, in_frame, NULL);
		err = ia_css_pipeline_create_and_add_stage(me,
			&stage_desc,
		err = ia_css_pipeline_create_and_add_stage(me, &stage_desc,
							   NULL);
		if (err) {
			IA_CSS_LEAVE_ERR_PRIVATE(err);
@@ -7862,8 +7904,11 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe)

		if (need_ldc) {
			ia_css_pipe_util_set_output_frames(out_frames, 0, NULL);
			ia_css_pipe_get_generic_stage_desc(&stage_desc, capture_ldc_binary,
							    out_frames, local_in_frame, NULL);
			ia_css_pipe_get_generic_stage_desc(&stage_desc,
							   capture_ldc_binary,
							   out_frames,
							   local_in_frame,
							   NULL);
			err = ia_css_pipeline_create_and_add_stage(me,
								   &stage_desc,
								   &current_stage);
@@ -7878,12 +7923,12 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe)
		ia_css_pipe_util_set_output_frames(out_frames, 0, out_frame);
		ia_css_pipe_get_generic_stage_desc(&stage_desc, capture_ldc_binary,
						   out_frames, in_frame, NULL);
		err = ia_css_pipeline_create_and_add_stage(me,
			&stage_desc,
		err = ia_css_pipeline_create_and_add_stage(me, &stage_desc,
							   NULL);
	} else if (need_pp && current_stage) {
		in_frame = current_stage->args.out_frame[0];
		err = add_capture_pp_stage(pipe, me, in_frame, need_yuv_pp ? NULL : out_frame,
		err = add_capture_pp_stage(pipe, me, in_frame,
					   need_yuv_pp ? NULL : out_frame,
#endif
					   capture_pp_binary,
					   &current_stage);
@@ -7903,8 +7948,8 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe)
			else
				tmp_out_frame = NULL;

			err = add_yuv_scaler_stage(pipe, me, tmp_in_frame, tmp_out_frame,
						    NULL,
			err = add_yuv_scaler_stage(pipe, me, tmp_in_frame,
						   tmp_out_frame, NULL,
						   &yuv_scaler_binary[i],
						   &yuv_scaler_stage);
			if (err) {
@@ -8527,8 +8572,7 @@ 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)
ia_css_pipe_extra_config_defaults(struct ia_css_pipe_extra_config *extra_config)
{
	if (!extra_config) {
		IA_CSS_ERROR("NULL input parameter");
@@ -8882,10 +8926,8 @@ ia_css_stream_configure_rx(struct ia_css_stream *stream)
#endif

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)
find_pipe(struct ia_css_pipe *pipes[], unsigned int num_pipes,
	  enum ia_css_pipe_mode mode, bool copy_pipe)
{
	unsigned int i;

@@ -9205,8 +9247,7 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config,
	}

#ifdef ISP2401
	err = aspect_ratio_crop_init(curr_stream,
					pipes,
	err = aspect_ratio_crop_init(curr_stream, pipes,
				     &aspect_ratio_crop_enabled);
	if (err) {
		IA_CSS_LEAVE_ERR(err);
@@ -9306,14 +9347,15 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config,
					 IA_CSS_PIPE_MODE_PREVIEW, false);
		video_pipe = find_pipe(pipes, num_pipes,
				       IA_CSS_PIPE_MODE_VIDEO, false);
		acc_pipe = find_pipe(pipes, num_pipes,
					IA_CSS_PIPE_MODE_ACC, false);
		acc_pipe = find_pipe(pipes, num_pipes, IA_CSS_PIPE_MODE_ACC,
				     false);
		if (acc_pipe && num_pipes == 2 && curr_stream->cont_capt)
			curr_stream->cont_capt =
			    false; /* preview + QoS case will not need cont_capt switch */
		if (curr_stream->cont_capt) {
			capture_pipe = find_pipe(pipes, num_pipes,
						    IA_CSS_PIPE_MODE_CAPTURE, false);
						 IA_CSS_PIPE_MODE_CAPTURE,
						 false);
			if (!capture_pipe) {
				err = -EINVAL;
				goto ERR;
@@ -9395,10 +9437,12 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config,
		if (!spcopyonly) {
			if (!IS_ISP2401)
				err = sh_css_pipe_get_shading_info(curr_pipe,
								    &pipe_info->shading_info, NULL);
								   &pipe_info->shading_info,
								   NULL);
			else
				err = sh_css_pipe_get_shading_info(curr_pipe,
								    &pipe_info->shading_info, &curr_pipe->config);
								   &pipe_info->shading_info,
								   &curr_pipe->config);

			if (err)
				goto ERR;
@@ -9408,7 +9452,8 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config,
				goto ERR;
			for (j = 0; j < IA_CSS_PIPE_MAX_OUTPUT_STAGE; j++) {
				sh_css_pipe_get_viewfinder_frame_info(curr_pipe,
									&pipe_info->vf_output_info[j], j);
								      &pipe_info->vf_output_info[j],
								      j);
				if (err)
					goto ERR;
			}
@@ -10488,7 +10533,8 @@ ia_css_pipe_update_qos_ext_mapped_arg(struct ia_css_pipe *pipe,
				HIVE_ADDR_sp_group = fw->info.sp.group;
				sp_dmem_load(SP0_ID,
					     (unsigned int)sp_address_of(sp_group),
						&sp_group, sizeof(struct sh_css_sp_group));
					     &sp_group,
					     sizeof(struct sh_css_sp_group));
				hmm_load(sp_group.pipe[thread_id].sp_stage_addr[stage_num],
					 &sp_stage, sizeof(struct sh_css_sp_stage));

@@ -10509,7 +10555,8 @@ ia_css_pipe_update_qos_ext_mapped_arg(struct ia_css_pipe *pipe,
				}

				hmm_store(sp_stage.isp_stage_addr,
					    &isp_stage, sizeof(struct sh_css_isp_stage));
					  &isp_stage,
					  sizeof(struct sh_css_isp_stage));
			}
		}
	}