Commit 874da1fd authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: atomisp: add return codes for pipeline config functions

Those functions can internally break, but, as they don't return
errors, internally there are some assert() calls, which is bad,
as it hangs the driver.

So, add return codes there, in preparation for removing such
assert() calls.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent f8852049
...@@ -36,9 +36,7 @@ ia_css_crop_encode( ...@@ -36,9 +36,7 @@ ia_css_crop_encode(
to->crop_pos = from->crop_pos; to->crop_pos = from->crop_pos;
} }
void int ia_css_crop_config(struct sh_css_isp_crop_isp_config *to,
ia_css_crop_config(
struct sh_css_isp_crop_isp_config *to,
const struct ia_css_crop_configuration *from, const struct ia_css_crop_configuration *from,
unsigned int size) unsigned int size)
{ {
...@@ -50,6 +48,7 @@ ia_css_crop_config( ...@@ -50,6 +48,7 @@ ia_css_crop_config(
/* Assume divisiblity here, may need to generalize to fixed point. */ /* Assume divisiblity here, may need to generalize to fixed point. */
assert(elems_a % to->port_b.elems == 0); assert(elems_a % to->port_b.elems == 0);
return 0;
} }
int ia_css_crop_configure(const struct ia_css_binary *binary, int ia_css_crop_configure(const struct ia_css_binary *binary,
......
...@@ -28,9 +28,7 @@ ia_css_crop_encode( ...@@ -28,9 +28,7 @@ ia_css_crop_encode(
const struct ia_css_crop_config *from, const struct ia_css_crop_config *from,
unsigned int size); unsigned int size);
void int ia_css_crop_config(struct sh_css_isp_crop_isp_config *to,
ia_css_crop_config(
struct sh_css_isp_crop_isp_config *to,
const struct ia_css_crop_configuration *from, const struct ia_css_crop_configuration *from,
unsigned int size); unsigned int size);
......
...@@ -51,9 +51,7 @@ ia_css_fpn_dump( ...@@ -51,9 +51,7 @@ ia_css_fpn_dump(
"fpn_enabled", fpn->enabled); "fpn_enabled", fpn->enabled);
} }
void int ia_css_fpn_config(struct sh_css_isp_fpn_isp_config *to,
ia_css_fpn_config(
struct sh_css_isp_fpn_isp_config *to,
const struct ia_css_fpn_configuration *from, const struct ia_css_fpn_configuration *from,
unsigned int size) unsigned int size)
{ {
...@@ -65,6 +63,7 @@ ia_css_fpn_config( ...@@ -65,6 +63,7 @@ ia_css_fpn_config(
/* Assume divisiblity here, may need to generalize to fixed point. */ /* Assume divisiblity here, may need to generalize to fixed point. */
assert(elems_a % to->port_b.elems == 0); assert(elems_a % to->port_b.elems == 0);
return 0;
} }
int ia_css_fpn_configure(const struct ia_css_binary *binary, int ia_css_fpn_configure(const struct ia_css_binary *binary,
......
...@@ -31,9 +31,7 @@ ia_css_fpn_dump( ...@@ -31,9 +31,7 @@ ia_css_fpn_dump(
const struct sh_css_isp_fpn_params *fpn, const struct sh_css_isp_fpn_params *fpn,
unsigned int level); unsigned int level);
void int ia_css_fpn_config(struct sh_css_isp_fpn_isp_config *to,
ia_css_fpn_config(
struct sh_css_isp_fpn_isp_config *to,
const struct ia_css_fpn_configuration *from, const struct ia_css_fpn_configuration *from,
unsigned int size); unsigned int size);
......
...@@ -22,9 +22,7 @@ ...@@ -22,9 +22,7 @@
#include "ia_css_isp_params.h" #include "ia_css_isp_params.h"
#include "ia_css_frame.h" #include "ia_css_frame.h"
void int ia_css_bayer_io_config(const struct ia_css_binary *binary,
ia_css_bayer_io_config(
const struct ia_css_binary *binary,
const struct sh_css_binary_args *args) const struct sh_css_binary_args *args)
{ {
const struct ia_css_frame *in_frame = args->in_frame; const struct ia_css_frame *in_frame = args->in_frame;
...@@ -91,4 +89,5 @@ ia_css_bayer_io_config( ...@@ -91,4 +89,5 @@ ia_css_bayer_io_config(
"ia_css_bayer_io_config() put part leave:\n"); "ia_css_bayer_io_config() put part leave:\n");
#endif #endif
} }
return 0;
} }
...@@ -21,9 +21,7 @@ ...@@ -21,9 +21,7 @@
#include "ia_css_binary.h" #include "ia_css_binary.h"
#include "sh_css_internal.h" #include "sh_css_internal.h"
void int ia_css_bayer_io_config(const struct ia_css_binary *binary,
ia_css_bayer_io_config(
const struct ia_css_binary *binary,
const struct sh_css_binary_args *args); const struct sh_css_binary_args *args);
#endif /*__BAYER_IO_HOST_H */ #endif /*__BAYER_IO_HOST_H */
...@@ -22,9 +22,7 @@ more details. ...@@ -22,9 +22,7 @@ more details.
#include "ia_css_isp_params.h" #include "ia_css_isp_params.h"
#include "ia_css_frame.h" #include "ia_css_frame.h"
void int ia_css_yuv444_io_config(const struct ia_css_binary *binary,
ia_css_yuv444_io_config(
const struct ia_css_binary *binary,
const struct sh_css_binary_args *args) const struct sh_css_binary_args *args)
{ {
const struct ia_css_frame *in_frame = args->in_frame; const struct ia_css_frame *in_frame = args->in_frame;
...@@ -91,4 +89,5 @@ ia_css_yuv444_io_config( ...@@ -91,4 +89,5 @@ ia_css_yuv444_io_config(
"ia_css_yuv444_io_config() put part leave:\n"); "ia_css_yuv444_io_config() put part leave:\n");
#endif #endif
} }
return 0;
} }
...@@ -21,9 +21,7 @@ more details. ...@@ -21,9 +21,7 @@ more details.
#include "ia_css_binary.h" #include "ia_css_binary.h"
#include "sh_css_internal.h" #include "sh_css_internal.h"
void int ia_css_yuv444_io_config(const struct ia_css_binary *binary,
ia_css_yuv444_io_config(
const struct ia_css_binary *binary,
const struct sh_css_binary_args *args); const struct sh_css_binary_args *args);
#endif /*__YUV44_IO_HOST_H */ #endif /*__YUV44_IO_HOST_H */
...@@ -52,9 +52,7 @@ ia_css_output_encode( ...@@ -52,9 +52,7 @@ ia_css_output_encode(
to->enable_vflip = from->enable_vflip; to->enable_vflip = from->enable_vflip;
} }
void int ia_css_output_config(struct sh_css_isp_output_isp_config *to,
ia_css_output_config(
struct sh_css_isp_output_isp_config *to,
const struct ia_css_output_configuration *from, const struct ia_css_output_configuration *from,
unsigned int size) unsigned int size)
{ {
...@@ -69,26 +67,21 @@ ia_css_output_config( ...@@ -69,26 +67,21 @@ ia_css_output_config(
/* Assume divisiblity here, may need to generalize to fixed point. */ /* Assume divisiblity here, may need to generalize to fixed point. */
assert(elems_a % to->port_b.elems == 0); assert(elems_a % to->port_b.elems == 0);
return 0;
} }
void int ia_css_output0_config(struct sh_css_isp_output_isp_config *to,
ia_css_output0_config(
struct sh_css_isp_output_isp_config *to,
const struct ia_css_output0_configuration *from, const struct ia_css_output0_configuration *from,
unsigned int size) unsigned int size)
{ {
ia_css_output_config( return ia_css_output_config(to, (const struct ia_css_output_configuration *)from, size);
to, (const struct ia_css_output_configuration *)from, size);
} }
void int ia_css_output1_config(struct sh_css_isp_output_isp_config *to,
ia_css_output1_config(
struct sh_css_isp_output_isp_config *to,
const struct ia_css_output1_configuration *from, const struct ia_css_output1_configuration *from,
unsigned int size) unsigned int size)
{ {
ia_css_output_config( return ia_css_output_config(to, (const struct ia_css_output_configuration *)from, size);
to, (const struct ia_css_output_configuration *)from, size);
} }
int ia_css_output_configure(const struct ia_css_binary *binary, int ia_css_output_configure(const struct ia_css_binary *binary,
......
...@@ -30,21 +30,15 @@ ia_css_output_encode( ...@@ -30,21 +30,15 @@ ia_css_output_encode(
const struct ia_css_output_config *from, const struct ia_css_output_config *from,
unsigned int size); unsigned int size);
void int ia_css_output_config(struct sh_css_isp_output_isp_config *to,
ia_css_output_config(
struct sh_css_isp_output_isp_config *to,
const struct ia_css_output_configuration *from, const struct ia_css_output_configuration *from,
unsigned int size); unsigned int size);
void int ia_css_output0_config(struct sh_css_isp_output_isp_config *to,
ia_css_output0_config(
struct sh_css_isp_output_isp_config *to,
const struct ia_css_output0_configuration *from, const struct ia_css_output0_configuration *from,
unsigned int size); unsigned int size);
void int ia_css_output1_config(struct sh_css_isp_output_isp_config *to,
ia_css_output1_config(
struct sh_css_isp_output_isp_config *to,
const struct ia_css_output1_configuration *from, const struct ia_css_output1_configuration *from,
unsigned int size); unsigned int size);
......
...@@ -28,9 +28,7 @@ static const struct ia_css_qplane_configuration default_config = { ...@@ -28,9 +28,7 @@ static const struct ia_css_qplane_configuration default_config = {
.pipe = (struct sh_css_sp_pipeline *)NULL, .pipe = (struct sh_css_sp_pipeline *)NULL,
}; };
void int ia_css_qplane_config(struct sh_css_isp_qplane_isp_config *to,
ia_css_qplane_config(
struct sh_css_isp_qplane_isp_config *to,
const struct ia_css_qplane_configuration *from, const struct ia_css_qplane_configuration *from,
unsigned int size) unsigned int size)
{ {
...@@ -45,6 +43,7 @@ ia_css_qplane_config( ...@@ -45,6 +43,7 @@ ia_css_qplane_config(
to->inout_port_config = from->pipe->inout_port_config; to->inout_port_config = from->pipe->inout_port_config;
to->format = from->info->format; to->format = from->info->format;
return 0;
} }
int ia_css_qplane_configure(const struct sh_css_sp_pipeline *pipe, int ia_css_qplane_configure(const struct sh_css_sp_pipeline *pipe,
......
...@@ -29,9 +29,7 @@ ...@@ -29,9 +29,7 @@
#include "ia_css_qplane_types.h" #include "ia_css_qplane_types.h"
#include "ia_css_qplane_param.h" #include "ia_css_qplane_param.h"
void int ia_css_qplane_config(struct sh_css_isp_qplane_isp_config *to,
ia_css_qplane_config(
struct sh_css_isp_qplane_isp_config *to,
const struct ia_css_qplane_configuration *from, const struct ia_css_qplane_configuration *from,
unsigned int size); unsigned int size);
......
...@@ -64,9 +64,7 @@ css2isp_stream_format(enum atomisp_input_format from) { ...@@ -64,9 +64,7 @@ css2isp_stream_format(enum atomisp_input_format from) {
} }
} }
void int ia_css_raw_config(struct sh_css_isp_raw_isp_config *to,
ia_css_raw_config(
struct sh_css_isp_raw_isp_config *to,
const struct ia_css_raw_configuration *from, const struct ia_css_raw_configuration *from,
unsigned int size) unsigned int size)
{ {
...@@ -104,6 +102,8 @@ ia_css_raw_config( ...@@ -104,6 +102,8 @@ ia_css_raw_config(
to->start_line = in_info->crop_info.start_line; to->start_line = in_info->crop_info.start_line;
to->enable_left_padding = from->enable_left_padding; to->enable_left_padding = from->enable_left_padding;
#endif #endif
return 0;
} }
int ia_css_raw_configure(const struct sh_css_sp_pipeline *pipe, int ia_css_raw_configure(const struct sh_css_sp_pipeline *pipe,
......
...@@ -21,9 +21,7 @@ ...@@ -21,9 +21,7 @@
#include "ia_css_raw_types.h" #include "ia_css_raw_types.h"
#include "ia_css_raw_param.h" #include "ia_css_raw_param.h"
void int ia_css_raw_config(struct sh_css_isp_raw_isp_config *to,
ia_css_raw_config(
struct sh_css_isp_raw_isp_config *to,
const struct ia_css_raw_configuration *from, const struct ia_css_raw_configuration *from,
unsigned int size); unsigned int size);
......
...@@ -22,9 +22,7 @@ ...@@ -22,9 +22,7 @@
#include "isp.h" #include "isp.h"
#include "ia_css_ref.host.h" #include "ia_css_ref.host.h"
void int ia_css_ref_config(struct sh_css_isp_ref_isp_config *to,
ia_css_ref_config(
struct sh_css_isp_ref_isp_config *to,
const struct ia_css_ref_configuration *from, const struct ia_css_ref_configuration *from,
unsigned int size) unsigned int size)
{ {
...@@ -53,6 +51,7 @@ ia_css_ref_config( ...@@ -53,6 +51,7 @@ ia_css_ref_config(
/* Assume divisiblity here, may need to generalize to fixed point. */ /* Assume divisiblity here, may need to generalize to fixed point. */
assert(elems_a % to->port_b.elems == 0); assert(elems_a % to->port_b.elems == 0);
return 0;
} }
int ia_css_ref_configure(const struct ia_css_binary *binary, int ia_css_ref_configure(const struct ia_css_binary *binary,
......
...@@ -23,9 +23,7 @@ ...@@ -23,9 +23,7 @@
#include "ia_css_ref_param.h" #include "ia_css_ref_param.h"
#include "ia_css_ref_state.h" #include "ia_css_ref_state.h"
void int ia_css_ref_config(struct sh_css_isp_ref_isp_config *to,
ia_css_ref_config(
struct sh_css_isp_ref_isp_config *to,
const struct ia_css_ref_configuration *from, const struct ia_css_ref_configuration *from,
unsigned int size); unsigned int size);
......
...@@ -71,9 +71,7 @@ ia_css_tnr_debug_dtrace( ...@@ -71,9 +71,7 @@ ia_css_tnr_debug_dtrace(
config->threshold_y, config->threshold_uv); config->threshold_y, config->threshold_uv);
} }
void int ia_css_tnr_config(struct sh_css_isp_tnr_isp_config *to,
ia_css_tnr_config(
struct sh_css_isp_tnr_isp_config *to,
const struct ia_css_tnr_configuration *from, const struct ia_css_tnr_configuration *from,
unsigned int size) unsigned int size)
{ {
...@@ -91,6 +89,7 @@ ia_css_tnr_config( ...@@ -91,6 +89,7 @@ ia_css_tnr_config(
/* Assume divisiblity here, may need to generalize to fixed point. */ /* Assume divisiblity here, may need to generalize to fixed point. */
assert(elems_a % to->port_b.elems == 0); assert(elems_a % to->port_b.elems == 0);
return 0;
} }
int ia_css_tnr_configure(const struct ia_css_binary *binary, int ia_css_tnr_configure(const struct ia_css_binary *binary,
......
...@@ -39,9 +39,7 @@ ia_css_tnr_debug_dtrace( ...@@ -39,9 +39,7 @@ ia_css_tnr_debug_dtrace(
const struct ia_css_tnr_config *config, const struct ia_css_tnr_config *config,
unsigned int level); unsigned int level);
void int ia_css_tnr_config(struct sh_css_isp_tnr_isp_config *to,
ia_css_tnr_config(
struct sh_css_isp_tnr_isp_config *to,
const struct ia_css_tnr_configuration *from, const struct ia_css_tnr_configuration *from,
unsigned int size); unsigned int size);
......
...@@ -26,9 +26,7 @@ ...@@ -26,9 +26,7 @@
#include "isp.h" #include "isp.h"
void int ia_css_vf_config(struct sh_css_isp_vf_isp_config *to,
ia_css_vf_config(
struct sh_css_isp_vf_isp_config *to,
const struct ia_css_vf_configuration *from, const struct ia_css_vf_configuration *from,
unsigned int size) unsigned int size)
{ {
...@@ -46,6 +44,7 @@ ia_css_vf_config( ...@@ -46,6 +44,7 @@ ia_css_vf_config(
/* Assume divisiblity here, may need to generalize to fixed point. */ /* Assume divisiblity here, may need to generalize to fixed point. */
assert(elems_a % to->dma.port_b.elems == 0); assert(elems_a % to->dma.port_b.elems == 0);
} }
return 0;
} }
/* compute the log2 of the downscale factor needed to get closest /* compute the log2 of the downscale factor needed to get closest
......
...@@ -32,9 +32,7 @@ sh_css_vf_downscale_log2( ...@@ -32,9 +32,7 @@ sh_css_vf_downscale_log2(
const struct ia_css_frame_info *vf_info, const struct ia_css_frame_info *vf_info,
unsigned int *downscale_log2); unsigned int *downscale_log2);
void int ia_css_vf_config(struct sh_css_isp_vf_isp_config *to,
ia_css_vf_config(
struct sh_css_isp_vf_isp_config *to,
const struct ia_css_vf_configuration *from, const struct ia_css_vf_configuration *from,
unsigned int size); unsigned int size);
......
...@@ -138,8 +138,7 @@ bool ia_css_frame_is_same_type( ...@@ -138,8 +138,7 @@ bool ia_css_frame_is_same_type(
* @param[in] info The frame info * @param[in] info The frame info
* @return * @return
*/ */
void ia_css_dma_configure_from_info( int ia_css_dma_configure_from_info(struct dma_port_config *config,
struct dma_port_config *config,
const struct ia_css_frame_info *info); const struct ia_css_frame_info *info);
/* ISP2401 */ /* ISP2401 */
......
...@@ -594,9 +594,7 @@ bool ia_css_frame_is_same_type(const struct ia_css_frame *frame_a, ...@@ -594,9 +594,7 @@ bool ia_css_frame_is_same_type(const struct ia_css_frame *frame_a,
return is_equal; return is_equal;
} }
void int ia_css_dma_configure_from_info(struct dma_port_config *config,
ia_css_dma_configure_from_info(
struct dma_port_config *config,
const struct ia_css_frame_info *info) const struct ia_css_frame_info *info)
{ {
unsigned int is_raw_packed = info->format == IA_CSS_FRAME_FORMAT_RAW_PACKED; unsigned int is_raw_packed = info->format == IA_CSS_FRAME_FORMAT_RAW_PACKED;
...@@ -611,6 +609,7 @@ ia_css_dma_configure_from_info( ...@@ -611,6 +609,7 @@ ia_css_dma_configure_from_info(
config->width = (uint16_t)info->res.width; config->width = (uint16_t)info->res.width;
config->crop = 0; config->crop = 0;
assert(config->width <= info->padded_width); assert(config->width <= info->padded_width);
return 0;
} }
/************************************************************************** /**************************************************************************
......
...@@ -870,8 +870,7 @@ static int configure_isp_from_args(const struct sh_css_sp_pipeline *pipeline, ...@@ -870,8 +870,7 @@ static int configure_isp_from_args(const struct sh_css_sp_pipeline *pipeline,
ret = ia_css_tnr_configure(binary, args->tnr_frames); ret = ia_css_tnr_configure(binary, args->tnr_frames);
if (ret) if (ret)
return ret; return ret;
ia_css_bayer_io_config(binary, args); return ia_css_bayer_io_config(binary, args);
return 0;
} }
static void static void
......
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