1
0
Fork 0
Commit Graph

5 Commits (5e48e55fb57a9026e6b3b6961def6d2aeb210659)

Author SHA1 Message Date
Harry Wentland 64566b5e76 drm: Add drm_fixp_from_fraction and drm_fixp2int_ceil
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>
Cc: stable@vger.kernel.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-02-05 15:23:48 +10:00
Alex Deucher a838834b2f drm: fix 64 bit drm fixed point helpers
Sign bit wasn't handled properly and a small typo.

Thanks to Christian for helping me sort this out.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-07-30 17:24:13 -04:00
Alex Deucher 210a0b9e21 drm: add some additional fixed point helpers (v3)
Required for certain driver calculations.  Code
was written by Christian König and ported to the
drm by me.

v2: fix 64 bit divides
v3: fix 64 bit for real (math64.h)

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-06-27 19:16:37 -04:00
Robert Morell f7f6c340f9 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>
2012-04-27 09:29:35 +01:00
Ben Skeggs 68adac5e49 drm: move radeon_fixed.h to shared drm_fixed.h header
Will be used by nouveau driver also in the near future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-05-18 18:21:33 +10:00