drm: fixed: Add dfixed_frac
This helper macro retrieves the fractional part of a fixed20_12 20.12 fixed-point number. Signed-off-by: Robert Morell <rmorell@nvidia.com> Signed-off-by: Olof Johansson <olofj@chromium.org> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
398b470689
commit
f7f6c340f9
|
@ -37,6 +37,7 @@ typedef union dfixed {
|
|||
#define dfixed_init(A) { .full = dfixed_const((A)) }
|
||||
#define dfixed_init_half(A) { .full = dfixed_const_half((A)) }
|
||||
#define dfixed_trunc(A) ((A).full >> 12)
|
||||
#define dfixed_frac(A) ((A).full & ((1 << 12) - 1))
|
||||
|
||||
static inline u32 dfixed_floor(fixed20_12 A)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue