Re: [Intel-gfx] [PATCH 4/8] drm/i915: Addition wrapper for fixed16.16 operation
Hi, Thanks for review :) -Mahesh On Wednesday 21 June 2017 03:10 PM, Lankhorst, Maarten wrote: Mahesh Kumar schreef op wo 21-06-2017 om 11:44 [+0530]: This patch introduce addition wrapper for fixed point 16.16 operations. Which will be used by later patches to avoid direct member variables access of fixed_16_16_t structure. add_fixed16 : takes 2 fixed_16_16_t variable & returns fixed_16_16_t add_fixed16_u32 : takes fixed_16_16_t & u32 variable & returns fixed_16_16_t Much easier to review. :) Reviewed-by: Maarten Lankhorstfor first 4 patches. ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 4/8] drm/i915: Addition wrapper for fixed16.16 operation
Mahesh Kumar schreef op wo 21-06-2017 om 11:44 [+0530]: > This patch introduce addition wrapper for fixed point 16.16 > operations. > Which will be used by later patches to avoid direct member variables > access of fixed_16_16_t structure. > > add_fixed16 : takes 2 fixed_16_16_t variable & returns fixed_16_16_t > add_fixed16_u32 : takes fixed_16_16_t & u32 variable & returns > fixed_16_16_t Much easier to review. :) Reviewed-by: Maarten Lankhorstfor first 4 patches. ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 4/8] drm/i915: Addition wrapper for fixed16.16 operation
This patch introduce addition wrapper for fixed point 16.16 operations. Which will be used by later patches to avoid direct member variables access of fixed_16_16_t structure. add_fixed16 : takes 2 fixed_16_16_t variable & returns fixed_16_16_t add_fixed16_u32 : takes fixed_16_16_t & u32 variable & returns fixed_16_16_t Signed-off-by: Mahesh Kumar--- drivers/gpu/drm/i915/i915_drv.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 4edcf5d3d043..7014cad60794 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -224,6 +224,25 @@ static inline uint_fixed_16_16_t mul_u32_fixed16(uint32_t val, return clamp_u64_to_fixed16(intermediate_val); } +static inline uint_fixed_16_16_t add_fixed16(uint_fixed_16_16_t add1, +uint_fixed_16_16_t add2) +{ + uint64_t interm_sum; + + interm_sum = (uint64_t) add1.val + add2.val; + return clamp_u64_to_fixed16(interm_sum); +} + +static inline uint_fixed_16_16_t add_fixed16_u32(uint_fixed_16_16_t add1, +uint32_t add2) +{ + uint64_t interm_sum; + uint_fixed_16_16_t interm_add2 = u32_to_fixed16(add2); + + interm_sum = (uint64_t) add1.val + interm_add2.val; + return clamp_u64_to_fixed16(interm_sum); +} + static inline const char *yesno(bool v) { return v ? "yes" : "no"; -- 2.13.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx