Patch "gpu: ipu-v3: Fix dev_dbg frequency output" has been added to the 4.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    gpu: ipu-v3: Fix dev_dbg frequency output

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     gpu-ipu-v3-fix-dev_dbg-frequency-output.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit e7db1d6f2839ef3607277be3e7db675e5d001d18
Author: Leo Ruan <tingquan.ruan@xxxxxxxxxxxx>
Date:   Mon Feb 7 16:14:11 2022 +0100

    gpu: ipu-v3: Fix dev_dbg frequency output
    
    [ Upstream commit 070a88fd4a03f921b73a2059e97d55faaa447dab ]
    
    This commit corrects the printing of the IPU clock error percentage if
    it is between -0.1% to -0.9%. For example, if the pixel clock requested
    is 27.2 MHz but only 27.0 MHz can be achieved the deviation is -0.8%.
    But the fixed point math had a flaw and calculated error of 0.2%.
    
    Before:
      Clocks: IPU 270000000Hz DI 24716667Hz Needed 27200000Hz
      IPU clock can give 27000000 with divider 10, error 0.2%
      Want 27200000Hz IPU 270000000Hz DI 24716667Hz using IPU, 27000000Hz
    
    After:
      Clocks: IPU 270000000Hz DI 24716667Hz Needed 27200000Hz
      IPU clock can give 27000000 with divider 10, error -0.8%
      Want 27200000Hz IPU 270000000Hz DI 24716667Hz using IPU, 27000000Hz
    
    Signed-off-by: Leo Ruan <tingquan.ruan@xxxxxxxxxxxx>
    Signed-off-by: Mark Jonas <mark.jonas@xxxxxxxxxxxx>
    Reviewed-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
    Signed-off-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220207151411.5009-1-mark.jonas@xxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/ipu-v3/ipu-di.c b/drivers/gpu/ipu-v3/ipu-di.c
index a8d87ddd8a17..dc0511b22600 100644
--- a/drivers/gpu/ipu-v3/ipu-di.c
+++ b/drivers/gpu/ipu-v3/ipu-di.c
@@ -460,8 +460,9 @@ static void ipu_di_config_clock(struct ipu_di *di,
 
 		error = rate / (sig->mode.pixelclock / 1000);
 
-		dev_dbg(di->ipu->dev, "  IPU clock can give %lu with divider %u, error %d.%u%%\n",
-			rate, div, (signed)(error - 1000) / 10, error % 10);
+		dev_dbg(di->ipu->dev, "  IPU clock can give %lu with divider %u, error %c%d.%d%%\n",
+			rate, div, error < 1000 ? '-' : '+',
+			abs(error - 1000) / 10, abs(error - 1000) % 10);
 
 		/* Allow a 1% error */
 		if (error < 1010 && error >= 990) {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux