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_v3x.c | 41 ++++++++++++++++++++++++++++-------------
1 files changed, 28 insertions(+), 13 deletions(-)
diff --git a/kernel/drivers/media/platform/rockchip/isp/isp_params_v3x.c b/kernel/drivers/media/platform/rockchip/isp/isp_params_v3x.c
index bd1e557..0491cc9 100644
--- a/kernel/drivers/media/platform/rockchip/isp/isp_params_v3x.c
+++ b/kernel/drivers/media/platform/rockchip/isp/isp_params_v3x.c
@@ -1291,6 +1291,12 @@
value &= ISP3X_RAWAE_BIG_EN;
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 |= ISP3X_RAWAE_BIG_WND0_NUM(wnd_num_idx);
if (arg->subwin_en[0])
@@ -1430,13 +1436,12 @@
return;
for (i = 0; i < ISP3X_RAWAWB_WEIGHT_NUM / 5; i++) {
- isp3_param_write(params_vdev,
- (arg->sw_rawawb_wp_blk_wei_w[5 * i] & 0x3f) << 0 |
- (arg->sw_rawawb_wp_blk_wei_w[5 * i + 1] & 0x3f) << 6 |
- (arg->sw_rawawb_wp_blk_wei_w[5 * i + 2] & 0x3f) << 12 |
- (arg->sw_rawawb_wp_blk_wei_w[5 * i + 3] & 0x3f) << 18 |
- (arg->sw_rawawb_wp_blk_wei_w[5 * i + 4] & 0x3f) << 24,
- ISP3X_RAWAWB_WRAM_DATA_BASE, id);
+ val = (arg->sw_rawawb_wp_blk_wei_w[5 * i] & 0x3f) << 0 |
+ (arg->sw_rawawb_wp_blk_wei_w[5 * i + 1] & 0x3f) << 6 |
+ (arg->sw_rawawb_wp_blk_wei_w[5 * i + 2] & 0x3f) << 12 |
+ (arg->sw_rawawb_wp_blk_wei_w[5 * i + 3] & 0x3f) << 18 |
+ (arg->sw_rawawb_wp_blk_wei_w[5 * i + 4] & 0x3f) << 24;
+ isp3_param_write_direct(params_vdev, val, ISP3X_RAWAWB_WRAM_DATA_BASE, id);
}
}
@@ -2288,10 +2293,9 @@
if (params_vdev->dev->hw_dev->is_single)
isp_rawawb_cfg_sram(params_vdev, arg, false, id);
- else
- memcpy(arg_rec->sw_rawawb_wp_blk_wei_w,
- arg->sw_rawawb_wp_blk_wei_w,
- ISP3X_RAWAWB_WEIGHT_NUM);
+ memcpy(arg_rec->sw_rawawb_wp_blk_wei_w,
+ arg->sw_rawawb_wp_blk_wei_w,
+ ISP3X_RAWAWB_WEIGHT_NUM);
/* avoid to override the old enable value */
value = isp3_param_read(params_vdev, ISP3X_RAWAWB_CTRL, id);
@@ -2426,6 +2430,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++) {
@@ -2473,6 +2483,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 = isp3_param_read(params_vdev, addr + ISP3X_RAWHIST_BIG_CTRL, id);
hist_ctrl &= ISP3X_RAWHIST_EN;
@@ -2502,8 +2518,7 @@
if (dev->hw_dev->is_single)
isp_rawhstbig_cfg_sram(params_vdev, arg, blk_no, false, id);
- else
- *arg_rec = *arg;
+ *arg_rec = *arg;
}
static void
--
Gitblit v1.6.2