]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drm: Add drm_fixp_from_fraction and drm_fixp2int_ceil
authorHarry Wentland <harry.wentland@amd.com>
Fri, 22 Jan 2016 22:07:25 +0000 (17:07 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Mar 2016 23:07:20 +0000 (15:07 -0800)
commitb870070037823bea90709ea6b4b8a2c8ffcdc5f5
tree41fe6f38f9c26877ed8157cf8cb0861e7ef37943
parent2e614c50122b2c2470c6c0c79bcdad43bae8021b
drm: Add drm_fixp_from_fraction and drm_fixp2int_ceil

commit 64566b5e767f9bc3161055ca1b443a51afb52aad upstream.

drm_fixp_from_fraction allows us to create a fixed point directly
from a fraction, rather than creating fixed point values and dividing
later. This avoids overflow of our 64 bit value for large numbers.

drm_fixp2int_ceil allows us to return the ceiling of our fixed point
value.

[airlied: squash Jordan's fix]
32-bit-build-fix: Jordan Lazare <Jordan.Lazare@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/drm/drm_fixed.h