From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 04 Jan 2024 10:08:02 +0000
Subject: [PATCH] disable FB
---
kernel/drivers/media/platform/rockchip/isp/isp_params_v2x.c | 41 ++++++++++++++++++++++++++++++++---------
1 files changed, 32 insertions(+), 9 deletions(-)
diff --git a/kernel/drivers/media/platform/rockchip/isp/isp_params_v2x.c b/kernel/drivers/media/platform/rockchip/isp/isp_params_v2x.c
index b4525b3..c1497a9 100644
--- a/kernel/drivers/media/platform/rockchip/isp/isp_params_v2x.c
+++ b/kernel/drivers/media/platform/rockchip/isp/isp_params_v2x.c
@@ -461,6 +461,12 @@
};
wnd_num_idx = arg->wnd_num;
+ if (wnd_num_idx >= ARRAY_SIZE(hist_wnd_num)) {
+ wnd_num_idx = ARRAY_SIZE(hist_wnd_num) - 1;
+ dev_err(params_vdev->dev->dev,
+ "%s invalid wnd_num:%d, set to %d\n",
+ __func__, arg->wnd_num, wnd_num_idx);
+ }
for (i = 0; i < ISP2X_SIHIST_WIN_NUM; i++) {
/* avoid to override the old enable value */
hist_ctrl = rkisp_ioread32(params_vdev, ISP_HIST_HIST_CTRL + i * 0x10);
@@ -536,10 +542,9 @@
{
int i, j;
unsigned int sram_addr;
- unsigned int data;
+ unsigned int data = rkisp_ioread32(params_vdev, ISP_LSC_CTRL);
- if (is_check &&
- !(rkisp_ioread32(params_vdev, ISP_LSC_CTRL) & ISP_LSC_EN))
+ if (is_check && (data & ISP_LSC_LUT_EN || !(data & ISP_LSC_EN)))
return;
/* CIF_ISP_LSC_TABLE_ADDRESS_153 = ( 17 * 18 ) >> 1 */
@@ -679,12 +684,13 @@
* readback mode lsc lut AHB config to sram, once for single device,
* need record to switch for multi-device.
*/
- if (!IS_HDR_RDBK(dev->rd_mode))
+ if (!IS_HDR_RDBK(dev->rd_mode)) {
isp_lsc_matrix_cfg_ddr(params_vdev, arg);
- else if (dev->hw_dev->is_single)
- isp_lsc_matrix_cfg_sram(params_vdev, arg, false);
- else
+ } else {
params_rec->others.lsc_cfg = *arg;
+ if (dev->hw_dev->is_single)
+ isp_lsc_matrix_cfg_sram(params_vdev, arg, false);
+ }
for (i = 0; i < 4; i++) {
/* program x size tables */
@@ -1758,6 +1764,12 @@
ISP2X_REG_WR_MASK);
wnd_num_idx = arg->wnd_num;
+ if (wnd_num_idx >= ARRAY_SIZE(ae_wnd_num)) {
+ wnd_num_idx = ARRAY_SIZE(ae_wnd_num) - 1;
+ dev_err(params_vdev->dev->dev,
+ "%s invalid wnd_num:%d, set to %d\n",
+ __func__, arg->wnd_num, wnd_num_idx);
+ }
value |= ISP2X_RAWAEBIG_WNDNUM_SET(wnd_num_idx);
if (arg->subwin_en[0])
@@ -2831,6 +2843,12 @@
return;
wnd_num_idx = arg->wnd_num;
+ if (wnd_num_idx >= ARRAY_SIZE(hist_wnd_num)) {
+ wnd_num_idx = ARRAY_SIZE(hist_wnd_num) - 1;
+ dev_err(params_vdev->dev->dev,
+ "%s invalid wnd_num:%d, set to %d\n",
+ __func__, arg->wnd_num, wnd_num_idx);
+ }
memset(weight15x15, 0, sizeof(weight15x15));
for (i = 0; i < hist_wnd_num[wnd_num_idx]; i++) {
for (j = 0; j < hist_wnd_num[wnd_num_idx]; j++) {
@@ -2879,6 +2897,12 @@
}
wnd_num_idx = arg->wnd_num;
+ if (wnd_num_idx >= ARRAY_SIZE(hist_wnd_num)) {
+ wnd_num_idx = ARRAY_SIZE(hist_wnd_num) - 1;
+ dev_err(params_vdev->dev->dev,
+ "%s invalid wnd_num:%d, set to %d\n",
+ __func__, arg->wnd_num, wnd_num_idx);
+ }
/* avoid to override the old enable value */
hist_ctrl = rkisp_ioread32(params_vdev, addr + ISP_RAWHIST_BIG_CTRL);
hist_ctrl &= ISP2X_RAWHSTBIG_CTRL_EN_MASK;
@@ -2910,8 +2934,7 @@
if (dev->hw_dev->is_single)
isp_rawhstbig_cfg_sram(params_vdev, arg, blk_no, false);
- else
- *arg_rec = *arg;
+ *arg_rec = *arg;
}
static void
--
Gitblit v1.6.2