diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-12-09 14:40:06 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-10 15:09:05 +1000 |
commit | 69b3b5e59bc763c30d0098ae4bbe1225c0e82a04 (patch) | |
tree | 0e76e8bc46d589419eb16769a2c3560810395ac7 /drivers/gpu/drm/radeon/radeon_fixed.h | |
parent | 2e7b6f7fa62d92d941c626f8ae45f5cd75a52d55 (diff) | |
download | blackbird-obmc-linux-69b3b5e59bc763c30d0098ae4bbe1225c0e82a04.tar.gz blackbird-obmc-linux-69b3b5e59bc763c30d0098ae4bbe1225c0e82a04.zip |
drm/radeon/kms/avivo: fix some bugs in the display bandwidth setup
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_fixed.h')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_fixed.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_fixed.h b/drivers/gpu/drm/radeon/radeon_fixed.h index 90187d173847..3d4d84e078ac 100644 --- a/drivers/gpu/drm/radeon/radeon_fixed.h +++ b/drivers/gpu/drm/radeon/radeon_fixed.h @@ -38,6 +38,23 @@ typedef union rfixed { #define fixed_init_half(A) { .full = rfixed_const_half((A)) } #define rfixed_trunc(A) ((A).full >> 12) +static inline u32 rfixed_floor(fixed20_12 A) +{ + u32 non_frac = rfixed_trunc(A); + + return rfixed_const(non_frac); +} + +static inline u32 rfixed_ceil(fixed20_12 A) +{ + u32 non_frac = rfixed_trunc(A); + + if (A.full > rfixed_const(non_frac)) + return rfixed_const(non_frac + 1); + else + return rfixed_const(non_frac); +} + static inline u32 rfixed_div(fixed20_12 A, fixed20_12 B) { u64 tmp = ((u64)A.full << 13); |