From f7f6c340f9d8f11bee50aef647b8578348957936 Mon Sep 17 00:00:00 2001 From: Robert Morell Date: Wed, 25 Apr 2012 11:45:01 +0200 Subject: 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 Signed-off-by: Olof Johansson Signed-off-by: Thierry Reding Signed-off-by: Dave Airlie --- include/drm/drm_fixed.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/drm') 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 { #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) { -- cgit v1.2.3-58-ga151