| .. | .. |
|---|
| 1291 | 1291 | value &= ISP3X_RAWAE_BIG_EN; |
|---|
| 1292 | 1292 | |
|---|
| 1293 | 1293 | wnd_num_idx = arg->wnd_num; |
|---|
| 1294 | + if (wnd_num_idx >= ARRAY_SIZE(ae_wnd_num)) { |
|---|
| 1295 | + wnd_num_idx = ARRAY_SIZE(ae_wnd_num) - 1; |
|---|
| 1296 | + dev_err(params_vdev->dev->dev, |
|---|
| 1297 | + "%s invalid wnd_num:%d, set to %d\n", |
|---|
| 1298 | + __func__, arg->wnd_num, wnd_num_idx); |
|---|
| 1299 | + } |
|---|
| 1294 | 1300 | value |= ISP3X_RAWAE_BIG_WND0_NUM(wnd_num_idx); |
|---|
| 1295 | 1301 | |
|---|
| 1296 | 1302 | if (arg->subwin_en[0]) |
|---|
| .. | .. |
|---|
| 1430 | 1436 | return; |
|---|
| 1431 | 1437 | |
|---|
| 1432 | 1438 | for (i = 0; i < ISP3X_RAWAWB_WEIGHT_NUM / 5; i++) { |
|---|
| 1433 | | - isp3_param_write(params_vdev, |
|---|
| 1434 | | - (arg->sw_rawawb_wp_blk_wei_w[5 * i] & 0x3f) << 0 | |
|---|
| 1435 | | - (arg->sw_rawawb_wp_blk_wei_w[5 * i + 1] & 0x3f) << 6 | |
|---|
| 1436 | | - (arg->sw_rawawb_wp_blk_wei_w[5 * i + 2] & 0x3f) << 12 | |
|---|
| 1437 | | - (arg->sw_rawawb_wp_blk_wei_w[5 * i + 3] & 0x3f) << 18 | |
|---|
| 1438 | | - (arg->sw_rawawb_wp_blk_wei_w[5 * i + 4] & 0x3f) << 24, |
|---|
| 1439 | | - ISP3X_RAWAWB_WRAM_DATA_BASE, id); |
|---|
| 1439 | + val = (arg->sw_rawawb_wp_blk_wei_w[5 * i] & 0x3f) << 0 | |
|---|
| 1440 | + (arg->sw_rawawb_wp_blk_wei_w[5 * i + 1] & 0x3f) << 6 | |
|---|
| 1441 | + (arg->sw_rawawb_wp_blk_wei_w[5 * i + 2] & 0x3f) << 12 | |
|---|
| 1442 | + (arg->sw_rawawb_wp_blk_wei_w[5 * i + 3] & 0x3f) << 18 | |
|---|
| 1443 | + (arg->sw_rawawb_wp_blk_wei_w[5 * i + 4] & 0x3f) << 24; |
|---|
| 1444 | + isp3_param_write_direct(params_vdev, val, ISP3X_RAWAWB_WRAM_DATA_BASE, id); |
|---|
| 1440 | 1445 | } |
|---|
| 1441 | 1446 | } |
|---|
| 1442 | 1447 | |
|---|
| .. | .. |
|---|
| 2288 | 2293 | |
|---|
| 2289 | 2294 | if (params_vdev->dev->hw_dev->is_single) |
|---|
| 2290 | 2295 | isp_rawawb_cfg_sram(params_vdev, arg, false, id); |
|---|
| 2291 | | - else |
|---|
| 2292 | | - memcpy(arg_rec->sw_rawawb_wp_blk_wei_w, |
|---|
| 2293 | | - arg->sw_rawawb_wp_blk_wei_w, |
|---|
| 2294 | | - ISP3X_RAWAWB_WEIGHT_NUM); |
|---|
| 2296 | + memcpy(arg_rec->sw_rawawb_wp_blk_wei_w, |
|---|
| 2297 | + arg->sw_rawawb_wp_blk_wei_w, |
|---|
| 2298 | + ISP3X_RAWAWB_WEIGHT_NUM); |
|---|
| 2295 | 2299 | |
|---|
| 2296 | 2300 | /* avoid to override the old enable value */ |
|---|
| 2297 | 2301 | value = isp3_param_read(params_vdev, ISP3X_RAWAWB_CTRL, id); |
|---|
| .. | .. |
|---|
| 2426 | 2430 | return; |
|---|
| 2427 | 2431 | |
|---|
| 2428 | 2432 | wnd_num_idx = arg->wnd_num; |
|---|
| 2433 | + if (wnd_num_idx >= ARRAY_SIZE(hist_wnd_num)) { |
|---|
| 2434 | + wnd_num_idx = ARRAY_SIZE(hist_wnd_num) - 1; |
|---|
| 2435 | + dev_err(params_vdev->dev->dev, |
|---|
| 2436 | + "%s invalid wnd_num:%d, set to %d\n", |
|---|
| 2437 | + __func__, arg->wnd_num, wnd_num_idx); |
|---|
| 2438 | + } |
|---|
| 2429 | 2439 | memset(weight15x15, 0, sizeof(weight15x15)); |
|---|
| 2430 | 2440 | for (i = 0; i < hist_wnd_num[wnd_num_idx]; i++) { |
|---|
| 2431 | 2441 | for (j = 0; j < hist_wnd_num[wnd_num_idx]; j++) { |
|---|
| .. | .. |
|---|
| 2473 | 2483 | } |
|---|
| 2474 | 2484 | |
|---|
| 2475 | 2485 | wnd_num_idx = arg->wnd_num; |
|---|
| 2486 | + if (wnd_num_idx >= ARRAY_SIZE(hist_wnd_num)) { |
|---|
| 2487 | + wnd_num_idx = ARRAY_SIZE(hist_wnd_num) - 1; |
|---|
| 2488 | + dev_err(params_vdev->dev->dev, |
|---|
| 2489 | + "%s invalid wnd_num:%d, set to %d\n", |
|---|
| 2490 | + __func__, arg->wnd_num, wnd_num_idx); |
|---|
| 2491 | + } |
|---|
| 2476 | 2492 | /* avoid to override the old enable value */ |
|---|
| 2477 | 2493 | hist_ctrl = isp3_param_read(params_vdev, addr + ISP3X_RAWHIST_BIG_CTRL, id); |
|---|
| 2478 | 2494 | hist_ctrl &= ISP3X_RAWHIST_EN; |
|---|
| .. | .. |
|---|
| 2502 | 2518 | |
|---|
| 2503 | 2519 | if (dev->hw_dev->is_single) |
|---|
| 2504 | 2520 | isp_rawhstbig_cfg_sram(params_vdev, arg, blk_no, false, id); |
|---|
| 2505 | | - else |
|---|
| 2506 | | - *arg_rec = *arg; |
|---|
| 2521 | + *arg_rec = *arg; |
|---|
| 2507 | 2522 | } |
|---|
| 2508 | 2523 | |
|---|
| 2509 | 2524 | static void |
|---|