mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-02 14:34:13 -04:00
media: atomisp: make util.c work with ISP2401 runtime detection
Don't hide those small functions behind ifdefs. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) ||
|
||||
|
||||
Reference in New Issue
Block a user