From abd449945ced1dfac00742f861c0360848dcbacb Mon Sep 17 00:00:00 2001 From: Andrei-Liviu Simion Date: Sun, 10 Aug 2014 14:01:58 -0700 Subject: [PATCH] dptx: MST: Removed dependency on math.h. Added equivalent ceil functionality. Signed-off-by: Andrei-Liviu Simion --- XilinxProcessorIPLib/drivers/dptx/src/xdptx_spm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/XilinxProcessorIPLib/drivers/dptx/src/xdptx_spm.c b/XilinxProcessorIPLib/drivers/dptx/src/xdptx_spm.c index 4df2b1bf..f0c59bba 100644 --- a/XilinxProcessorIPLib/drivers/dptx/src/xdptx_spm.c +++ b/XilinxProcessorIPLib/drivers/dptx/src/xdptx_spm.c @@ -727,7 +727,12 @@ static void XDptx_CalculateTs(XDptx *InstancePtr, u8 Stream, u8 BitsPerPixel) /* Calculate the payload bandiwdth number (PBN). */ InstancePtr->MstStreamConfig[Stream - 1].MstPbn = - ceil(1.006 * PeakPixelBw * ((double)64 / 54)); + 1.006 * PeakPixelBw * ((double)64 / 54); + /* Ceil - round up if required, avoiding overhead of math.h. */ + if ((double)(1.006 * PeakPixelBw * ((double)64 / 54)) > + ((double)InstancePtr->MstStreamConfig[Stream - 1].MstPbn)) { + InstancePtr->MstStreamConfig[Stream - 1].MstPbn++; + } /* Calculate the average stream symbol time slots per MTP. */ Average_StreamSymbolTimeSlotsPerMTP = (64.0 * PeakPixelBw / LinkBw);