Skip to content

Commit

Permalink
drm: fixed: Add dfixed_frac
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robert Morell authored and Dave Airlie committed Apr 27, 2012
1 parent 398b470 commit f7f6c34
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/drm/drm_fixed.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit f7f6c34

Please sign in to comment.