mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 22:23:27 +00:00
8299d1f057
Rebased RPi foundation patches on linux 5.10.59, removed applied and reverted patches, wireless patches and defconfig patches. bcm2708: boot tested on RPi B+ v1.2 bcm2709: boot tested on RPi 4B v1.1 4G bcm2711: boot tested on RPi 4B v1.1 4G Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
50 lines
1.6 KiB
Diff
50 lines
1.6 KiB
Diff
From 3393c38cc1462337f40e24be91f47974bcfc3e4c Mon Sep 17 00:00:00 2001
|
|
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
|
Date: Thu, 17 Jun 2021 13:00:39 +0100
|
|
Subject: [PATCH] media: i2c: imx290: Fix the pixel rate at 148.5Mpix/s
|
|
|
|
Whilst the datasheet lists the link frequency changing between
|
|
1080p and 720p modes, reality is that with the default blanking
|
|
we have
|
|
(1920 + 280) * (1080 + 45) * 60fps = 148.5MPix/s
|
|
and
|
|
(1280 + 2020) * (720 + 30) * 60fps = 148.5MPix/s
|
|
and this reflects reality whether in 10 or 12 bit readout modes.
|
|
|
|
How this relates to link frequency is unclear as it differs
|
|
from the datasheet, but all exposure and frame rate calcs need
|
|
the pixel rate to be correct, so make it so.
|
|
|
|
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
|
---
|
|
drivers/media/i2c/imx290.c | 16 +---------------
|
|
1 file changed, 1 insertion(+), 15 deletions(-)
|
|
|
|
--- a/drivers/media/i2c/imx290.c
|
|
+++ b/drivers/media/i2c/imx290.c
|
|
@@ -853,23 +853,9 @@ static inline u8 imx290_get_link_freq_in
|
|
return imx290->current_mode->link_freq_index;
|
|
}
|
|
|
|
-static s64 imx290_get_link_freq(struct imx290 *imx290)
|
|
-{
|
|
- u8 index = imx290_get_link_freq_index(imx290);
|
|
-
|
|
- return *(imx290_link_freqs_ptr(imx290) + index);
|
|
-}
|
|
-
|
|
static u64 imx290_calc_pixel_rate(struct imx290 *imx290)
|
|
{
|
|
- s64 link_freq = imx290_get_link_freq(imx290);
|
|
- u8 nlanes = imx290->nlanes;
|
|
- u64 pixel_rate;
|
|
-
|
|
- /* pixel rate = link_freq * 2 * nr_of_lanes / bits_per_sample */
|
|
- pixel_rate = link_freq * 2 * nlanes;
|
|
- do_div(pixel_rate, imx290->bpp);
|
|
- return pixel_rate;
|
|
+ return 148500000;
|
|
}
|
|
|
|
static int imx290_set_fmt(struct v4l2_subdev *sd,
|