On Wed May 20 22:27:38 2026 +0200, Laurent Pinchart wrote:
> The total scaling factor including bi-linear downscaling and decimation
> is clamped to 16. The bilinear factor calculation therefore produceds
> values guaranteed not to exceed the maximum factor of 2.0. The clamping
> is unneeded, drop it.
> 
> Note that the ISI_DOWNSCALE_THRESHOLD value of 0x4000 is incorrect, as
> that would be a factor of 4.0. This was inconsequential given that the
> computed factor never exceeded 0x2000.
> 
> Reviewed-by: Frank Li <[email protected]>
> Reviewed-by: Guoniu Zhou <[email protected]>
> Link: 
> https://patch.msgid.link/[email protected]
> Signed-off-by: Laurent Pinchart <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

---

diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c 
b/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c
index 16b20ea2d1db..e07eebae9e2b 100644
--- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c
+++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c
@@ -11,8 +11,6 @@
 #include "imx8-isi-core.h"
 #include "imx8-isi-regs.h"
 
-#define        ISI_DOWNSCALE_THRESHOLD         0x4000
-
 static inline u32 mxc_isi_read(struct mxc_isi_pipe *pipe, u32 reg)
 {
        return readl(pipe->regs + reg);
@@ -118,8 +116,7 @@ static u32 mxc_isi_channel_scaling_ratio(unsigned int from, 
unsigned int to,
         * output (input / scale_factor) rounds up to exactly the desired
         * output.
         */
-       return min_t(u32, DIV_ROUND_UP(from * 0x1000, to * *dec),
-                    ISI_DOWNSCALE_THRESHOLD);
+       return DIV_ROUND_UP(from * 0x1000, to * *dec);
 }
 
 static void mxc_isi_channel_set_scaling(struct mxc_isi_pipe *pipe,
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to