aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_fixed.h
diff options
context:
space:
mode:
authorRobert Morell <rmorell@nvidia.com>2012-04-25 05:45:01 -0400
committerDave Airlie <airlied@redhat.com>2012-04-27 04:29:35 -0400
commitf7f6c340f9d8f11bee50aef647b8578348957936 (patch)
tree3c4593baa3a02dd6f06070bf5bcb459b3cf94ee3 /include/drm/drm_fixed.h
parent398b4706896ee8d8e72f215a089b58637add5c92 (diff)
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>
Diffstat (limited to 'include/drm/drm_fixed.h')
-rw-r--r--include/drm/drm_fixed.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/drm/drm_fixed.h b/include/drm/drm_fixed.h
index 4a08a664ff1f..0ead502e17d2 100644
--- a/include/drm/drm_fixed.h
+++ b/include/drm/drm_fixed.h
@@ -37,6 +37,7 @@ typedef union dfixed {
37#define dfixed_init(A) { .full = dfixed_const((A)) } 37#define dfixed_init(A) { .full = dfixed_const((A)) }
38#define dfixed_init_half(A) { .full = dfixed_const_half((A)) } 38#define dfixed_init_half(A) { .full = dfixed_const_half((A)) }
39#define dfixed_trunc(A) ((A).full >> 12) 39#define dfixed_trunc(A) ((A).full >> 12)
40#define dfixed_frac(A) ((A).full & ((1 << 12) - 1))
40 41
41static inline u32 dfixed_floor(fixed20_12 A) 42static inline u32 dfixed_floor(fixed20_12 A)
42{ 43{