Commit d8c893b4 authored by Dave Airlie's avatar Dave Airlie Committed by Alex Deucher

amdgpu/dc: inline dml_round_to_multiple

turns out to be a win to inline this.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2a206cc2
...@@ -39,23 +39,4 @@ double dml_round(double a) ...@@ -39,23 +39,4 @@ double dml_round(double a)
return floor; return floor;
} }
unsigned int dml_round_to_multiple(
unsigned int num,
unsigned int multiple,
bool up)
{
unsigned int remainder;
if (multiple == 0)
return num;
remainder = num % multiple;
if (remainder == 0)
return num;
if (up)
return (num + multiple - remainder);
else
return (num - remainder);
}
...@@ -33,7 +33,5 @@ ...@@ -33,7 +33,5 @@
#define DTRACE(str, ...) dm_logger_write(mode_lib->logger, LOG_DML, str, ##__VA_ARGS__); #define DTRACE(str, ...) dm_logger_write(mode_lib->logger, LOG_DML, str, ##__VA_ARGS__);
double dml_round(double a); double dml_round(double a);
unsigned int dml_round_to_multiple(
unsigned int num, unsigned int multiple, bool up);
#endif /* __DC_COMMON_DEFS_H__ */ #endif /* __DC_COMMON_DEFS_H__ */
...@@ -58,4 +58,23 @@ static inline double dml_log(double x, double base) ...@@ -58,4 +58,23 @@ static inline double dml_log(double x, double base)
return (double) dcn_bw_log(x, base); return (double) dcn_bw_log(x, base);
} }
static inline unsigned int dml_round_to_multiple(unsigned int num,
unsigned int multiple,
bool up)
{
unsigned int remainder;
if (multiple == 0)
return num;
remainder = num % multiple;
if (remainder == 0)
return num;
if (up)
return (num + multiple - remainder);
else
return (num - remainder);
}
#endif #endif
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