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

media: atomisp: propagate errors at ia_css_*_configure()

Propagate the lower lever ia_css config errors to the next
level.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 08ae0ffd
...@@ -34,14 +34,12 @@ ia_css_copy_output_config( ...@@ -34,14 +34,12 @@ ia_css_copy_output_config(
to->enable = from->enable; to->enable = from->enable;
} }
void int ia_css_copy_output_configure(const struct ia_css_binary *binary,
ia_css_copy_output_configure( bool enable)
const struct ia_css_binary *binary,
bool enable)
{ {
struct ia_css_copy_output_configuration config = default_config; struct ia_css_copy_output_configuration config = default_config;
config.enable = enable; config.enable = enable;
ia_css_configure_copy_output(binary, &config); return ia_css_configure_copy_output(binary, &config);
} }
...@@ -27,9 +27,7 @@ ia_css_copy_output_config( ...@@ -27,9 +27,7 @@ ia_css_copy_output_config(
const struct ia_css_copy_output_configuration *from, const struct ia_css_copy_output_configuration *from,
unsigned int size); unsigned int size);
void int ia_css_copy_output_configure(const struct ia_css_binary *binary,
ia_css_copy_output_configure( bool enable);
const struct ia_css_binary *binary,
bool enable);
#endif /* __IA_CSS_COPY_OUTPUT_HOST_H */ #endif /* __IA_CSS_COPY_OUTPUT_HOST_H */
...@@ -52,14 +52,12 @@ ia_css_crop_config( ...@@ -52,14 +52,12 @@ ia_css_crop_config(
assert(elems_a % to->port_b.elems == 0); assert(elems_a % to->port_b.elems == 0);
} }
void int ia_css_crop_configure(const struct ia_css_binary *binary,
ia_css_crop_configure( const struct ia_css_frame_info *info)
const struct ia_css_binary *binary,
const struct ia_css_frame_info *info)
{ {
struct ia_css_crop_configuration config = default_config; struct ia_css_crop_configuration config = default_config;
config.info = info; config.info = info;
ia_css_configure_crop(binary, &config); return ia_css_configure_crop(binary, &config);
} }
...@@ -34,9 +34,7 @@ ia_css_crop_config( ...@@ -34,9 +34,7 @@ ia_css_crop_config(
const struct ia_css_crop_configuration *from, const struct ia_css_crop_configuration *from,
unsigned int size); unsigned int size);
void int ia_css_crop_configure(const struct ia_css_binary *binary,
ia_css_crop_configure( const struct ia_css_frame_info *from);
const struct ia_css_binary *binary,
const struct ia_css_frame_info *from);
#endif /* __IA_CSS_CROP_HOST_H */ #endif /* __IA_CSS_CROP_HOST_H */
...@@ -46,16 +46,14 @@ ia_css_dvs_config( ...@@ -46,16 +46,14 @@ ia_css_dvs_config(
DVS_NUM_BLOCKS_Y(from->info->res.height); DVS_NUM_BLOCKS_Y(from->info->res.height);
} }
void int ia_css_dvs_configure(const struct ia_css_binary *binary,
ia_css_dvs_configure( const struct ia_css_frame_info *info)
const struct ia_css_binary *binary,
const struct ia_css_frame_info *info)
{ {
struct ia_css_dvs_configuration config = default_config; struct ia_css_dvs_configuration config = default_config;
config.info = info; config.info = info;
ia_css_configure_dvs(binary, &config); return ia_css_configure_dvs(binary, &config);
} }
static void static void
......
...@@ -35,10 +35,8 @@ ia_css_dvs_config( ...@@ -35,10 +35,8 @@ ia_css_dvs_config(
const struct ia_css_dvs_configuration *from, const struct ia_css_dvs_configuration *from,
unsigned int size); unsigned int size);
void int ia_css_dvs_configure(const struct ia_css_binary *binary,
ia_css_dvs_configure( const struct ia_css_frame_info *from);
const struct ia_css_binary *binary,
const struct ia_css_frame_info *from);
void void
convert_dvs_6axis_config( convert_dvs_6axis_config(
......
...@@ -67,10 +67,8 @@ ia_css_fpn_config( ...@@ -67,10 +67,8 @@ ia_css_fpn_config(
assert(elems_a % to->port_b.elems == 0); assert(elems_a % to->port_b.elems == 0);
} }
void int ia_css_fpn_configure(const struct ia_css_binary *binary,
ia_css_fpn_configure( const struct ia_css_frame_info *info)
const struct ia_css_binary *binary,
const struct ia_css_frame_info *info)
{ {
struct ia_css_frame_info my_info = IA_CSS_BINARY_DEFAULT_FRAME_INFO; struct ia_css_frame_info my_info = IA_CSS_BINARY_DEFAULT_FRAME_INFO;
const struct ia_css_fpn_configuration config = { const struct ia_css_fpn_configuration config = {
...@@ -85,5 +83,5 @@ ia_css_fpn_configure( ...@@ -85,5 +83,5 @@ ia_css_fpn_configure(
my_info.raw_bayer_order = info->raw_bayer_order; my_info.raw_bayer_order = info->raw_bayer_order;
my_info.crop_info = info->crop_info; my_info.crop_info = info->crop_info;
ia_css_configure_fpn(binary, &config); return ia_css_configure_fpn(binary, &config);
} }
...@@ -37,9 +37,7 @@ ia_css_fpn_config( ...@@ -37,9 +37,7 @@ ia_css_fpn_config(
const struct ia_css_fpn_configuration *from, const struct ia_css_fpn_configuration *from,
unsigned int size); unsigned int size);
void int ia_css_fpn_configure(const struct ia_css_binary *binary,
ia_css_fpn_configure( const struct ia_css_frame_info *from);
const struct ia_css_binary *binary,
const struct ia_css_frame_info *from);
#endif /* __IA_CSS_FPN_HOST_H */ #endif /* __IA_CSS_FPN_HOST_H */
...@@ -38,10 +38,9 @@ ia_css_iterator_config( ...@@ -38,10 +38,9 @@ ia_css_iterator_config(
ia_css_resolution_to_sp_resolution(&to->dvs_envelope, from->dvs_envelope); ia_css_resolution_to_sp_resolution(&to->dvs_envelope, from->dvs_envelope);
} }
int int ia_css_iterator_configure(const struct ia_css_binary *binary,
ia_css_iterator_configure( const struct ia_css_frame_info *in_info)
const struct ia_css_binary *binary, {
const struct ia_css_frame_info *in_info) {
struct ia_css_frame_info my_info = IA_CSS_BINARY_DEFAULT_FRAME_INFO; struct ia_css_frame_info my_info = IA_CSS_BINARY_DEFAULT_FRAME_INFO;
struct ia_css_iterator_configuration config = default_config; struct ia_css_iterator_configuration config = default_config;
...@@ -75,7 +74,5 @@ ia_css_iterator_configure( ...@@ -75,7 +74,5 @@ ia_css_iterator_configure(
my_info.res.height <<= binary->vf_downscale_log2; my_info.res.height <<= binary->vf_downscale_log2;
} }
ia_css_configure_iterator(binary, &config); return ia_css_configure_iterator(binary, &config);
return 0;
} }
...@@ -91,10 +91,8 @@ ia_css_output1_config( ...@@ -91,10 +91,8 @@ ia_css_output1_config(
to, (const struct ia_css_output_configuration *)from, size); to, (const struct ia_css_output_configuration *)from, size);
} }
void int ia_css_output_configure(const struct ia_css_binary *binary,
ia_css_output_configure( const struct ia_css_frame_info *info)
const struct ia_css_binary *binary,
const struct ia_css_frame_info *info)
{ {
if (info) { if (info) {
struct ia_css_output_configuration config = struct ia_css_output_configuration config =
...@@ -102,14 +100,13 @@ ia_css_output_configure( ...@@ -102,14 +100,13 @@ ia_css_output_configure(
config.info = info; config.info = info;
ia_css_configure_output(binary, &config); return ia_css_configure_output(binary, &config);
} }
return 0;
} }
void int ia_css_output0_configure(const struct ia_css_binary *binary,
ia_css_output0_configure( const struct ia_css_frame_info *info)
const struct ia_css_binary *binary,
const struct ia_css_frame_info *info)
{ {
if (info) { if (info) {
struct ia_css_output0_configuration config = struct ia_css_output0_configuration config =
...@@ -117,14 +114,13 @@ ia_css_output0_configure( ...@@ -117,14 +114,13 @@ ia_css_output0_configure(
config.info = info; config.info = info;
ia_css_configure_output0(binary, &config); return ia_css_configure_output0(binary, &config);
} }
return 0;
} }
void int ia_css_output1_configure(const struct ia_css_binary *binary,
ia_css_output1_configure( const struct ia_css_frame_info *info)
const struct ia_css_binary *binary,
const struct ia_css_frame_info *info)
{ {
if (info) { if (info) {
struct ia_css_output1_configuration config = struct ia_css_output1_configuration config =
...@@ -132,8 +128,9 @@ ia_css_output1_configure( ...@@ -132,8 +128,9 @@ ia_css_output1_configure(
config.info = info; config.info = info;
ia_css_configure_output1(binary, &config); return ia_css_configure_output1(binary, &config);
} }
return 0;
} }
void void
......
...@@ -48,20 +48,14 @@ ia_css_output1_config( ...@@ -48,20 +48,14 @@ ia_css_output1_config(
const struct ia_css_output1_configuration *from, const struct ia_css_output1_configuration *from,
unsigned int size); unsigned int size);
void int ia_css_output_configure(const struct ia_css_binary *binary,
ia_css_output_configure( const struct ia_css_frame_info *from);
const struct ia_css_binary *binary,
const struct ia_css_frame_info *from);
void int ia_css_output0_configure(const struct ia_css_binary *binary,
ia_css_output0_configure( const struct ia_css_frame_info *from);
const struct ia_css_binary *binary,
const struct ia_css_frame_info *from);
void int ia_css_output1_configure(const struct ia_css_binary *binary,
ia_css_output1_configure( const struct ia_css_frame_info *from);
const struct ia_css_binary *binary,
const struct ia_css_frame_info *from);
void void
ia_css_output_dump( ia_css_output_dump(
......
...@@ -47,16 +47,14 @@ ia_css_qplane_config( ...@@ -47,16 +47,14 @@ ia_css_qplane_config(
to->format = from->info->format; to->format = from->info->format;
} }
void int ia_css_qplane_configure(const struct sh_css_sp_pipeline *pipe,
ia_css_qplane_configure( const struct ia_css_binary *binary,
const struct sh_css_sp_pipeline *pipe, const struct ia_css_frame_info *info)
const struct ia_css_binary *binary,
const struct ia_css_frame_info *info)
{ {
struct ia_css_qplane_configuration config = default_config; struct ia_css_qplane_configuration config = default_config;
config.pipe = pipe; config.pipe = pipe;
config.info = info; config.info = info;
ia_css_configure_qplane(binary, &config); return ia_css_configure_qplane(binary, &config);
} }
...@@ -35,10 +35,8 @@ ia_css_qplane_config( ...@@ -35,10 +35,8 @@ ia_css_qplane_config(
const struct ia_css_qplane_configuration *from, const struct ia_css_qplane_configuration *from,
unsigned int size); unsigned int size);
void int ia_css_qplane_configure(const struct sh_css_sp_pipeline *pipe,
ia_css_qplane_configure( const struct ia_css_binary *binary,
const struct sh_css_sp_pipeline *pipe, const struct ia_css_frame_info *from);
const struct ia_css_binary *binary,
const struct ia_css_frame_info *from);
#endif /* __IA_CSS_QPLANE_HOST_H */ #endif /* __IA_CSS_QPLANE_HOST_H */
...@@ -106,14 +106,12 @@ ia_css_raw_config( ...@@ -106,14 +106,12 @@ ia_css_raw_config(
#endif #endif
} }
void int ia_css_raw_configure(const struct sh_css_sp_pipeline *pipe,
ia_css_raw_configure( const struct ia_css_binary *binary,
const struct sh_css_sp_pipeline *pipe, const struct ia_css_frame_info *in_info,
const struct ia_css_binary *binary, const struct ia_css_frame_info *internal_info,
const struct ia_css_frame_info *in_info, bool two_ppc,
const struct ia_css_frame_info *internal_info, bool deinterleaved)
bool two_ppc,
bool deinterleaved)
{ {
u8 enable_left_padding = (uint8_t)((binary->left_padding) ? 1 : 0); u8 enable_left_padding = (uint8_t)((binary->left_padding) ? 1 : 0);
struct ia_css_raw_configuration config = default_config; struct ia_css_raw_configuration config = default_config;
...@@ -126,5 +124,5 @@ ia_css_raw_configure( ...@@ -126,5 +124,5 @@ ia_css_raw_configure(
config.deinterleaved = deinterleaved; config.deinterleaved = deinterleaved;
config.enable_left_padding = enable_left_padding; config.enable_left_padding = enable_left_padding;
ia_css_configure_raw(binary, &config); return ia_css_configure_raw(binary, &config);
} }
...@@ -27,13 +27,11 @@ ia_css_raw_config( ...@@ -27,13 +27,11 @@ ia_css_raw_config(
const struct ia_css_raw_configuration *from, const struct ia_css_raw_configuration *from,
unsigned int size); unsigned int size);
void int ia_css_raw_configure(const struct sh_css_sp_pipeline *pipe,
ia_css_raw_configure( const struct ia_css_binary *binary,
const struct sh_css_sp_pipeline *pipe, const struct ia_css_frame_info *in_info,
const struct ia_css_binary *binary, const struct ia_css_frame_info *internal_info,
const struct ia_css_frame_info *in_info, bool two_ppc,
const struct ia_css_frame_info *internal_info, bool deinterleaved);
bool two_ppc,
bool deinterleaved);
#endif /* __IA_CSS_RAW_HOST_H */ #endif /* __IA_CSS_RAW_HOST_H */
...@@ -55,19 +55,19 @@ ia_css_ref_config( ...@@ -55,19 +55,19 @@ ia_css_ref_config(
assert(elems_a % to->port_b.elems == 0); assert(elems_a % to->port_b.elems == 0);
} }
void int ia_css_ref_configure(const struct ia_css_binary *binary,
ia_css_ref_configure( const struct ia_css_frame * const *ref_frames,
const struct ia_css_binary *binary, const uint32_t dvs_frame_delay)
const struct ia_css_frame * const *ref_frames,
const uint32_t dvs_frame_delay)
{ {
struct ia_css_ref_configuration config; struct ia_css_ref_configuration config;
unsigned int i; unsigned int i;
for (i = 0; i < MAX_NUM_VIDEO_DELAY_FRAMES; i++) for (i = 0; i < MAX_NUM_VIDEO_DELAY_FRAMES; i++)
config.ref_frames[i] = ref_frames[i]; config.ref_frames[i] = ref_frames[i];
config.dvs_frame_delay = dvs_frame_delay; config.dvs_frame_delay = dvs_frame_delay;
ia_css_configure_ref(binary, &config);
return ia_css_configure_ref(binary, &config);
} }
void void
......
...@@ -29,11 +29,9 @@ ia_css_ref_config( ...@@ -29,11 +29,9 @@ ia_css_ref_config(
const struct ia_css_ref_configuration *from, const struct ia_css_ref_configuration *from,
unsigned int size); unsigned int size);
void int ia_css_ref_configure(const struct ia_css_binary *binary,
ia_css_ref_configure( const struct ia_css_frame * const *ref_frames,
const struct ia_css_binary *binary, const uint32_t dvs_frame_delay);
const struct ia_css_frame * const *ref_frames,
const uint32_t dvs_frame_delay);
void void
ia_css_init_ref_state( ia_css_init_ref_state(
......
...@@ -93,10 +93,8 @@ ia_css_tnr_config( ...@@ -93,10 +93,8 @@ ia_css_tnr_config(
assert(elems_a % to->port_b.elems == 0); assert(elems_a % to->port_b.elems == 0);
} }
void int ia_css_tnr_configure(const struct ia_css_binary *binary,
ia_css_tnr_configure( const struct ia_css_frame * const *frames)
const struct ia_css_binary *binary,
const struct ia_css_frame * const *frames)
{ {
struct ia_css_tnr_configuration config; struct ia_css_tnr_configuration config;
unsigned int i; unsigned int i;
...@@ -104,7 +102,7 @@ ia_css_tnr_configure( ...@@ -104,7 +102,7 @@ ia_css_tnr_configure(
for (i = 0; i < NUM_TNR_FRAMES; i++) for (i = 0; i < NUM_TNR_FRAMES; i++)
config.tnr_frames[i] = frames[i]; config.tnr_frames[i] = frames[i];
ia_css_configure_tnr(binary, &config); return ia_css_configure_tnr(binary, &config);
} }
void void
......
...@@ -45,10 +45,8 @@ ia_css_tnr_config( ...@@ -45,10 +45,8 @@ ia_css_tnr_config(
const struct ia_css_tnr_configuration *from, const struct ia_css_tnr_configuration *from,
unsigned int size); unsigned int size);
void int ia_css_tnr_configure(const struct ia_css_binary *binary,
ia_css_tnr_configure( const struct ia_css_frame * const *frames);
const struct ia_css_binary *binary,
const struct ia_css_frame * const *frames);
void void
ia_css_init_tnr_state( ia_css_init_tnr_state(
......
...@@ -120,12 +120,11 @@ configure_dma( ...@@ -120,12 +120,11 @@ configure_dma(
config->info = vf_info; config->info = vf_info;
} }
int int ia_css_vf_configure(const struct ia_css_binary *binary,
ia_css_vf_configure( const struct ia_css_frame_info *out_info,
const struct ia_css_binary *binary, struct ia_css_frame_info *vf_info,
const struct ia_css_frame_info *out_info, unsigned int *downscale_log2)
struct ia_css_frame_info *vf_info, {
unsigned int *downscale_log2) {
int err; int err;
struct ia_css_vf_configuration config; struct ia_css_vf_configuration config;
const struct ia_css_binary_info *info = &binary->info->sp; const struct ia_css_binary_info *info = &binary->info->sp;
...@@ -138,7 +137,6 @@ ia_css_vf_configure( ...@@ -138,7 +137,6 @@ ia_css_vf_configure(
if (vf_info) if (vf_info)
vf_info->raw_bit_depth = info->dma.vfdec_bits_per_pixel; vf_info->raw_bit_depth = info->dma.vfdec_bits_per_pixel;
ia_css_configure_vf(binary, &config);
return 0; return ia_css_configure_vf(binary, &config);
} }
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