Commit f8852049 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: atomisp: sh_css_sp: better handle pipeline config errors

If something gets wrong while setup a pipeline, return an
error code.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent f21e49be
......@@ -812,25 +812,47 @@ is_sp_stage(struct ia_css_pipeline_stage *stage)
return stage->sp_func != IA_CSS_PIPELINE_NO_FUNC;
}
static int
configure_isp_from_args(
const struct sh_css_sp_pipeline *pipeline,
static int configure_isp_from_args(const struct sh_css_sp_pipeline *pipeline,
const struct ia_css_binary *binary,
const struct sh_css_binary_args *args,
bool two_ppc,
bool deinterleaved)
{
ia_css_fpn_configure(binary, &binary->in_frame_info);
ia_css_crop_configure(binary, &args->delay_frames[0]->info);
ia_css_qplane_configure(pipeline, binary, &binary->in_frame_info);
ia_css_output0_configure(binary, &args->out_frame[0]->info);
ia_css_output1_configure(binary, &args->out_vf_frame->info);
ia_css_copy_output_configure(binary, args->copy_output);
ia_css_output0_configure(binary, &args->out_frame[0]->info);
ia_css_iterator_configure(binary, &args->in_frame->info);
ia_css_dvs_configure(binary, &args->out_frame[0]->info);
ia_css_output_configure(binary, &args->out_frame[0]->info);
ia_css_raw_configure(pipeline, binary, &args->in_frame->info, &binary->in_frame_info, two_ppc, deinterleaved);
int ret;
ret = ia_css_fpn_configure(binary, &binary->in_frame_info);
if (ret)
return ret;
ret = ia_css_crop_configure(binary, &args->delay_frames[0]->info);
if (ret)
return ret;
ret = ia_css_qplane_configure(pipeline, binary, &binary->in_frame_info);
if (ret)
return ret;
ret = ia_css_output0_configure(binary, &args->out_frame[0]->info);
if (ret)
return ret;
ret = ia_css_output1_configure(binary, &args->out_vf_frame->info);
if (ret)
return ret;
ret = ia_css_copy_output_configure(binary, args->copy_output);
if (ret)
return ret;
ret = ia_css_output0_configure(binary, &args->out_frame[0]->info);
if (ret)
return ret;
ret = ia_css_iterator_configure(binary, &args->in_frame->info);
if (ret)
return ret;
ret = ia_css_dvs_configure(binary, &args->out_frame[0]->info);
if (ret)
return ret;
ret = ia_css_output_configure(binary, &args->out_frame[0]->info);
if (ret)
return ret;
ret = ia_css_raw_configure(pipeline, binary, &args->in_frame->info, &binary->in_frame_info, two_ppc, deinterleaved);
if (ret)
return ret;
/*
* FIXME: args->delay_frames can be NULL here
......@@ -842,8 +864,12 @@ configure_isp_from_args(
* without crashing, but the pipeline should likely be built without
* adding it at the first place (or there are a hidden bug somewhere)
*/
ia_css_ref_configure(binary, args->delay_frames, pipeline->dvs_frame_delay);
ia_css_tnr_configure(binary, args->tnr_frames);
ret = ia_css_ref_configure(binary, args->delay_frames, pipeline->dvs_frame_delay);
if (ret)
return ret;
ret = ia_css_tnr_configure(binary, args->tnr_frames);
if (ret)
return ret;
ia_css_bayer_io_config(binary, args);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment