I've just done a quick search of my old source code branches and found a patch entitled "imx290: Hack for 120fps modes on IMX462".
It's against an old branch (rpi-6.0.y by the looks of it), but the diff isVarious bits have moved (eg setting the CSI-2 registers based on link freq instead of hard coded in the tables), but that appears to confirm that there is a need to halve the HMAX value and double the pixel rate.
I did check with Sony and 12bit 120fps is not supported on either IMX290 or IMX462, so the driver really needs to disable it in this mode.
It's against an old branch (rpi-6.0.y by the looks of it), but the diff is
Code:
diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.cindex bc135737242f..3ef3f07bf77e 100644--- a/drivers/media/i2c/imx290.c+++ b/drivers/media/i2c/imx290.c@@ -336,7 +336,7 @@ static const struct imx290_regval imx290_74_250mhz_clock_1080p[] = { static const struct imx290_regval imx290_1080p_settings[] = { /* mode settings */- { IMX290_FR_FDG_SEL, 0x01},+ { IMX290_FR_FDG_SEL, 0x00}, { IMX290_CTRL_07, IMX290_WINMODE_1080P }, { IMX290_WINWV_OB, 12 }, { IMX290_OPB_SIZE_V, 10 },@@ -363,15 +363,15 @@ static const struct imx290_regval imx290_1080p_4lane_settings[] = { { IMX290_PHY_LANE_NUM, 0x03 }, { IMX290_CSI_LANE_MODE, 0x03 }, /* data rate settings */- { IMX290_REPETITION, 0x10 },- { IMX290_TCLKPOST, 87 },- { IMX290_THSZERO, 55 },- { IMX290_THSPREPARE, 31 },- { IMX290_TCLKTRAIL, 31 },- { IMX290_THSTRAIL, 31 },- { IMX290_TCLKZERO, 119 },- { IMX290_TCLKPREPARE, 31 },- { IMX290_TLPX, 23 },+ { IMX290_REPETITION, 0x00 },+ { IMX290_TCLKPOST, 119 },+ { IMX290_THSZERO, 103 },+ { IMX290_THSPREPARE, 71 },+ { IMX290_TCLKTRAIL, 55 },+ { IMX290_THSTRAIL, 63 },+ { IMX290_TCLKZERO, 255 },+ { IMX290_TCLKPREPARE, 63 },+ { IMX290_TLPX, 55 }, }; static const struct imx290_regval imx290_37_125mhz_clock_720p[] = {@@ -398,7 +398,7 @@ static const struct imx290_regval imx290_74_250mhz_clock_720p[] = { static const struct imx290_regval imx290_720p_settings[] = { /* mode settings */- { IMX290_FR_FDG_SEL, 0x01},+ { IMX290_FR_FDG_SEL, 0x00}, { IMX290_CTRL_07, IMX290_WINMODE_720P }, { IMX290_WINWV_OB, 6 }, { IMX290_OPB_SIZE_V, 4 },@@ -425,15 +425,15 @@ static const struct imx290_regval imx290_720p_4lane_settings[] = { { IMX290_PHY_LANE_NUM, 0x03 }, { IMX290_CSI_LANE_MODE, 0x03 }, /* data rate settings */- { IMX290_REPETITION, 0x10 },- { IMX290_TCLKPOST, 79 },- { IMX290_THSZERO, 47 },- { IMX290_THSPREPARE, 23 },- { IMX290_TCLKTRAIL, 23 },- { IMX290_THSTRAIL, 23 },- { IMX290_TCLKZERO, 87 },- { IMX290_TCLKPREPARE, 23 },- { IMX290_TLPX, 23 },+ { IMX290_REPETITION, 0x00 },+ { IMX290_TCLKPOST, 103 },+ { IMX290_THSZERO, 87 },+ { IMX290_THSPREPARE, 47 },+ { IMX290_TCLKTRAIL, 39 },+ { IMX290_THSTRAIL, 47 },+ { IMX290_TCLKZERO, 191 },+ { IMX290_TCLKPREPARE, 47 },+ { IMX290_TLPX, 39 }, }; static const struct imx290_regval imx290_10bit_settings[] = {@@ -677,7 +677,7 @@ static int imx290_set_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_HBLANK: ret = imx290_write(imx290, IMX290_HMAX,- imx290->current_mode->width + ctrl->val,+ (imx290->current_mode->width + ctrl->val) >> 1, NULL); break; case V4L2_CID_VBLANK:@@ -813,7 +813,7 @@ static inline u8 imx290_get_link_freq_index(struct imx290 *imx290) static u64 imx290_calc_pixel_rate(struct imx290 *imx290) {- return 148500000;+ return 297000000; } static int imx290_set_fmt(struct v4l2_subdev *sd,I did check with Sony and 12bit 120fps is not supported on either IMX290 or IMX462, so the driver really needs to disable it in this mode.
Statistics: Posted by 6by9 — Tue Oct 22, 2024 11:20 am