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

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
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ enum ia_css_err ia_css_util_check_res(
    unsigned int width,
    unsigned int height);

#ifdef ISP2401
/* ISP2401 */
/* @brief compare resolutions (less or equal)
 *
 * @param[in] a resolution
@@ -87,6 +87,7 @@ bool ia_css_util_res_leq(
    struct ia_css_resolution a,
    struct ia_css_resolution b);

/* ISP2401 */
/**
 * @brief Check if resolution is zero
 *
@@ -97,6 +98,7 @@ bool ia_css_util_res_leq(
bool ia_css_util_resolution_is_zero(
    const struct ia_css_resolution resolution);

/* ISP2401 */
/**
 * @brief Check if resolution is even
 *
@@ -107,7 +109,6 @@ bool ia_css_util_resolution_is_zero(
bool ia_css_util_resolution_is_even(
    const struct ia_css_resolution resolution);

#endif
/* @brief check width and height
 *
 * @param[in] stream_format
+3 −2
Original line number Diff line number Diff line
@@ -158,23 +158,24 @@ enum ia_css_err ia_css_util_check_res(unsigned int width, unsigned int height)
	return IA_CSS_SUCCESS;
}

#ifdef ISP2401
/* ISP2401 */
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;
}

/* ISP2401 */
bool ia_css_util_resolution_is_zero(const struct ia_css_resolution resolution)
{
	return (resolution.width == 0) || (resolution.height == 0);
}

/* ISP2401 */
bool ia_css_util_resolution_is_even(const struct ia_css_resolution resolution)
{
	return IS_EVEN(resolution.height) && IS_EVEN(resolution.width);
}

#endif
bool ia_css_util_is_input_format_raw(enum atomisp_input_format format)
{
	return ((format == ATOMISP_INPUT_FORMAT_RAW_6) ||