Commit 7535c68d authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: atomisp: make util.c work with ISP2401 runtime detection

Don't hide those small functions behind ifdefs.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 8a85fe11
...@@ -74,7 +74,7 @@ enum ia_css_err ia_css_util_check_res( ...@@ -74,7 +74,7 @@ enum ia_css_err ia_css_util_check_res(
unsigned int width, unsigned int width,
unsigned int height); unsigned int height);
#ifdef ISP2401 /* ISP2401 */
/* @brief compare resolutions (less or equal) /* @brief compare resolutions (less or equal)
* *
* @param[in] a resolution * @param[in] a resolution
...@@ -87,6 +87,7 @@ bool ia_css_util_res_leq( ...@@ -87,6 +87,7 @@ bool ia_css_util_res_leq(
struct ia_css_resolution a, struct ia_css_resolution a,
struct ia_css_resolution b); struct ia_css_resolution b);
/* ISP2401 */
/** /**
* @brief Check if resolution is zero * @brief Check if resolution is zero
* *
...@@ -97,6 +98,7 @@ bool ia_css_util_res_leq( ...@@ -97,6 +98,7 @@ bool ia_css_util_res_leq(
bool ia_css_util_resolution_is_zero( bool ia_css_util_resolution_is_zero(
const struct ia_css_resolution resolution); const struct ia_css_resolution resolution);
/* ISP2401 */
/** /**
* @brief Check if resolution is even * @brief Check if resolution is even
* *
...@@ -107,7 +109,6 @@ bool ia_css_util_resolution_is_zero( ...@@ -107,7 +109,6 @@ bool ia_css_util_resolution_is_zero(
bool ia_css_util_resolution_is_even( bool ia_css_util_resolution_is_even(
const struct ia_css_resolution resolution); const struct ia_css_resolution resolution);
#endif
/* @brief check width and height /* @brief check width and height
* *
* @param[in] stream_format * @param[in] stream_format
......
...@@ -158,23 +158,24 @@ enum ia_css_err ia_css_util_check_res(unsigned int width, unsigned int height) ...@@ -158,23 +158,24 @@ enum ia_css_err ia_css_util_check_res(unsigned int width, unsigned int height)
return IA_CSS_SUCCESS; return IA_CSS_SUCCESS;
} }
#ifdef ISP2401 /* ISP2401 */
bool ia_css_util_res_leq(struct ia_css_resolution a, struct ia_css_resolution b) bool ia_css_util_res_leq(struct ia_css_resolution a, struct ia_css_resolution b)
{ {
return a.width <= b.width && a.height <= b.height; return a.width <= b.width && a.height <= b.height;
} }
/* ISP2401 */
bool ia_css_util_resolution_is_zero(const struct ia_css_resolution resolution) bool ia_css_util_resolution_is_zero(const struct ia_css_resolution resolution)
{ {
return (resolution.width == 0) || (resolution.height == 0); return (resolution.width == 0) || (resolution.height == 0);
} }
/* ISP2401 */
bool ia_css_util_resolution_is_even(const struct ia_css_resolution resolution) bool ia_css_util_resolution_is_even(const struct ia_css_resolution resolution)
{ {
return IS_EVEN(resolution.height) && IS_EVEN(resolution.width); return IS_EVEN(resolution.height) && IS_EVEN(resolution.width);
} }
#endif
bool ia_css_util_is_input_format_raw(enum atomisp_input_format format) bool ia_css_util_is_input_format_raw(enum atomisp_input_format format)
{ {
return ((format == ATOMISP_INPUT_FORMAT_RAW_6) || return ((format == ATOMISP_INPUT_FORMAT_RAW_6) ||
......
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