]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
gpu: ipu-v3: Fix dev_dbg frequency output
authorLeo Ruan <tingquan.ruan@cn.bosch.com>
Mon, 7 Feb 2022 15:14:11 +0000 (16:14 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:42:28 +0000 (14:42 +0200)
commit7d005f5716124eb0671d2386ea366040ee51f81f
treeabb246d22acd22ba60bf9d9f86fa111d8ebf7343
parenta6dce998df937f7e8e83a02e85b70f442ebc97e9
gpu: ipu-v3: Fix dev_dbg frequency output

BugLink: https://bugs.launchpad.net/bugs/1969857
[ 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@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.kernel.org/r/20220207151411.5009-1-mark.jonas@de.bosch.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/ipu-v3/ipu-di.c