media: rockchip: isp: fix only part of picture is handle by tnr

1. fix gain_wr_length is wrong;
2. disable isp gain output when pp is not enable;

Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
Change-Id: Ib47c858e37db99a3d339fe6757a4a27517f49c17
This commit is contained in:
Hu Kejun
2020-04-13 15:08:33 +08:00
committed by Tao Huang
parent 216b7956c8
commit e71213a2ef
2 changed files with 17 additions and 7 deletions

View File

@@ -3314,13 +3314,19 @@ isp_gain_config(struct rkisp_isp_params_vdev *params_vdev,
{
struct rkisp_isp_params_val_v2x *priv_val =
(struct rkisp_isp_params_val_v2x *)params_vdev->priv_val;
u32 value, i;
u32 value, i, gain_wsize;
gain_wsize = rkisp_ioread32(params_vdev, MI_GAIN_WR_SIZE);
gain_wsize &= 0x0FFFFFF0;
if (gain_wsize)
value = (priv_val->dhaz_en & 0x01) << 16 |
(priv_val->wdr_en & 0x01) << 12 |
(priv_val->tmo_en & 0x01) << 8 |
(priv_val->lsc_en & 0x01) << 4 |
(priv_val->mge_en & 0x01);
else
value = 0;
value = (priv_val->dhaz_en & 0x01) << 16 |
(priv_val->wdr_en & 0x01) << 12 |
(priv_val->tmo_en & 0x01) << 8 |
(priv_val->lsc_en & 0x01) << 4 |
(priv_val->mge_en & 0x01);
rkisp_iowrite32(params_vdev, value, ISP_GAIN_CTRL);
value = arg->mge_gain[0];

View File

@@ -164,6 +164,7 @@ static int mpfbc_s_rx_buffer(struct v4l2_subdev *sd,
u32 w = ALIGN(mpfbc_dev->crop.width, 16);
u32 h = ALIGN(mpfbc_dev->crop.height, 16);
u32 sizes = (w * h >> 4) + w * h * 2;
u32 w_tmp;
int ret = 0;
if (!dbuf || !size)
@@ -222,7 +223,10 @@ static int mpfbc_s_rx_buffer(struct v4l2_subdev *sd,
SW_GAIN_WR_PINGPONG);
}
writel(*size, base + MI_GAIN_WR_SIZE);
writel(w >> 4, base + MI_GAIN_WR_LENGTH);
w_tmp = (mpfbc_dev->crop.width + 3) / 4;
w_tmp = ALIGN(w_tmp, 16);
writel(w_tmp, base + MI_GAIN_WR_LENGTH);
mi_wr_ctrl2(base, SW_GAIN_WR_AUTOUPD);
}