| .. | .. |
|---|
| 47 | 47 | |
|---|
| 48 | 48 | static inline void |
|---|
| 49 | 49 | isp3_param_write(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 50 | | - u32 value, u32 addr) |
|---|
| 50 | + u32 value, u32 addr, u32 id) |
|---|
| 51 | 51 | { |
|---|
| 52 | | - rkisp_write(params_vdev->dev, addr, value, false); |
|---|
| 52 | + if (id == ISP3_LEFT) |
|---|
| 53 | + rkisp_write(params_vdev->dev, addr, value, false); |
|---|
| 54 | + else |
|---|
| 55 | + rkisp_next_write(params_vdev->dev, addr, value, false); |
|---|
| 53 | 56 | } |
|---|
| 54 | 57 | |
|---|
| 55 | 58 | static inline u32 |
|---|
| .. | .. |
|---|
| 59 | 62 | } |
|---|
| 60 | 63 | |
|---|
| 61 | 64 | static inline u32 |
|---|
| 62 | | -isp3_param_read(struct rkisp_isp_params_vdev *params_vdev, u32 addr) |
|---|
| 65 | +isp3_param_read(struct rkisp_isp_params_vdev *params_vdev, u32 addr, u32 id) |
|---|
| 63 | 66 | { |
|---|
| 64 | | - return rkisp_read(params_vdev->dev, addr, false); |
|---|
| 67 | + u32 val; |
|---|
| 68 | + |
|---|
| 69 | + if (id == ISP3_LEFT) |
|---|
| 70 | + val = rkisp_read(params_vdev->dev, addr, false); |
|---|
| 71 | + else |
|---|
| 72 | + val = rkisp_next_read(params_vdev->dev, addr, false); |
|---|
| 73 | + return val; |
|---|
| 65 | 74 | } |
|---|
| 66 | 75 | |
|---|
| 67 | 76 | static inline u32 |
|---|
| 68 | | -isp3_param_read_cache(struct rkisp_isp_params_vdev *params_vdev, u32 addr) |
|---|
| 77 | +isp3_param_read_cache(struct rkisp_isp_params_vdev *params_vdev, u32 addr, u32 id) |
|---|
| 69 | 78 | { |
|---|
| 70 | | - return rkisp_read_reg_cache(params_vdev->dev, addr); |
|---|
| 79 | + u32 val; |
|---|
| 80 | + |
|---|
| 81 | + if (id == ISP3_LEFT) |
|---|
| 82 | + val = rkisp_read_reg_cache(params_vdev->dev, addr); |
|---|
| 83 | + else |
|---|
| 84 | + val = rkisp_next_read_reg_cache(params_vdev->dev, addr); |
|---|
| 85 | + return val; |
|---|
| 71 | 86 | } |
|---|
| 72 | 87 | |
|---|
| 73 | 88 | static inline void |
|---|
| 74 | 89 | isp3_param_set_bits(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 75 | | - u32 reg, u32 bit_mask) |
|---|
| 90 | + u32 reg, u32 bit_mask, u32 id) |
|---|
| 76 | 91 | { |
|---|
| 77 | | - rkisp_set_bits(params_vdev->dev, reg, 0, bit_mask, false); |
|---|
| 92 | + if (id == ISP3_LEFT) |
|---|
| 93 | + rkisp_set_bits(params_vdev->dev, reg, 0, bit_mask, false); |
|---|
| 94 | + else |
|---|
| 95 | + rkisp_next_set_bits(params_vdev->dev, reg, 0, bit_mask, false); |
|---|
| 78 | 96 | } |
|---|
| 79 | 97 | |
|---|
| 80 | 98 | static inline void |
|---|
| 81 | 99 | isp3_param_clear_bits(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 82 | | - u32 reg, u32 bit_mask) |
|---|
| 100 | + u32 reg, u32 bit_mask, u32 id) |
|---|
| 83 | 101 | { |
|---|
| 84 | | - rkisp_clear_bits(params_vdev->dev, reg, bit_mask, false); |
|---|
| 102 | + if (id == ISP3_LEFT) |
|---|
| 103 | + rkisp_clear_bits(params_vdev->dev, reg, bit_mask, false); |
|---|
| 104 | + else |
|---|
| 105 | + rkisp_next_clear_bits(params_vdev->dev, reg, bit_mask, false); |
|---|
| 85 | 106 | } |
|---|
| 86 | 107 | |
|---|
| 87 | 108 | static void |
|---|
| 88 | 109 | isp_dpcc_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 89 | | - const struct isp2x_dpcc_cfg *arg) |
|---|
| 110 | + const struct isp2x_dpcc_cfg *arg, u32 id) |
|---|
| 90 | 111 | { |
|---|
| 91 | 112 | u32 value; |
|---|
| 92 | 113 | int i; |
|---|
| 93 | 114 | |
|---|
| 94 | | - value = isp3_param_read(params_vdev, ISP3X_DPCC0_MODE); |
|---|
| 115 | + value = isp3_param_read(params_vdev, ISP3X_DPCC0_MODE, id); |
|---|
| 95 | 116 | value &= ISP_DPCC_EN; |
|---|
| 96 | 117 | |
|---|
| 97 | 118 | value |= !!arg->stage1_enable << 2 | |
|---|
| 98 | 119 | !!arg->grayscale_mode << 1; |
|---|
| 99 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_MODE); |
|---|
| 100 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_MODE); |
|---|
| 120 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_MODE, id); |
|---|
| 121 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_MODE, id); |
|---|
| 101 | 122 | |
|---|
| 102 | 123 | value = (arg->sw_rk_out_sel & 0x03) << 5 | |
|---|
| 103 | 124 | !!arg->sw_dpcc_output_sel << 4 | |
|---|
| .. | .. |
|---|
| 105 | 126 | !!arg->stage1_g_3x3 << 2 | |
|---|
| 106 | 127 | !!arg->stage1_incl_rb_center << 1 | |
|---|
| 107 | 128 | !!arg->stage1_incl_green_center; |
|---|
| 108 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_OUTPUT_MODE); |
|---|
| 109 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_OUTPUT_MODE); |
|---|
| 129 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_OUTPUT_MODE, id); |
|---|
| 130 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_OUTPUT_MODE, id); |
|---|
| 110 | 131 | |
|---|
| 111 | 132 | value = !!arg->stage1_use_fix_set << 3 | |
|---|
| 112 | 133 | !!arg->stage1_use_set_3 << 2 | |
|---|
| 113 | 134 | !!arg->stage1_use_set_2 << 1 | |
|---|
| 114 | 135 | !!arg->stage1_use_set_1; |
|---|
| 115 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_SET_USE); |
|---|
| 116 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_SET_USE); |
|---|
| 136 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_SET_USE, id); |
|---|
| 137 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_SET_USE, id); |
|---|
| 117 | 138 | |
|---|
| 118 | 139 | value = !!arg->sw_rk_red_blue1_en << 13 | |
|---|
| 119 | 140 | !!arg->rg_red_blue1_enable << 12 | |
|---|
| .. | .. |
|---|
| 127 | 148 | !!arg->ro_green1_enable << 2 | |
|---|
| 128 | 149 | !!arg->lc_green1_enable << 1 | |
|---|
| 129 | 150 | !!arg->pg_green1_enable; |
|---|
| 130 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_METHODS_SET_1); |
|---|
| 131 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_METHODS_SET_1); |
|---|
| 151 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_METHODS_SET_1, id); |
|---|
| 152 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_METHODS_SET_1, id); |
|---|
| 132 | 153 | |
|---|
| 133 | 154 | value = !!arg->sw_rk_red_blue2_en << 13 | |
|---|
| 134 | 155 | !!arg->rg_red_blue2_enable << 12 | |
|---|
| .. | .. |
|---|
| 142 | 163 | !!arg->ro_green2_enable << 2 | |
|---|
| 143 | 164 | !!arg->lc_green2_enable << 1 | |
|---|
| 144 | 165 | !!arg->pg_green2_enable; |
|---|
| 145 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_METHODS_SET_2); |
|---|
| 146 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_METHODS_SET_2); |
|---|
| 166 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_METHODS_SET_2, id); |
|---|
| 167 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_METHODS_SET_2, id); |
|---|
| 147 | 168 | |
|---|
| 148 | 169 | value = !!arg->sw_rk_red_blue3_en << 13 | |
|---|
| 149 | 170 | !!arg->rg_red_blue3_enable << 12 | |
|---|
| .. | .. |
|---|
| 157 | 178 | !!arg->ro_green3_enable << 2 | |
|---|
| 158 | 179 | !!arg->lc_green3_enable << 1 | |
|---|
| 159 | 180 | !!arg->pg_green3_enable; |
|---|
| 160 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_METHODS_SET_3); |
|---|
| 161 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_METHODS_SET_3); |
|---|
| 181 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_METHODS_SET_3, id); |
|---|
| 182 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_METHODS_SET_3, id); |
|---|
| 162 | 183 | |
|---|
| 163 | 184 | value = ISP_PACK_4BYTE(arg->line_thr_1_g, arg->line_thr_1_rb, |
|---|
| 164 | 185 | arg->sw_mindis1_g, arg->sw_mindis1_rb); |
|---|
| 165 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_LINE_THRESH_1); |
|---|
| 166 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_LINE_THRESH_1); |
|---|
| 186 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_LINE_THRESH_1, id); |
|---|
| 187 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_LINE_THRESH_1, id); |
|---|
| 167 | 188 | |
|---|
| 168 | 189 | value = ISP_PACK_4BYTE(arg->line_mad_fac_1_g, arg->line_mad_fac_1_rb, |
|---|
| 169 | 190 | arg->sw_dis_scale_max1, arg->sw_dis_scale_min1); |
|---|
| 170 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_LINE_MAD_FAC_1); |
|---|
| 171 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_LINE_MAD_FAC_1); |
|---|
| 191 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_LINE_MAD_FAC_1, id); |
|---|
| 192 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_LINE_MAD_FAC_1, id); |
|---|
| 172 | 193 | |
|---|
| 173 | 194 | value = ISP_PACK_4BYTE(arg->pg_fac_1_g, arg->pg_fac_1_rb, 0, 0); |
|---|
| 174 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_PG_FAC_1); |
|---|
| 175 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_PG_FAC_1); |
|---|
| 195 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_PG_FAC_1, id); |
|---|
| 196 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_PG_FAC_1, id); |
|---|
| 176 | 197 | |
|---|
| 177 | 198 | value = ISP_PACK_4BYTE(arg->rnd_thr_1_g, arg->rnd_thr_1_rb, 0, 0); |
|---|
| 178 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_RND_THRESH_1); |
|---|
| 179 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_RND_THRESH_1); |
|---|
| 199 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_RND_THRESH_1, id); |
|---|
| 200 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_RND_THRESH_1, id); |
|---|
| 180 | 201 | |
|---|
| 181 | 202 | value = ISP_PACK_4BYTE(arg->rg_fac_1_g, arg->rg_fac_1_rb, 0, 0); |
|---|
| 182 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_RG_FAC_1); |
|---|
| 183 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_RG_FAC_1); |
|---|
| 203 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_RG_FAC_1, id); |
|---|
| 204 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_RG_FAC_1, id); |
|---|
| 184 | 205 | |
|---|
| 185 | 206 | value = ISP_PACK_4BYTE(arg->line_thr_2_g, arg->line_thr_2_rb, |
|---|
| 186 | 207 | arg->sw_mindis2_g, arg->sw_mindis2_rb); |
|---|
| 187 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_LINE_THRESH_2); |
|---|
| 188 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_LINE_THRESH_2); |
|---|
| 208 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_LINE_THRESH_2, id); |
|---|
| 209 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_LINE_THRESH_2, id); |
|---|
| 189 | 210 | |
|---|
| 190 | 211 | value = ISP_PACK_4BYTE(arg->line_mad_fac_2_g, arg->line_mad_fac_2_rb, |
|---|
| 191 | 212 | arg->sw_dis_scale_max2, arg->sw_dis_scale_min2); |
|---|
| 192 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_LINE_MAD_FAC_2); |
|---|
| 193 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_LINE_MAD_FAC_2); |
|---|
| 213 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_LINE_MAD_FAC_2, id); |
|---|
| 214 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_LINE_MAD_FAC_2, id); |
|---|
| 194 | 215 | |
|---|
| 195 | 216 | value = ISP_PACK_4BYTE(arg->pg_fac_2_g, arg->pg_fac_2_rb, 0, 0); |
|---|
| 196 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_PG_FAC_2); |
|---|
| 197 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_PG_FAC_2); |
|---|
| 217 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_PG_FAC_2, id); |
|---|
| 218 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_PG_FAC_2, id); |
|---|
| 198 | 219 | |
|---|
| 199 | 220 | value = ISP_PACK_4BYTE(arg->rnd_thr_2_g, arg->rnd_thr_2_rb, 0, 0); |
|---|
| 200 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_RND_THRESH_2); |
|---|
| 201 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_RND_THRESH_2); |
|---|
| 221 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_RND_THRESH_2, id); |
|---|
| 222 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_RND_THRESH_2, id); |
|---|
| 202 | 223 | |
|---|
| 203 | 224 | value = ISP_PACK_4BYTE(arg->rg_fac_2_g, arg->rg_fac_2_rb, 0, 0); |
|---|
| 204 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_RG_FAC_2); |
|---|
| 205 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_RG_FAC_2); |
|---|
| 225 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_RG_FAC_2, id); |
|---|
| 226 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_RG_FAC_2, id); |
|---|
| 206 | 227 | |
|---|
| 207 | 228 | value = ISP_PACK_4BYTE(arg->line_thr_3_g, arg->line_thr_3_rb, |
|---|
| 208 | 229 | arg->sw_mindis3_g, arg->sw_mindis3_rb); |
|---|
| 209 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_LINE_THRESH_3); |
|---|
| 210 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_LINE_THRESH_3); |
|---|
| 230 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_LINE_THRESH_3, id); |
|---|
| 231 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_LINE_THRESH_3, id); |
|---|
| 211 | 232 | |
|---|
| 212 | 233 | value = ISP_PACK_4BYTE(arg->line_mad_fac_3_g, arg->line_mad_fac_3_rb, |
|---|
| 213 | 234 | arg->sw_dis_scale_max3, arg->sw_dis_scale_min3); |
|---|
| 214 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_LINE_MAD_FAC_3); |
|---|
| 215 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_LINE_MAD_FAC_3); |
|---|
| 235 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_LINE_MAD_FAC_3, id); |
|---|
| 236 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_LINE_MAD_FAC_3, id); |
|---|
| 216 | 237 | |
|---|
| 217 | 238 | value = ISP_PACK_4BYTE(arg->pg_fac_3_g, arg->pg_fac_3_rb, 0, 0); |
|---|
| 218 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_PG_FAC_3); |
|---|
| 219 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_PG_FAC_3); |
|---|
| 239 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_PG_FAC_3, id); |
|---|
| 240 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_PG_FAC_3, id); |
|---|
| 220 | 241 | |
|---|
| 221 | 242 | value = ISP_PACK_4BYTE(arg->rnd_thr_3_g, arg->rnd_thr_3_rb, 0, 0); |
|---|
| 222 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_RND_THRESH_3); |
|---|
| 223 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_RND_THRESH_3); |
|---|
| 243 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_RND_THRESH_3, id); |
|---|
| 244 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_RND_THRESH_3, id); |
|---|
| 224 | 245 | |
|---|
| 225 | 246 | value = ISP_PACK_4BYTE(arg->rg_fac_3_g, arg->rg_fac_3_rb, 0, 0); |
|---|
| 226 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_RG_FAC_3); |
|---|
| 227 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_RG_FAC_3); |
|---|
| 247 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_RG_FAC_3, id); |
|---|
| 248 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_RG_FAC_3, id); |
|---|
| 228 | 249 | |
|---|
| 229 | 250 | value = (arg->ro_lim_3_rb & 0x03) << 10 | |
|---|
| 230 | 251 | (arg->ro_lim_3_g & 0x03) << 8 | |
|---|
| .. | .. |
|---|
| 232 | 253 | (arg->ro_lim_2_g & 0x03) << 4 | |
|---|
| 233 | 254 | (arg->ro_lim_1_rb & 0x03) << 2 | |
|---|
| 234 | 255 | (arg->ro_lim_1_g & 0x03); |
|---|
| 235 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_RO_LIMITS); |
|---|
| 236 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_RO_LIMITS); |
|---|
| 256 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_RO_LIMITS, id); |
|---|
| 257 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_RO_LIMITS, id); |
|---|
| 237 | 258 | |
|---|
| 238 | 259 | value = (arg->rnd_offs_3_rb & 0x03) << 10 | |
|---|
| 239 | 260 | (arg->rnd_offs_3_g & 0x03) << 8 | |
|---|
| .. | .. |
|---|
| 241 | 262 | (arg->rnd_offs_2_g & 0x03) << 4 | |
|---|
| 242 | 263 | (arg->rnd_offs_1_rb & 0x03) << 2 | |
|---|
| 243 | 264 | (arg->rnd_offs_1_g & 0x03); |
|---|
| 244 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_RND_OFFS); |
|---|
| 245 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_RND_OFFS); |
|---|
| 265 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_RND_OFFS, id); |
|---|
| 266 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_RND_OFFS, id); |
|---|
| 246 | 267 | |
|---|
| 247 | 268 | value = !!arg->bpt_rb_3x3 << 11 | |
|---|
| 248 | 269 | !!arg->bpt_g_3x3 << 10 | |
|---|
| .. | .. |
|---|
| 254 | 275 | !!arg->bpt_use_set_1 << 4 | |
|---|
| 255 | 276 | !!arg->bpt_cor_en << 1 | |
|---|
| 256 | 277 | !!arg->bpt_det_en; |
|---|
| 257 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_BPT_CTRL); |
|---|
| 258 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_BPT_CTRL); |
|---|
| 278 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_BPT_CTRL, id); |
|---|
| 279 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_BPT_CTRL, id); |
|---|
| 259 | 280 | |
|---|
| 260 | | - isp3_param_write(params_vdev, arg->bp_number, ISP3X_DPCC0_BPT_NUMBER); |
|---|
| 261 | | - isp3_param_write(params_vdev, arg->bp_number, ISP3X_DPCC1_BPT_NUMBER); |
|---|
| 262 | | - isp3_param_write(params_vdev, arg->bp_table_addr, ISP3X_DPCC0_BPT_ADDR); |
|---|
| 263 | | - isp3_param_write(params_vdev, arg->bp_table_addr, ISP3X_DPCC1_BPT_ADDR); |
|---|
| 281 | + isp3_param_write(params_vdev, arg->bp_number, ISP3X_DPCC0_BPT_NUMBER, id); |
|---|
| 282 | + isp3_param_write(params_vdev, arg->bp_number, ISP3X_DPCC1_BPT_NUMBER, id); |
|---|
| 283 | + isp3_param_write(params_vdev, arg->bp_table_addr, ISP3X_DPCC0_BPT_ADDR, id); |
|---|
| 284 | + isp3_param_write(params_vdev, arg->bp_table_addr, ISP3X_DPCC1_BPT_ADDR, id); |
|---|
| 264 | 285 | |
|---|
| 265 | 286 | value = ISP_PACK_2SHORT(arg->bpt_h_addr, arg->bpt_v_addr); |
|---|
| 266 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_BPT_DATA); |
|---|
| 267 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_BPT_DATA); |
|---|
| 287 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_BPT_DATA, id); |
|---|
| 288 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_BPT_DATA, id); |
|---|
| 268 | 289 | |
|---|
| 269 | | - isp3_param_write(params_vdev, arg->bp_cnt, ISP3X_DPCC0_BP_CNT); |
|---|
| 270 | | - isp3_param_write(params_vdev, arg->bp_cnt, ISP3X_DPCC1_BP_CNT); |
|---|
| 290 | + isp3_param_write(params_vdev, arg->bp_cnt, ISP3X_DPCC0_BP_CNT, id); |
|---|
| 291 | + isp3_param_write(params_vdev, arg->bp_cnt, ISP3X_DPCC1_BP_CNT, id); |
|---|
| 271 | 292 | |
|---|
| 272 | | - isp3_param_write(params_vdev, arg->sw_pdaf_en, ISP3X_DPCC0_PDAF_EN); |
|---|
| 273 | | - isp3_param_write(params_vdev, arg->sw_pdaf_en, ISP3X_DPCC1_PDAF_EN); |
|---|
| 293 | + isp3_param_write(params_vdev, arg->sw_pdaf_en, ISP3X_DPCC0_PDAF_EN, id); |
|---|
| 294 | + isp3_param_write(params_vdev, arg->sw_pdaf_en, ISP3X_DPCC1_PDAF_EN, id); |
|---|
| 274 | 295 | |
|---|
| 275 | 296 | value = 0; |
|---|
| 276 | 297 | for (i = 0; i < ISP32_DPCC_PDAF_POINT_NUM; i++) |
|---|
| 277 | 298 | value |= !!arg->pdaf_point_en[i] << i; |
|---|
| 278 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_PDAF_POINT_EN); |
|---|
| 279 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_PDAF_POINT_EN); |
|---|
| 299 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_PDAF_POINT_EN, id); |
|---|
| 300 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_PDAF_POINT_EN, id); |
|---|
| 280 | 301 | |
|---|
| 281 | 302 | value = ISP_PACK_2SHORT(arg->pdaf_offsetx, arg->pdaf_offsety); |
|---|
| 282 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_PDAF_OFFSET); |
|---|
| 283 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_PDAF_OFFSET); |
|---|
| 303 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_PDAF_OFFSET, id); |
|---|
| 304 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_PDAF_OFFSET, id); |
|---|
| 284 | 305 | |
|---|
| 285 | 306 | value = ISP_PACK_2SHORT(arg->pdaf_wrapx, arg->pdaf_wrapy); |
|---|
| 286 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_PDAF_WRAP); |
|---|
| 287 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_PDAF_WRAP); |
|---|
| 307 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_PDAF_WRAP, id); |
|---|
| 308 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_PDAF_WRAP, id); |
|---|
| 288 | 309 | |
|---|
| 289 | 310 | value = ISP_PACK_2SHORT(arg->pdaf_wrapx_num, arg->pdaf_wrapy_num); |
|---|
| 290 | | - isp3_param_write(params_vdev, value, ISP_DPCC0_PDAF_SCOPE); |
|---|
| 291 | | - isp3_param_write(params_vdev, value, ISP_DPCC1_PDAF_SCOPE); |
|---|
| 311 | + isp3_param_write(params_vdev, value, ISP_DPCC0_PDAF_SCOPE, id); |
|---|
| 312 | + isp3_param_write(params_vdev, value, ISP_DPCC1_PDAF_SCOPE, id); |
|---|
| 292 | 313 | |
|---|
| 293 | 314 | for (i = 0; i < ISP32_DPCC_PDAF_POINT_NUM / 2; i++) { |
|---|
| 294 | 315 | value = ISP_PACK_4BYTE(arg->point[2 * i].x, arg->point[2 * i].y, |
|---|
| 295 | 316 | arg->point[2 * i + 1].x, arg->point[2 * i + 1].y); |
|---|
| 296 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_PDAF_POINT_0 + 4 * i); |
|---|
| 297 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_PDAF_POINT_0 + 4 * i); |
|---|
| 317 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_PDAF_POINT_0 + 4 * i, id); |
|---|
| 318 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_PDAF_POINT_0 + 4 * i, id); |
|---|
| 298 | 319 | } |
|---|
| 299 | 320 | |
|---|
| 300 | | - isp3_param_write(params_vdev, arg->pdaf_forward_med, ISP3X_DPCC0_PDAF_FORWARD_MED); |
|---|
| 301 | | - isp3_param_write(params_vdev, arg->pdaf_forward_med, ISP3X_DPCC1_PDAF_FORWARD_MED); |
|---|
| 321 | + isp3_param_write(params_vdev, arg->pdaf_forward_med, ISP3X_DPCC0_PDAF_FORWARD_MED, id); |
|---|
| 322 | + isp3_param_write(params_vdev, arg->pdaf_forward_med, ISP3X_DPCC1_PDAF_FORWARD_MED, id); |
|---|
| 302 | 323 | } |
|---|
| 303 | 324 | |
|---|
| 304 | 325 | static void |
|---|
| 305 | | -isp_dpcc_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 326 | +isp_dpcc_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 306 | 327 | { |
|---|
| 307 | 328 | u32 value; |
|---|
| 308 | 329 | |
|---|
| 309 | | - value = isp3_param_read(params_vdev, ISP3X_DPCC0_MODE); |
|---|
| 330 | + value = isp3_param_read(params_vdev, ISP3X_DPCC0_MODE, id); |
|---|
| 310 | 331 | value &= ~ISP_DPCC_EN; |
|---|
| 311 | 332 | |
|---|
| 312 | 333 | if (en) |
|---|
| 313 | 334 | value |= ISP_DPCC_EN; |
|---|
| 314 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC0_MODE); |
|---|
| 315 | | - isp3_param_write(params_vdev, value, ISP3X_DPCC1_MODE); |
|---|
| 335 | + isp3_param_write(params_vdev, value, ISP3X_DPCC0_MODE, id); |
|---|
| 336 | + isp3_param_write(params_vdev, value, ISP3X_DPCC1_MODE, id); |
|---|
| 316 | 337 | } |
|---|
| 317 | 338 | |
|---|
| 318 | 339 | static void |
|---|
| 319 | 340 | isp_bls_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 320 | | - const struct isp32_bls_cfg *arg) |
|---|
| 341 | + const struct isp32_bls_cfg *arg, u32 id) |
|---|
| 321 | 342 | { |
|---|
| 322 | 343 | const struct isp2x_bls_fixed_val *pval; |
|---|
| 323 | 344 | u32 new_control, value; |
|---|
| 324 | 345 | |
|---|
| 325 | | - new_control = isp3_param_read(params_vdev, ISP3X_BLS_CTRL); |
|---|
| 346 | + new_control = isp3_param_read(params_vdev, ISP3X_BLS_CTRL, id); |
|---|
| 326 | 347 | new_control &= (ISP_BLS_ENA | ISP32_BLS_BLS2_EN); |
|---|
| 327 | 348 | |
|---|
| 328 | 349 | pval = &arg->bls1_val; |
|---|
| .. | .. |
|---|
| 331 | 352 | |
|---|
| 332 | 353 | switch (params_vdev->raw_type) { |
|---|
| 333 | 354 | case RAW_BGGR: |
|---|
| 334 | | - isp3_param_write(params_vdev, pval->r, ISP3X_BLS1_D_FIXED); |
|---|
| 335 | | - isp3_param_write(params_vdev, pval->gr, ISP3X_BLS1_C_FIXED); |
|---|
| 336 | | - isp3_param_write(params_vdev, pval->gb, ISP3X_BLS1_B_FIXED); |
|---|
| 337 | | - isp3_param_write(params_vdev, pval->b, ISP3X_BLS1_A_FIXED); |
|---|
| 355 | + isp3_param_write(params_vdev, pval->r, ISP3X_BLS1_D_FIXED, id); |
|---|
| 356 | + isp3_param_write(params_vdev, pval->gr, ISP3X_BLS1_C_FIXED, id); |
|---|
| 357 | + isp3_param_write(params_vdev, pval->gb, ISP3X_BLS1_B_FIXED, id); |
|---|
| 358 | + isp3_param_write(params_vdev, pval->b, ISP3X_BLS1_A_FIXED, id); |
|---|
| 338 | 359 | break; |
|---|
| 339 | 360 | case RAW_GBRG: |
|---|
| 340 | | - isp3_param_write(params_vdev, pval->r, ISP3X_BLS1_C_FIXED); |
|---|
| 341 | | - isp3_param_write(params_vdev, pval->gr, ISP3X_BLS1_D_FIXED); |
|---|
| 342 | | - isp3_param_write(params_vdev, pval->gb, ISP3X_BLS1_A_FIXED); |
|---|
| 343 | | - isp3_param_write(params_vdev, pval->b, ISP3X_BLS1_B_FIXED); |
|---|
| 361 | + isp3_param_write(params_vdev, pval->r, ISP3X_BLS1_C_FIXED, id); |
|---|
| 362 | + isp3_param_write(params_vdev, pval->gr, ISP3X_BLS1_D_FIXED, id); |
|---|
| 363 | + isp3_param_write(params_vdev, pval->gb, ISP3X_BLS1_A_FIXED, id); |
|---|
| 364 | + isp3_param_write(params_vdev, pval->b, ISP3X_BLS1_B_FIXED, id); |
|---|
| 344 | 365 | break; |
|---|
| 345 | 366 | case RAW_GRBG: |
|---|
| 346 | | - isp3_param_write(params_vdev, pval->r, ISP3X_BLS1_B_FIXED); |
|---|
| 347 | | - isp3_param_write(params_vdev, pval->gr, ISP3X_BLS1_A_FIXED); |
|---|
| 348 | | - isp3_param_write(params_vdev, pval->gb, ISP3X_BLS1_D_FIXED); |
|---|
| 349 | | - isp3_param_write(params_vdev, pval->b, ISP3X_BLS1_C_FIXED); |
|---|
| 367 | + isp3_param_write(params_vdev, pval->r, ISP3X_BLS1_B_FIXED, id); |
|---|
| 368 | + isp3_param_write(params_vdev, pval->gr, ISP3X_BLS1_A_FIXED, id); |
|---|
| 369 | + isp3_param_write(params_vdev, pval->gb, ISP3X_BLS1_D_FIXED, id); |
|---|
| 370 | + isp3_param_write(params_vdev, pval->b, ISP3X_BLS1_C_FIXED, id); |
|---|
| 350 | 371 | break; |
|---|
| 351 | 372 | case RAW_RGGB: |
|---|
| 352 | 373 | default: |
|---|
| 353 | | - isp3_param_write(params_vdev, pval->r, ISP3X_BLS1_A_FIXED); |
|---|
| 354 | | - isp3_param_write(params_vdev, pval->gr, ISP3X_BLS1_B_FIXED); |
|---|
| 355 | | - isp3_param_write(params_vdev, pval->gb, ISP3X_BLS1_C_FIXED); |
|---|
| 356 | | - isp3_param_write(params_vdev, pval->b, ISP3X_BLS1_D_FIXED); |
|---|
| 374 | + isp3_param_write(params_vdev, pval->r, ISP3X_BLS1_A_FIXED, id); |
|---|
| 375 | + isp3_param_write(params_vdev, pval->gr, ISP3X_BLS1_B_FIXED, id); |
|---|
| 376 | + isp3_param_write(params_vdev, pval->gb, ISP3X_BLS1_C_FIXED, id); |
|---|
| 377 | + isp3_param_write(params_vdev, pval->b, ISP3X_BLS1_D_FIXED, id); |
|---|
| 357 | 378 | break; |
|---|
| 358 | 379 | } |
|---|
| 359 | 380 | } |
|---|
| .. | .. |
|---|
| 363 | 384 | if (!arg->enable_auto) { |
|---|
| 364 | 385 | switch (params_vdev->raw_type) { |
|---|
| 365 | 386 | case RAW_BGGR: |
|---|
| 366 | | - isp3_param_write(params_vdev, pval->r, ISP3X_BLS_D_FIXED); |
|---|
| 367 | | - isp3_param_write(params_vdev, pval->gr, ISP3X_BLS_C_FIXED); |
|---|
| 368 | | - isp3_param_write(params_vdev, pval->gb, ISP3X_BLS_B_FIXED); |
|---|
| 369 | | - isp3_param_write(params_vdev, pval->b, ISP3X_BLS_A_FIXED); |
|---|
| 387 | + isp3_param_write(params_vdev, pval->r, ISP3X_BLS_D_FIXED, id); |
|---|
| 388 | + isp3_param_write(params_vdev, pval->gr, ISP3X_BLS_C_FIXED, id); |
|---|
| 389 | + isp3_param_write(params_vdev, pval->gb, ISP3X_BLS_B_FIXED, id); |
|---|
| 390 | + isp3_param_write(params_vdev, pval->b, ISP3X_BLS_A_FIXED, id); |
|---|
| 370 | 391 | break; |
|---|
| 371 | 392 | case RAW_GBRG: |
|---|
| 372 | | - isp3_param_write(params_vdev, pval->r, ISP3X_BLS_C_FIXED); |
|---|
| 373 | | - isp3_param_write(params_vdev, pval->gr, ISP3X_BLS_D_FIXED); |
|---|
| 374 | | - isp3_param_write(params_vdev, pval->gb, ISP3X_BLS_A_FIXED); |
|---|
| 375 | | - isp3_param_write(params_vdev, pval->b, ISP3X_BLS_B_FIXED); |
|---|
| 393 | + isp3_param_write(params_vdev, pval->r, ISP3X_BLS_C_FIXED, id); |
|---|
| 394 | + isp3_param_write(params_vdev, pval->gr, ISP3X_BLS_D_FIXED, id); |
|---|
| 395 | + isp3_param_write(params_vdev, pval->gb, ISP3X_BLS_A_FIXED, id); |
|---|
| 396 | + isp3_param_write(params_vdev, pval->b, ISP3X_BLS_B_FIXED, id); |
|---|
| 376 | 397 | break; |
|---|
| 377 | 398 | case RAW_GRBG: |
|---|
| 378 | | - isp3_param_write(params_vdev, pval->r, ISP3X_BLS_B_FIXED); |
|---|
| 379 | | - isp3_param_write(params_vdev, pval->gr, ISP3X_BLS_A_FIXED); |
|---|
| 380 | | - isp3_param_write(params_vdev, pval->gb, ISP3X_BLS_D_FIXED); |
|---|
| 381 | | - isp3_param_write(params_vdev, pval->b, ISP3X_BLS_C_FIXED); |
|---|
| 399 | + isp3_param_write(params_vdev, pval->r, ISP3X_BLS_B_FIXED, id); |
|---|
| 400 | + isp3_param_write(params_vdev, pval->gr, ISP3X_BLS_A_FIXED, id); |
|---|
| 401 | + isp3_param_write(params_vdev, pval->gb, ISP3X_BLS_D_FIXED, id); |
|---|
| 402 | + isp3_param_write(params_vdev, pval->b, ISP3X_BLS_C_FIXED, id); |
|---|
| 382 | 403 | break; |
|---|
| 383 | 404 | case RAW_RGGB: |
|---|
| 384 | 405 | default: |
|---|
| 385 | | - isp3_param_write(params_vdev, pval->r, ISP3X_BLS_A_FIXED); |
|---|
| 386 | | - isp3_param_write(params_vdev, pval->gr, ISP3X_BLS_B_FIXED); |
|---|
| 387 | | - isp3_param_write(params_vdev, pval->gb, ISP3X_BLS_C_FIXED); |
|---|
| 388 | | - isp3_param_write(params_vdev, pval->b, ISP3X_BLS_D_FIXED); |
|---|
| 406 | + isp3_param_write(params_vdev, pval->r, ISP3X_BLS_A_FIXED, id); |
|---|
| 407 | + isp3_param_write(params_vdev, pval->gr, ISP3X_BLS_B_FIXED, id); |
|---|
| 408 | + isp3_param_write(params_vdev, pval->gb, ISP3X_BLS_C_FIXED, id); |
|---|
| 409 | + isp3_param_write(params_vdev, pval->b, ISP3X_BLS_D_FIXED, id); |
|---|
| 389 | 410 | break; |
|---|
| 390 | 411 | } |
|---|
| 391 | 412 | } else { |
|---|
| 392 | 413 | if (arg->en_windows & BIT(1)) { |
|---|
| 393 | | - isp3_param_write(params_vdev, arg->bls_window2.h_offs, ISP3X_BLS_H2_START); |
|---|
| 414 | + isp3_param_write(params_vdev, arg->bls_window2.h_offs, ISP3X_BLS_H2_START, id); |
|---|
| 394 | 415 | value = arg->bls_window2.h_offs + arg->bls_window2.h_size; |
|---|
| 395 | | - isp3_param_write(params_vdev, value, ISP3X_BLS_H2_STOP); |
|---|
| 396 | | - isp3_param_write(params_vdev, arg->bls_window2.v_offs, ISP3X_BLS_V2_START); |
|---|
| 416 | + isp3_param_write(params_vdev, value, ISP3X_BLS_H2_STOP, id); |
|---|
| 417 | + isp3_param_write(params_vdev, arg->bls_window2.v_offs, ISP3X_BLS_V2_START, id); |
|---|
| 397 | 418 | value = arg->bls_window2.v_offs + arg->bls_window2.v_size; |
|---|
| 398 | | - isp3_param_write(params_vdev, value, ISP3X_BLS_V2_STOP); |
|---|
| 419 | + isp3_param_write(params_vdev, value, ISP3X_BLS_V2_STOP, id); |
|---|
| 399 | 420 | new_control |= ISP_BLS_WINDOW_2; |
|---|
| 400 | 421 | } |
|---|
| 401 | 422 | |
|---|
| 402 | 423 | if (arg->en_windows & BIT(0)) { |
|---|
| 403 | | - isp3_param_write(params_vdev, arg->bls_window1.h_offs, ISP3X_BLS_H1_START); |
|---|
| 424 | + isp3_param_write(params_vdev, arg->bls_window1.h_offs, ISP3X_BLS_H1_START, id); |
|---|
| 404 | 425 | value = arg->bls_window1.h_offs + arg->bls_window1.h_size; |
|---|
| 405 | | - isp3_param_write(params_vdev, value, ISP3X_BLS_H1_STOP); |
|---|
| 406 | | - isp3_param_write(params_vdev, arg->bls_window1.v_offs, ISP3X_BLS_V1_START); |
|---|
| 426 | + isp3_param_write(params_vdev, value, ISP3X_BLS_H1_STOP, id); |
|---|
| 427 | + isp3_param_write(params_vdev, arg->bls_window1.v_offs, ISP3X_BLS_V1_START, id); |
|---|
| 407 | 428 | value = arg->bls_window1.v_offs + arg->bls_window1.v_size; |
|---|
| 408 | | - isp3_param_write(params_vdev, value, ISP3X_BLS_V1_STOP); |
|---|
| 429 | + isp3_param_write(params_vdev, value, ISP3X_BLS_V1_STOP, id); |
|---|
| 409 | 430 | new_control |= ISP_BLS_WINDOW_1; |
|---|
| 410 | 431 | } |
|---|
| 411 | 432 | |
|---|
| 412 | | - isp3_param_write(params_vdev, arg->bls_samples, ISP3X_BLS_SAMPLES); |
|---|
| 433 | + isp3_param_write(params_vdev, arg->bls_samples, ISP3X_BLS_SAMPLES, id); |
|---|
| 413 | 434 | |
|---|
| 414 | 435 | new_control |= ISP_BLS_MODE_MEASURED; |
|---|
| 415 | 436 | } |
|---|
| 416 | | - isp3_param_write(params_vdev, new_control, ISP3X_BLS_CTRL); |
|---|
| 437 | + isp3_param_write(params_vdev, new_control, ISP3X_BLS_CTRL, id); |
|---|
| 417 | 438 | |
|---|
| 418 | | - isp3_param_write(params_vdev, arg->isp_ob_offset, ISP32_BLS_ISP_OB_OFFSET); |
|---|
| 419 | | - isp3_param_write(params_vdev, arg->isp_ob_predgain, ISP32_BLS_ISP_OB_PREDGAIN); |
|---|
| 420 | | - isp3_param_write(params_vdev, arg->isp_ob_max, ISP32_BLS_ISP_OB_MAX); |
|---|
| 439 | + isp3_param_write(params_vdev, arg->isp_ob_offset, ISP32_BLS_ISP_OB_OFFSET, id); |
|---|
| 440 | + isp3_param_write(params_vdev, arg->isp_ob_predgain, ISP32_BLS_ISP_OB_PREDGAIN, id); |
|---|
| 441 | + isp3_param_write(params_vdev, arg->isp_ob_max, ISP32_BLS_ISP_OB_MAX, id); |
|---|
| 421 | 442 | } |
|---|
| 422 | 443 | |
|---|
| 423 | 444 | static void |
|---|
| 424 | | -isp_bls_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 445 | +isp_bls_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 425 | 446 | { |
|---|
| 426 | 447 | u32 new_control; |
|---|
| 427 | 448 | |
|---|
| 428 | | - new_control = isp3_param_read(params_vdev, ISP3X_BLS_CTRL); |
|---|
| 449 | + new_control = isp3_param_read(params_vdev, ISP3X_BLS_CTRL, id); |
|---|
| 429 | 450 | if (en) |
|---|
| 430 | 451 | new_control |= ISP_BLS_ENA; |
|---|
| 431 | 452 | else |
|---|
| 432 | 453 | new_control &= ~ISP_BLS_ENA; |
|---|
| 433 | | - isp3_param_write(params_vdev, new_control, ISP3X_BLS_CTRL); |
|---|
| 454 | + isp3_param_write(params_vdev, new_control, ISP3X_BLS_CTRL, id); |
|---|
| 434 | 455 | } |
|---|
| 435 | 456 | |
|---|
| 436 | 457 | static void |
|---|
| 437 | 458 | isp_sdg_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 438 | | - const struct isp2x_sdg_cfg *arg) |
|---|
| 459 | + const struct isp2x_sdg_cfg *arg, u32 id) |
|---|
| 439 | 460 | { |
|---|
| 440 | 461 | int i; |
|---|
| 441 | 462 | |
|---|
| 442 | | - isp3_param_write(params_vdev, arg->xa_pnts.gamma_dx0, ISP3X_ISP_GAMMA_DX_LO); |
|---|
| 443 | | - isp3_param_write(params_vdev, arg->xa_pnts.gamma_dx1, ISP3X_ISP_GAMMA_DX_HI); |
|---|
| 463 | + isp3_param_write(params_vdev, arg->xa_pnts.gamma_dx0, ISP3X_ISP_GAMMA_DX_LO, id); |
|---|
| 464 | + isp3_param_write(params_vdev, arg->xa_pnts.gamma_dx1, ISP3X_ISP_GAMMA_DX_HI, id); |
|---|
| 444 | 465 | |
|---|
| 445 | 466 | for (i = 0; i < ISP32_DEGAMMA_CURVE_SIZE; i++) { |
|---|
| 446 | 467 | isp3_param_write(params_vdev, arg->curve_r.gamma_y[i], |
|---|
| 447 | | - ISP3X_ISP_GAMMA_R_Y_0 + i * 4); |
|---|
| 468 | + ISP3X_ISP_GAMMA_R_Y_0 + i * 4, id); |
|---|
| 448 | 469 | isp3_param_write(params_vdev, arg->curve_g.gamma_y[i], |
|---|
| 449 | | - ISP3X_ISP_GAMMA_G_Y_0 + i * 4); |
|---|
| 470 | + ISP3X_ISP_GAMMA_G_Y_0 + i * 4, id); |
|---|
| 450 | 471 | isp3_param_write(params_vdev, arg->curve_b.gamma_y[i], |
|---|
| 451 | | - ISP3X_ISP_GAMMA_B_Y_0 + i * 4); |
|---|
| 472 | + ISP3X_ISP_GAMMA_B_Y_0 + i * 4, id); |
|---|
| 452 | 473 | } |
|---|
| 453 | 474 | } |
|---|
| 454 | 475 | |
|---|
| 455 | 476 | static void |
|---|
| 456 | | -isp_sdg_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 477 | +isp_sdg_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 457 | 478 | { |
|---|
| 458 | 479 | u32 val; |
|---|
| 459 | 480 | |
|---|
| 460 | | - val = isp3_param_read_cache(params_vdev, ISP3X_ISP_CTRL0); |
|---|
| 481 | + val = isp3_param_read_cache(params_vdev, ISP3X_ISP_CTRL0, id); |
|---|
| 461 | 482 | if (en) |
|---|
| 462 | 483 | isp3_param_write(params_vdev, val | CIF_ISP_CTRL_ISP_GAMMA_IN_ENA, |
|---|
| 463 | | - ISP3X_ISP_CTRL0); |
|---|
| 484 | + ISP3X_ISP_CTRL0, id); |
|---|
| 464 | 485 | else |
|---|
| 465 | 486 | isp3_param_write(params_vdev, val & ~CIF_ISP_CTRL_ISP_GAMMA_IN_ENA, |
|---|
| 466 | | - ISP3X_ISP_CTRL0); |
|---|
| 487 | + ISP3X_ISP_CTRL0, id); |
|---|
| 467 | 488 | } |
|---|
| 468 | 489 | |
|---|
| 469 | 490 | static void __maybe_unused |
|---|
| .. | .. |
|---|
| 524 | 545 | } |
|---|
| 525 | 546 | rkisp_prepare_buffer(params_vdev->dev, &priv_val->buf_lsclut[buf_idx]); |
|---|
| 526 | 547 | data = priv_val->buf_lsclut[buf_idx].dma_addr; |
|---|
| 527 | | - isp3_param_write(params_vdev, data, ISP3X_MI_LUT_LSC_RD_BASE); |
|---|
| 528 | | - isp3_param_write(params_vdev, ISP32_LSC_LUT_TBL_SIZE, ISP3X_MI_LUT_LSC_RD_WSIZE); |
|---|
| 548 | + isp3_param_write(params_vdev, data, ISP3X_MI_LUT_LSC_RD_BASE, 0); |
|---|
| 549 | + isp3_param_write(params_vdev, ISP32_LSC_LUT_TBL_SIZE, ISP3X_MI_LUT_LSC_RD_WSIZE, 0); |
|---|
| 529 | 550 | } |
|---|
| 530 | 551 | |
|---|
| 531 | 552 | static void |
|---|
| 532 | 553 | isp_lsc_matrix_cfg_sram(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 533 | 554 | const struct isp3x_lsc_cfg *pconfig, |
|---|
| 534 | | - bool is_check) |
|---|
| 555 | + bool is_check, u32 id) |
|---|
| 535 | 556 | { |
|---|
| 536 | 557 | struct rkisp_device *dev = params_vdev->dev; |
|---|
| 537 | | - u32 sram_addr, data, table; |
|---|
| 558 | + u32 data = isp3_param_read(params_vdev, ISP3X_LSC_CTRL, id); |
|---|
| 559 | + u32 sram_addr, table; |
|---|
| 538 | 560 | int i, j; |
|---|
| 539 | 561 | |
|---|
| 540 | | - if (is_check && |
|---|
| 541 | | - !(isp3_param_read(params_vdev, ISP3X_LSC_CTRL) & ISP_LSC_EN)) |
|---|
| 562 | + if (is_check && (data & ISP3X_LSC_LUT_EN || !(data & ISP_LSC_EN))) |
|---|
| 542 | 563 | return; |
|---|
| 543 | 564 | |
|---|
| 544 | 565 | table = isp3_param_read_direct(params_vdev, ISP3X_LSC_STATUS); |
|---|
| .. | .. |
|---|
| 601 | 622 | (struct rkisp_isp_params_vdev *)data; |
|---|
| 602 | 623 | struct isp32_isp_params_cfg *params = params_vdev->isp32_params; |
|---|
| 603 | 624 | |
|---|
| 604 | | - isp_lsc_matrix_cfg_sram(params_vdev, ¶ms->others.lsc_cfg, true); |
|---|
| 625 | + isp_lsc_matrix_cfg_sram(params_vdev, ¶ms->others.lsc_cfg, true, 0); |
|---|
| 605 | 626 | } |
|---|
| 606 | 627 | |
|---|
| 607 | 628 | static void |
|---|
| 608 | 629 | isp_lsc_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 609 | | - const struct isp3x_lsc_cfg *arg) |
|---|
| 630 | + const struct isp3x_lsc_cfg *arg, u32 id) |
|---|
| 610 | 631 | { |
|---|
| 611 | 632 | struct rkisp_isp_params_val_v32 *priv_val = |
|---|
| 612 | 633 | (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 613 | | - struct isp32_isp_params_cfg *params_rec = params_vdev->isp32_params; |
|---|
| 634 | + struct isp32_isp_params_cfg *params_rec = params_vdev->isp32_params + id; |
|---|
| 614 | 635 | struct rkisp_device *dev = params_vdev->dev; |
|---|
| 615 | 636 | u32 data, lsc_ctrl; |
|---|
| 616 | 637 | int i; |
|---|
| 617 | 638 | |
|---|
| 618 | | - lsc_ctrl = isp3_param_read(params_vdev, ISP3X_LSC_CTRL); |
|---|
| 639 | + lsc_ctrl = isp3_param_read(params_vdev, ISP3X_LSC_CTRL, id); |
|---|
| 619 | 640 | if (dev->isp_ver == ISP_V32_L) { |
|---|
| 620 | 641 | /* one lsc sram table |
|---|
| 621 | 642 | * online mode lsc lut load from ddr quick for some sensor VB short |
|---|
| 622 | 643 | * readback mode lsc lut AHB config to sram, once for single device, |
|---|
| 623 | 644 | * need record to switch for multi-device. |
|---|
| 624 | 645 | */ |
|---|
| 625 | | - if (!IS_HDR_RDBK(dev->rd_mode)) |
|---|
| 646 | + if (!IS_HDR_RDBK(dev->rd_mode)) { |
|---|
| 626 | 647 | isp_lsc_matrix_cfg_ddr(params_vdev, arg); |
|---|
| 627 | | - else if (dev->hw_dev->is_single) |
|---|
| 628 | | - isp_lsc_matrix_cfg_sram(params_vdev, arg, false); |
|---|
| 629 | | - else |
|---|
| 648 | + } else { |
|---|
| 649 | + if (dev->hw_dev->is_single) |
|---|
| 650 | + isp_lsc_matrix_cfg_sram(params_vdev, arg, false, id); |
|---|
| 630 | 651 | params_rec->others.lsc_cfg = *arg; |
|---|
| 652 | + } |
|---|
| 631 | 653 | } else { |
|---|
| 632 | 654 | /* two lsc sram table */ |
|---|
| 633 | 655 | params_rec->others.lsc_cfg = *arg; |
|---|
| .. | .. |
|---|
| 637 | 659 | for (i = 0; i < ISP32_LSC_SIZE_TBL_SIZE / 4; i++) { |
|---|
| 638 | 660 | /* program x size tables */ |
|---|
| 639 | 661 | data = CIF_ISP_LSC_SECT_SIZE(arg->x_size_tbl[i * 2], arg->x_size_tbl[i * 2 + 1]); |
|---|
| 640 | | - isp3_param_write(params_vdev, data, ISP3X_LSC_XSIZE_01 + i * 4); |
|---|
| 662 | + isp3_param_write(params_vdev, data, ISP3X_LSC_XSIZE_01 + i * 4, id); |
|---|
| 641 | 663 | data = CIF_ISP_LSC_SECT_SIZE(arg->x_size_tbl[i * 2 + 8], arg->x_size_tbl[i * 2 + 9]); |
|---|
| 642 | | - isp3_param_write(params_vdev, data, ISP3X_LSC_XSIZE_89 + i * 4); |
|---|
| 664 | + isp3_param_write(params_vdev, data, ISP3X_LSC_XSIZE_89 + i * 4, id); |
|---|
| 643 | 665 | |
|---|
| 644 | 666 | /* program x grad tables */ |
|---|
| 645 | 667 | data = CIF_ISP_LSC_SECT_SIZE(arg->x_grad_tbl[i * 2], arg->x_grad_tbl[i * 2 + 1]); |
|---|
| 646 | | - isp3_param_write(params_vdev, data, ISP3X_LSC_XGRAD_01 + i * 4); |
|---|
| 668 | + isp3_param_write(params_vdev, data, ISP3X_LSC_XGRAD_01 + i * 4, id); |
|---|
| 647 | 669 | data = CIF_ISP_LSC_SECT_SIZE(arg->x_grad_tbl[i * 2 + 8], arg->x_grad_tbl[i * 2 + 9]); |
|---|
| 648 | | - isp3_param_write(params_vdev, data, ISP3X_LSC_XGRAD_89 + i * 4); |
|---|
| 670 | + isp3_param_write(params_vdev, data, ISP3X_LSC_XGRAD_89 + i * 4, id); |
|---|
| 649 | 671 | |
|---|
| 650 | 672 | /* program y size tables */ |
|---|
| 651 | 673 | data = CIF_ISP_LSC_SECT_SIZE(arg->y_size_tbl[i * 2], arg->y_size_tbl[i * 2 + 1]); |
|---|
| 652 | | - isp3_param_write(params_vdev, data, ISP3X_LSC_YSIZE_01 + i * 4); |
|---|
| 674 | + isp3_param_write(params_vdev, data, ISP3X_LSC_YSIZE_01 + i * 4, id); |
|---|
| 653 | 675 | data = CIF_ISP_LSC_SECT_SIZE(arg->y_size_tbl[i * 2 + 8], arg->y_size_tbl[i * 2 + 9]); |
|---|
| 654 | | - isp3_param_write(params_vdev, data, ISP3X_LSC_YSIZE_89 + i * 4); |
|---|
| 676 | + isp3_param_write(params_vdev, data, ISP3X_LSC_YSIZE_89 + i * 4, id); |
|---|
| 655 | 677 | |
|---|
| 656 | 678 | /* program y grad tables */ |
|---|
| 657 | 679 | data = CIF_ISP_LSC_SECT_SIZE(arg->y_grad_tbl[i * 2], arg->y_grad_tbl[i * 2 + 1]); |
|---|
| 658 | | - isp3_param_write(params_vdev, data, ISP3X_LSC_YGRAD_01 + i * 4); |
|---|
| 680 | + isp3_param_write(params_vdev, data, ISP3X_LSC_YGRAD_01 + i * 4, id); |
|---|
| 659 | 681 | data = CIF_ISP_LSC_SECT_SIZE(arg->y_grad_tbl[i * 2 + 8], arg->y_grad_tbl[i * 2 + 9]); |
|---|
| 660 | | - isp3_param_write(params_vdev, data, ISP3X_LSC_YGRAD_89 + i * 4); |
|---|
| 682 | + isp3_param_write(params_vdev, data, ISP3X_LSC_YGRAD_89 + i * 4, id); |
|---|
| 661 | 683 | } |
|---|
| 662 | 684 | |
|---|
| 663 | 685 | if (arg->sector_16x16) |
|---|
| .. | .. |
|---|
| 666 | 688 | lsc_ctrl &= ~ISP3X_LSC_SECTOR_16X16; |
|---|
| 667 | 689 | if (dev->isp_ver == ISP_V32_L && !IS_HDR_RDBK(dev->rd_mode)) |
|---|
| 668 | 690 | lsc_ctrl |= ISP3X_LSC_LUT_EN; |
|---|
| 669 | | - isp3_param_write(params_vdev, lsc_ctrl, ISP3X_LSC_CTRL); |
|---|
| 691 | + isp3_param_write(params_vdev, lsc_ctrl, ISP3X_LSC_CTRL, id); |
|---|
| 670 | 692 | } |
|---|
| 671 | 693 | |
|---|
| 672 | 694 | static void |
|---|
| 673 | | -isp_lsc_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 695 | +isp_lsc_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 674 | 696 | { |
|---|
| 675 | 697 | struct rkisp_device *dev = params_vdev->dev; |
|---|
| 676 | | - struct isp32_isp_params_cfg *params_rec = params_vdev->isp32_params; |
|---|
| 677 | | - u32 val = isp3_param_read(params_vdev, ISP3X_LSC_CTRL); |
|---|
| 698 | + struct isp32_isp_params_cfg *params_rec = params_vdev->isp32_params + id; |
|---|
| 699 | + u32 val = isp3_param_read(params_vdev, ISP3X_LSC_CTRL, id); |
|---|
| 678 | 700 | |
|---|
| 679 | 701 | if (en == !!(val & ISP_LSC_EN)) |
|---|
| 680 | 702 | return; |
|---|
| .. | .. |
|---|
| 683 | 705 | val = ISP_LSC_EN | ISP32_SELF_FORCE_UPD; |
|---|
| 684 | 706 | if (dev->isp_ver == ISP_V32_L && !IS_HDR_RDBK(dev->rd_mode)) |
|---|
| 685 | 707 | val |= ISP3X_LSC_LUT_EN; |
|---|
| 686 | | - isp3_param_set_bits(params_vdev, ISP3X_LSC_CTRL, val); |
|---|
| 708 | + isp3_param_set_bits(params_vdev, ISP3X_LSC_CTRL, val, id); |
|---|
| 687 | 709 | if (dev->isp_ver == ISP_V32 && params_vdev->dev->hw_dev->is_single) |
|---|
| 688 | 710 | isp_lsc_matrix_cfg_sram(params_vdev, |
|---|
| 689 | | - ¶ms_rec->others.lsc_cfg, false); |
|---|
| 711 | + ¶ms_rec->others.lsc_cfg, false, id); |
|---|
| 690 | 712 | } else { |
|---|
| 691 | | - isp3_param_clear_bits(params_vdev, ISP3X_LSC_CTRL, ISP_LSC_EN); |
|---|
| 692 | | - isp3_param_clear_bits(params_vdev, ISP3X_GAIN_CTRL, BIT(8)); |
|---|
| 713 | + isp3_param_clear_bits(params_vdev, ISP3X_LSC_CTRL, ISP_LSC_EN, id); |
|---|
| 714 | + isp3_param_clear_bits(params_vdev, ISP3X_GAIN_CTRL, BIT(8), id); |
|---|
| 693 | 715 | } |
|---|
| 694 | 716 | } |
|---|
| 695 | 717 | |
|---|
| 696 | 718 | static void |
|---|
| 697 | 719 | isp_debayer_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 698 | | - const struct isp32_debayer_cfg *arg) |
|---|
| 720 | + const struct isp32_debayer_cfg *arg, u32 id) |
|---|
| 699 | 721 | { |
|---|
| 700 | 722 | u32 value; |
|---|
| 701 | 723 | |
|---|
| 702 | | - value = isp3_param_read(params_vdev, ISP3X_DEBAYER_CONTROL); |
|---|
| 724 | + value = isp3_param_read(params_vdev, ISP3X_DEBAYER_CONTROL, id); |
|---|
| 703 | 725 | value &= ISP_DEBAYER_EN; |
|---|
| 704 | 726 | |
|---|
| 705 | 727 | value |= !!arg->filter_g_en << 4; |
|---|
| 706 | 728 | if (params_vdev->dev->isp_ver == ISP_V32) |
|---|
| 707 | 729 | value |= !!arg->filter_c_en << 8; |
|---|
| 708 | | - isp3_param_write(params_vdev, value, ISP3X_DEBAYER_CONTROL); |
|---|
| 730 | + isp3_param_write(params_vdev, value, ISP3X_DEBAYER_CONTROL, id); |
|---|
| 709 | 731 | |
|---|
| 710 | 732 | value = (arg->max_ratio & 0x3F) << 24 | arg->select_thed << 16 | |
|---|
| 711 | 733 | (arg->thed1 & 0x0F) << 12 | (arg->thed0 & 0x0F) << 8 | |
|---|
| 712 | 734 | (arg->dist_scale & 0x0F) << 4 | !!arg->clip_en; |
|---|
| 713 | | - isp3_param_write(params_vdev, value, ISP3X_DEBAYER_G_INTERP); |
|---|
| 735 | + isp3_param_write(params_vdev, value, ISP3X_DEBAYER_G_INTERP, id); |
|---|
| 714 | 736 | |
|---|
| 715 | 737 | value = (arg->filter1_coe4 & 0x1F) << 24 | (arg->filter1_coe3 & 0x1F) << 16 | |
|---|
| 716 | 738 | (arg->filter1_coe2 & 0x1F) << 8 | (arg->filter1_coe1 & 0x1F); |
|---|
| 717 | | - isp3_param_write(params_vdev, value, ISP3X_DEBAYER_G_INTERP_FILTER1); |
|---|
| 739 | + isp3_param_write(params_vdev, value, ISP3X_DEBAYER_G_INTERP_FILTER1, id); |
|---|
| 718 | 740 | |
|---|
| 719 | 741 | value = (arg->filter2_coe4 & 0x1F) << 24 | (arg->filter2_coe3 & 0x1F) << 16 | |
|---|
| 720 | 742 | (arg->filter2_coe2 & 0x1F) << 8 | (arg->filter2_coe1 & 0x1F); |
|---|
| 721 | | - isp3_param_write(params_vdev, value, ISP3X_DEBAYER_G_INTERP_FILTER2); |
|---|
| 743 | + isp3_param_write(params_vdev, value, ISP3X_DEBAYER_G_INTERP_FILTER2, id); |
|---|
| 722 | 744 | |
|---|
| 723 | 745 | value = arg->hf_offset << 16 | (arg->gain_offset & 0xFFF); |
|---|
| 724 | | - isp3_param_write(params_vdev, value, ISP32_DEBAYER_G_INTERP_OFFSET); |
|---|
| 746 | + isp3_param_write(params_vdev, value, ISP32_DEBAYER_G_INTERP_OFFSET, id); |
|---|
| 725 | 747 | |
|---|
| 726 | 748 | value = (arg->offset & 0x7FF); |
|---|
| 727 | | - isp3_param_write(params_vdev, value, ISP32_DEBAYER_G_FILTER_OFFSET); |
|---|
| 749 | + isp3_param_write(params_vdev, value, ISP32_DEBAYER_G_FILTER_OFFSET, id); |
|---|
| 728 | 750 | |
|---|
| 729 | 751 | if (params_vdev->dev->isp_ver != ISP_V32) |
|---|
| 730 | 752 | return; |
|---|
| 731 | 753 | |
|---|
| 732 | 754 | value = arg->guid_gaus_coe2 << 16 | |
|---|
| 733 | 755 | arg->guid_gaus_coe1 << 8 | arg->guid_gaus_coe0; |
|---|
| 734 | | - isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_GUIDE_GAUS); |
|---|
| 756 | + isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_GUIDE_GAUS, id); |
|---|
| 735 | 757 | |
|---|
| 736 | 758 | value = arg->ce_gaus_coe2 << 16 | |
|---|
| 737 | 759 | arg->ce_gaus_coe1 << 8 | arg->ce_gaus_coe0; |
|---|
| 738 | | - isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_CE_GAUS); |
|---|
| 760 | + isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_CE_GAUS, id); |
|---|
| 739 | 761 | |
|---|
| 740 | 762 | value = arg->alpha_gaus_coe2 << 16 | |
|---|
| 741 | 763 | arg->alpha_gaus_coe1 << 8 | arg->alpha_gaus_coe0; |
|---|
| 742 | | - isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_ALPHA_GAUS); |
|---|
| 764 | + isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_ALPHA_GAUS, id); |
|---|
| 743 | 765 | |
|---|
| 744 | 766 | value = (arg->loggd_offset & 0xfff) << 16 | (arg->loghf_offset & 0x1fff); |
|---|
| 745 | | - isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_LOG_OFFSET); |
|---|
| 767 | + isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_LOG_OFFSET, id); |
|---|
| 746 | 768 | |
|---|
| 747 | 769 | value = (arg->alpha_scale & 0xfffff) << 12 | (arg->alpha_offset & 0xfff); |
|---|
| 748 | | - isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_ALPHA); |
|---|
| 770 | + isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_ALPHA, id); |
|---|
| 749 | 771 | |
|---|
| 750 | 772 | value = (arg->edge_scale & 0xfffff) << 12 | (arg->edge_offset & 0xfff); |
|---|
| 751 | | - isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_EDGE); |
|---|
| 773 | + isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_EDGE, id); |
|---|
| 752 | 774 | |
|---|
| 753 | 775 | value = (arg->wgtslope & 0xfff) << 16 | |
|---|
| 754 | 776 | (arg->exp_shift & 0x3f) << 8 | arg->ce_sgm; |
|---|
| 755 | | - isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_IIR_0); |
|---|
| 777 | + isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_IIR_0, id); |
|---|
| 756 | 778 | |
|---|
| 757 | 779 | value = (arg->wet_ghost & 0x3f) << 8 | (arg->wet_clip & 0x7f); |
|---|
| 758 | | - isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_IIR_1); |
|---|
| 780 | + isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_IIR_1, id); |
|---|
| 759 | 781 | |
|---|
| 760 | 782 | value = (arg->bf_curwgt & 0x7f) << 24 | |
|---|
| 761 | 783 | (arg->bf_clip & 0x7f) << 16 | arg->bf_sgm; |
|---|
| 762 | | - isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_BF); |
|---|
| 784 | + isp3_param_write(params_vdev, value, ISP32_DEBAYER_C_FILTER_BF, id); |
|---|
| 763 | 785 | } |
|---|
| 764 | 786 | |
|---|
| 765 | 787 | static void |
|---|
| 766 | | -isp_debayer_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 788 | +isp_debayer_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 767 | 789 | { |
|---|
| 768 | 790 | if (en) |
|---|
| 769 | 791 | isp3_param_set_bits(params_vdev, |
|---|
| 770 | | - ISP3X_DEBAYER_CONTROL, ISP32_MODULE_EN); |
|---|
| 792 | + ISP3X_DEBAYER_CONTROL, ISP32_MODULE_EN, id); |
|---|
| 771 | 793 | else |
|---|
| 772 | 794 | isp3_param_clear_bits(params_vdev, |
|---|
| 773 | | - ISP3X_DEBAYER_CONTROL, ISP32_MODULE_EN); |
|---|
| 795 | + ISP3X_DEBAYER_CONTROL, ISP32_MODULE_EN, id); |
|---|
| 774 | 796 | } |
|---|
| 775 | 797 | |
|---|
| 776 | 798 | static void |
|---|
| 777 | 799 | isp_awbgain_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 778 | | - const struct isp32_awb_gain_cfg *arg) |
|---|
| 800 | + const struct isp32_awb_gain_cfg *arg, u32 id) |
|---|
| 779 | 801 | { |
|---|
| 780 | 802 | struct rkisp_device *dev = params_vdev->dev; |
|---|
| 781 | 803 | |
|---|
| .. | .. |
|---|
| 791 | 813 | |
|---|
| 792 | 814 | isp3_param_write(params_vdev, |
|---|
| 793 | 815 | ISP_PACK_2SHORT(arg->gain0_green_b, arg->gain0_green_r), |
|---|
| 794 | | - ISP3X_ISP_AWB_GAIN0_G); |
|---|
| 816 | + ISP3X_ISP_AWB_GAIN0_G, id); |
|---|
| 795 | 817 | isp3_param_write(params_vdev, |
|---|
| 796 | 818 | ISP_PACK_2SHORT(arg->gain0_blue, arg->gain0_red), |
|---|
| 797 | | - ISP3X_ISP_AWB_GAIN0_RB); |
|---|
| 819 | + ISP3X_ISP_AWB_GAIN0_RB, id); |
|---|
| 798 | 820 | |
|---|
| 799 | 821 | isp3_param_write(params_vdev, |
|---|
| 800 | 822 | ISP_PACK_2SHORT(arg->gain1_green_b, arg->gain1_green_r), |
|---|
| 801 | | - ISP3X_ISP_AWB_GAIN1_G); |
|---|
| 823 | + ISP3X_ISP_AWB_GAIN1_G, id); |
|---|
| 802 | 824 | isp3_param_write(params_vdev, |
|---|
| 803 | 825 | ISP_PACK_2SHORT(arg->gain1_blue, arg->gain1_red), |
|---|
| 804 | | - ISP3X_ISP_AWB_GAIN1_RB); |
|---|
| 826 | + ISP3X_ISP_AWB_GAIN1_RB, id); |
|---|
| 805 | 827 | |
|---|
| 806 | 828 | isp3_param_write(params_vdev, |
|---|
| 807 | 829 | ISP_PACK_2SHORT(arg->gain2_green_b, arg->gain2_green_r), |
|---|
| 808 | | - ISP3X_ISP_AWB_GAIN2_G); |
|---|
| 830 | + ISP3X_ISP_AWB_GAIN2_G, id); |
|---|
| 809 | 831 | isp3_param_write(params_vdev, |
|---|
| 810 | 832 | ISP_PACK_2SHORT(arg->gain2_blue, arg->gain2_red), |
|---|
| 811 | | - ISP3X_ISP_AWB_GAIN2_RB); |
|---|
| 833 | + ISP3X_ISP_AWB_GAIN2_RB, id); |
|---|
| 812 | 834 | |
|---|
| 813 | 835 | isp3_param_write(params_vdev, |
|---|
| 814 | 836 | ISP_PACK_2SHORT(arg->awb1_gain_gb, arg->awb1_gain_gr), |
|---|
| 815 | | - ISP32_ISP_AWB1_GAIN_G); |
|---|
| 837 | + ISP32_ISP_AWB1_GAIN_G, id); |
|---|
| 816 | 838 | isp3_param_write(params_vdev, |
|---|
| 817 | 839 | ISP_PACK_2SHORT(arg->awb1_gain_b, arg->awb1_gain_r), |
|---|
| 818 | | - ISP32_ISP_AWB1_GAIN_RB); |
|---|
| 840 | + ISP32_ISP_AWB1_GAIN_RB, id); |
|---|
| 819 | 841 | } |
|---|
| 820 | 842 | |
|---|
| 821 | 843 | static void |
|---|
| 822 | | -isp_awbgain_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 844 | +isp_awbgain_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 823 | 845 | { |
|---|
| 824 | 846 | u32 val; |
|---|
| 825 | 847 | |
|---|
| 826 | | - val = isp3_param_read_cache(params_vdev, ISP3X_ISP_CTRL0); |
|---|
| 848 | + val = isp3_param_read_cache(params_vdev, ISP3X_ISP_CTRL0, id); |
|---|
| 827 | 849 | if (en) |
|---|
| 828 | 850 | isp3_param_write(params_vdev, val | CIF_ISP_CTRL_ISP_AWB_ENA, |
|---|
| 829 | | - ISP3X_ISP_CTRL0); |
|---|
| 851 | + ISP3X_ISP_CTRL0, id); |
|---|
| 830 | 852 | else |
|---|
| 831 | 853 | isp3_param_write(params_vdev, val & ~CIF_ISP_CTRL_ISP_AWB_ENA, |
|---|
| 832 | | - ISP3X_ISP_CTRL0); |
|---|
| 854 | + ISP3X_ISP_CTRL0, id); |
|---|
| 833 | 855 | } |
|---|
| 834 | 856 | |
|---|
| 835 | 857 | static void |
|---|
| 836 | 858 | isp_ccm_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 837 | | - const struct isp32_ccm_cfg *arg) |
|---|
| 859 | + const struct isp32_ccm_cfg *arg, u32 id) |
|---|
| 838 | 860 | { |
|---|
| 839 | 861 | u32 value; |
|---|
| 840 | 862 | u32 i; |
|---|
| 841 | 863 | |
|---|
| 842 | | - value = isp3_param_read(params_vdev, ISP3X_CCM_CTRL); |
|---|
| 864 | + value = isp3_param_read(params_vdev, ISP3X_CCM_CTRL, id); |
|---|
| 843 | 865 | value &= ISP_CCM_EN; |
|---|
| 844 | 866 | |
|---|
| 845 | 867 | value |= !!arg->asym_adj_en << 3 | |
|---|
| 846 | 868 | !!arg->enh_adj_en << 2 | |
|---|
| 847 | 869 | !!arg->highy_adjust_dis << 1; |
|---|
| 848 | | - isp3_param_write(params_vdev, value, ISP3X_CCM_CTRL); |
|---|
| 870 | + isp3_param_write(params_vdev, value, ISP3X_CCM_CTRL, id); |
|---|
| 849 | 871 | |
|---|
| 850 | 872 | value = ISP_PACK_2SHORT(arg->coeff0_r, arg->coeff1_r); |
|---|
| 851 | | - isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF0_R); |
|---|
| 873 | + isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF0_R, id); |
|---|
| 852 | 874 | |
|---|
| 853 | 875 | value = ISP_PACK_2SHORT(arg->coeff2_r, arg->offset_r); |
|---|
| 854 | | - isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF1_R); |
|---|
| 876 | + isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF1_R, id); |
|---|
| 855 | 877 | |
|---|
| 856 | 878 | value = ISP_PACK_2SHORT(arg->coeff0_g, arg->coeff1_g); |
|---|
| 857 | | - isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF0_G); |
|---|
| 879 | + isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF0_G, id); |
|---|
| 858 | 880 | |
|---|
| 859 | 881 | value = ISP_PACK_2SHORT(arg->coeff2_g, arg->offset_g); |
|---|
| 860 | | - isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF1_G); |
|---|
| 882 | + isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF1_G, id); |
|---|
| 861 | 883 | |
|---|
| 862 | 884 | value = ISP_PACK_2SHORT(arg->coeff0_b, arg->coeff1_b); |
|---|
| 863 | | - isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF0_B); |
|---|
| 885 | + isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF0_B, id); |
|---|
| 864 | 886 | |
|---|
| 865 | 887 | value = ISP_PACK_2SHORT(arg->coeff2_b, arg->offset_b); |
|---|
| 866 | | - isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF1_B); |
|---|
| 888 | + isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF1_B, id); |
|---|
| 867 | 889 | |
|---|
| 868 | 890 | value = ISP_PACK_2SHORT(arg->coeff0_y, arg->coeff1_y); |
|---|
| 869 | | - isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF0_Y); |
|---|
| 891 | + isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF0_Y, id); |
|---|
| 870 | 892 | |
|---|
| 871 | 893 | value = ISP_PACK_2SHORT(arg->coeff2_y, 0); |
|---|
| 872 | | - isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF1_Y); |
|---|
| 894 | + isp3_param_write(params_vdev, value, ISP3X_CCM_COEFF1_Y, id); |
|---|
| 873 | 895 | |
|---|
| 874 | 896 | for (i = 0; i < ISP32_CCM_CURVE_NUM / 2; i++) { |
|---|
| 875 | 897 | value = ISP_PACK_2SHORT(arg->alp_y[2 * i], arg->alp_y[2 * i + 1]); |
|---|
| 876 | | - isp3_param_write(params_vdev, value, ISP3X_CCM_ALP_Y0 + 4 * i); |
|---|
| 898 | + isp3_param_write(params_vdev, value, ISP3X_CCM_ALP_Y0 + 4 * i, id); |
|---|
| 877 | 899 | } |
|---|
| 878 | 900 | |
|---|
| 879 | 901 | value = (arg->right_bit & 0xf) << 4 | (arg->bound_bit & 0xf); |
|---|
| 880 | | - isp3_param_write(params_vdev, value, ISP3X_CCM_BOUND_BIT); |
|---|
| 902 | + isp3_param_write(params_vdev, value, ISP3X_CCM_BOUND_BIT, id); |
|---|
| 881 | 903 | |
|---|
| 882 | 904 | value = (arg->color_coef1_g2y & 0x7ff) << 16 | |
|---|
| 883 | 905 | (arg->color_coef0_r2y & 0x7ff); |
|---|
| 884 | | - isp3_param_write(params_vdev, value, ISP32_CCM_ENHANCE0); |
|---|
| 906 | + isp3_param_write(params_vdev, value, ISP32_CCM_ENHANCE0, id); |
|---|
| 885 | 907 | |
|---|
| 886 | 908 | value = (arg->color_enh_rat_max & 0x3fff) << 16 | |
|---|
| 887 | 909 | (arg->color_coef2_b2y & 0x7ff); |
|---|
| 888 | | - isp3_param_write(params_vdev, value, ISP32_CCM_ENHANCE1); |
|---|
| 910 | + isp3_param_write(params_vdev, value, ISP32_CCM_ENHANCE1, id); |
|---|
| 889 | 911 | } |
|---|
| 890 | 912 | |
|---|
| 891 | 913 | static void |
|---|
| 892 | | -isp_ccm_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 914 | +isp_ccm_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 893 | 915 | { |
|---|
| 894 | 916 | if (en) |
|---|
| 895 | | - isp3_param_set_bits(params_vdev, ISP3X_CCM_CTRL, ISP_CCM_EN); |
|---|
| 917 | + isp3_param_set_bits(params_vdev, ISP3X_CCM_CTRL, ISP_CCM_EN, id); |
|---|
| 896 | 918 | else |
|---|
| 897 | | - isp3_param_clear_bits(params_vdev, ISP3X_CCM_CTRL, ISP_CCM_EN); |
|---|
| 919 | + isp3_param_clear_bits(params_vdev, ISP3X_CCM_CTRL, ISP_CCM_EN, id); |
|---|
| 898 | 920 | } |
|---|
| 899 | 921 | |
|---|
| 900 | 922 | static void |
|---|
| 901 | 923 | isp_goc_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 902 | | - const struct isp3x_gammaout_cfg *arg) |
|---|
| 924 | + const struct isp3x_gammaout_cfg *arg, u32 id) |
|---|
| 903 | 925 | { |
|---|
| 904 | 926 | int i; |
|---|
| 905 | 927 | u32 value; |
|---|
| 906 | 928 | |
|---|
| 907 | | - value = isp3_param_read(params_vdev, ISP3X_GAMMA_OUT_CTRL); |
|---|
| 929 | + value = isp3_param_read(params_vdev, ISP3X_GAMMA_OUT_CTRL, id); |
|---|
| 908 | 930 | value &= ISP3X_GAMMA_OUT_EN; |
|---|
| 909 | 931 | value |= !!arg->equ_segm << 1 | !!arg->finalx4_dense_en << 2; |
|---|
| 910 | | - isp3_param_write(params_vdev, value, ISP3X_GAMMA_OUT_CTRL); |
|---|
| 932 | + isp3_param_write(params_vdev, value, ISP3X_GAMMA_OUT_CTRL, id); |
|---|
| 911 | 933 | |
|---|
| 912 | | - isp3_param_write(params_vdev, arg->offset, ISP3X_GAMMA_OUT_OFFSET); |
|---|
| 934 | + isp3_param_write(params_vdev, arg->offset, ISP3X_GAMMA_OUT_OFFSET, id); |
|---|
| 913 | 935 | for (i = 0; i < ISP32_GAMMA_OUT_MAX_SAMPLES / 2; i++) { |
|---|
| 914 | 936 | value = ISP_PACK_2SHORT(arg->gamma_y[2 * i], |
|---|
| 915 | 937 | arg->gamma_y[2 * i + 1]); |
|---|
| 916 | | - isp3_param_write(params_vdev, value, ISP3X_GAMMA_OUT_Y0 + i * 4); |
|---|
| 938 | + isp3_param_write(params_vdev, value, ISP3X_GAMMA_OUT_Y0 + i * 4, id); |
|---|
| 917 | 939 | } |
|---|
| 918 | | - isp3_param_write(params_vdev, arg->gamma_y[2 * i], ISP3X_GAMMA_OUT_Y0 + i * 4); |
|---|
| 940 | + isp3_param_write(params_vdev, arg->gamma_y[2 * i], ISP3X_GAMMA_OUT_Y0 + i * 4, id); |
|---|
| 919 | 941 | } |
|---|
| 920 | 942 | |
|---|
| 921 | 943 | static void |
|---|
| 922 | | -isp_goc_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 944 | +isp_goc_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 923 | 945 | { |
|---|
| 924 | 946 | if (en) |
|---|
| 925 | | - isp3_param_set_bits(params_vdev, ISP3X_GAMMA_OUT_CTRL, ISP3X_GAMMA_OUT_EN); |
|---|
| 947 | + isp3_param_set_bits(params_vdev, ISP3X_GAMMA_OUT_CTRL, ISP3X_GAMMA_OUT_EN, id); |
|---|
| 926 | 948 | else |
|---|
| 927 | | - isp3_param_clear_bits(params_vdev, ISP3X_GAMMA_OUT_CTRL, ISP3X_GAMMA_OUT_EN); |
|---|
| 949 | + isp3_param_clear_bits(params_vdev, ISP3X_GAMMA_OUT_CTRL, ISP3X_GAMMA_OUT_EN, id); |
|---|
| 928 | 950 | } |
|---|
| 929 | 951 | |
|---|
| 930 | 952 | static void |
|---|
| 931 | 953 | isp_cproc_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 932 | | - const struct isp2x_cproc_cfg *arg) |
|---|
| 954 | + const struct isp2x_cproc_cfg *arg, u32 id) |
|---|
| 933 | 955 | { |
|---|
| 934 | 956 | u32 quantization = params_vdev->quantization; |
|---|
| 935 | 957 | |
|---|
| 936 | | - isp3_param_write(params_vdev, arg->contrast, ISP3X_CPROC_CONTRAST); |
|---|
| 937 | | - isp3_param_write(params_vdev, arg->hue, ISP3X_CPROC_HUE); |
|---|
| 938 | | - isp3_param_write(params_vdev, arg->sat, ISP3X_CPROC_SATURATION); |
|---|
| 939 | | - isp3_param_write(params_vdev, arg->brightness, ISP3X_CPROC_BRIGHTNESS); |
|---|
| 958 | + isp3_param_write(params_vdev, arg->contrast, ISP3X_CPROC_CONTRAST, id); |
|---|
| 959 | + isp3_param_write(params_vdev, arg->hue, ISP3X_CPROC_HUE, id); |
|---|
| 960 | + isp3_param_write(params_vdev, arg->sat, ISP3X_CPROC_SATURATION, id); |
|---|
| 961 | + isp3_param_write(params_vdev, arg->brightness, ISP3X_CPROC_BRIGHTNESS, id); |
|---|
| 940 | 962 | |
|---|
| 941 | 963 | if (quantization != V4L2_QUANTIZATION_FULL_RANGE) { |
|---|
| 942 | 964 | isp3_param_clear_bits(params_vdev, ISP3X_CPROC_CTRL, |
|---|
| 943 | 965 | CIF_C_PROC_YOUT_FULL | |
|---|
| 944 | 966 | CIF_C_PROC_YIN_FULL | |
|---|
| 945 | | - CIF_C_PROC_COUT_FULL); |
|---|
| 967 | + CIF_C_PROC_COUT_FULL, id); |
|---|
| 946 | 968 | } else { |
|---|
| 947 | 969 | isp3_param_set_bits(params_vdev, ISP3X_CPROC_CTRL, |
|---|
| 948 | 970 | CIF_C_PROC_YOUT_FULL | |
|---|
| 949 | 971 | CIF_C_PROC_YIN_FULL | |
|---|
| 950 | | - CIF_C_PROC_COUT_FULL); |
|---|
| 972 | + CIF_C_PROC_COUT_FULL, id); |
|---|
| 951 | 973 | } |
|---|
| 952 | 974 | } |
|---|
| 953 | 975 | |
|---|
| 954 | 976 | static void |
|---|
| 955 | | -isp_cproc_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 977 | +isp_cproc_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 956 | 978 | { |
|---|
| 957 | 979 | if (en) |
|---|
| 958 | 980 | isp3_param_set_bits(params_vdev, ISP3X_CPROC_CTRL, |
|---|
| 959 | | - CIF_C_PROC_CTR_ENABLE); |
|---|
| 981 | + CIF_C_PROC_CTR_ENABLE, id); |
|---|
| 960 | 982 | else |
|---|
| 961 | 983 | isp3_param_clear_bits(params_vdev, ISP3X_CPROC_CTRL, |
|---|
| 962 | | - CIF_C_PROC_CTR_ENABLE); |
|---|
| 984 | + CIF_C_PROC_CTR_ENABLE, id); |
|---|
| 963 | 985 | } |
|---|
| 964 | 986 | |
|---|
| 965 | 987 | static void |
|---|
| 966 | 988 | isp_ie_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 967 | | - const struct isp2x_ie_cfg *arg) |
|---|
| 989 | + const struct isp2x_ie_cfg *arg, u32 id) |
|---|
| 968 | 990 | { |
|---|
| 969 | 991 | u32 eff_ctrl; |
|---|
| 970 | 992 | |
|---|
| 971 | | - eff_ctrl = isp3_param_read(params_vdev, ISP3X_IMG_EFF_CTRL); |
|---|
| 993 | + eff_ctrl = isp3_param_read(params_vdev, ISP3X_IMG_EFF_CTRL, id); |
|---|
| 972 | 994 | eff_ctrl &= ~CIF_IMG_EFF_CTRL_MODE_MASK; |
|---|
| 973 | 995 | |
|---|
| 974 | 996 | if (params_vdev->quantization == V4L2_QUANTIZATION_FULL_RANGE) |
|---|
| .. | .. |
|---|
| 979 | 1001 | eff_ctrl |= CIF_IMG_EFF_CTRL_MODE_SEPIA; |
|---|
| 980 | 1002 | break; |
|---|
| 981 | 1003 | case V4L2_COLORFX_SET_CBCR: |
|---|
| 982 | | - isp3_param_write(params_vdev, arg->eff_tint, ISP3X_IMG_EFF_TINT); |
|---|
| 1004 | + isp3_param_write(params_vdev, arg->eff_tint, ISP3X_IMG_EFF_TINT, id); |
|---|
| 983 | 1005 | eff_ctrl |= CIF_IMG_EFF_CTRL_MODE_SEPIA; |
|---|
| 984 | 1006 | break; |
|---|
| 985 | 1007 | /* |
|---|
| .. | .. |
|---|
| 989 | 1011 | case V4L2_COLORFX_AQUA: |
|---|
| 990 | 1012 | eff_ctrl |= CIF_IMG_EFF_CTRL_MODE_COLOR_SEL; |
|---|
| 991 | 1013 | isp3_param_write(params_vdev, arg->color_sel, |
|---|
| 992 | | - ISP3X_IMG_EFF_COLOR_SEL); |
|---|
| 1014 | + ISP3X_IMG_EFF_COLOR_SEL, id); |
|---|
| 993 | 1015 | break; |
|---|
| 994 | 1016 | case V4L2_COLORFX_EMBOSS: |
|---|
| 995 | 1017 | eff_ctrl |= CIF_IMG_EFF_CTRL_MODE_EMBOSS; |
|---|
| 996 | 1018 | isp3_param_write(params_vdev, arg->eff_mat_1, |
|---|
| 997 | | - CIF_IMG_EFF_MAT_1); |
|---|
| 1019 | + CIF_IMG_EFF_MAT_1, id); |
|---|
| 998 | 1020 | isp3_param_write(params_vdev, arg->eff_mat_2, |
|---|
| 999 | | - CIF_IMG_EFF_MAT_2); |
|---|
| 1021 | + CIF_IMG_EFF_MAT_2, id); |
|---|
| 1000 | 1022 | isp3_param_write(params_vdev, arg->eff_mat_3, |
|---|
| 1001 | | - CIF_IMG_EFF_MAT_3); |
|---|
| 1023 | + CIF_IMG_EFF_MAT_3, id); |
|---|
| 1002 | 1024 | break; |
|---|
| 1003 | 1025 | case V4L2_COLORFX_SKETCH: |
|---|
| 1004 | 1026 | eff_ctrl |= CIF_IMG_EFF_CTRL_MODE_SKETCH; |
|---|
| 1005 | 1027 | isp3_param_write(params_vdev, arg->eff_mat_3, |
|---|
| 1006 | | - CIF_IMG_EFF_MAT_3); |
|---|
| 1028 | + CIF_IMG_EFF_MAT_3, id); |
|---|
| 1007 | 1029 | isp3_param_write(params_vdev, arg->eff_mat_4, |
|---|
| 1008 | | - CIF_IMG_EFF_MAT_4); |
|---|
| 1030 | + CIF_IMG_EFF_MAT_4, id); |
|---|
| 1009 | 1031 | isp3_param_write(params_vdev, arg->eff_mat_5, |
|---|
| 1010 | | - CIF_IMG_EFF_MAT_5); |
|---|
| 1032 | + CIF_IMG_EFF_MAT_5, id); |
|---|
| 1011 | 1033 | break; |
|---|
| 1012 | 1034 | case V4L2_COLORFX_BW: |
|---|
| 1013 | 1035 | eff_ctrl |= CIF_IMG_EFF_CTRL_MODE_BLACKWHITE; |
|---|
| .. | .. |
|---|
| 1019 | 1041 | break; |
|---|
| 1020 | 1042 | } |
|---|
| 1021 | 1043 | |
|---|
| 1022 | | - isp3_param_write(params_vdev, eff_ctrl, ISP3X_IMG_EFF_CTRL); |
|---|
| 1044 | + isp3_param_write(params_vdev, eff_ctrl, ISP3X_IMG_EFF_CTRL, id); |
|---|
| 1023 | 1045 | } |
|---|
| 1024 | 1046 | |
|---|
| 1025 | 1047 | static void |
|---|
| 1026 | | -isp_ie_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 1048 | +isp_ie_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 1027 | 1049 | { |
|---|
| 1028 | 1050 | if (en) { |
|---|
| 1029 | 1051 | isp3_param_set_bits(params_vdev, ISP3X_IMG_EFF_CTRL, |
|---|
| 1030 | 1052 | CIF_IMG_EFF_CTRL_CFG_UPD | |
|---|
| 1031 | | - CIF_IMG_EFF_CTRL_ENABLE); |
|---|
| 1053 | + CIF_IMG_EFF_CTRL_ENABLE, id); |
|---|
| 1032 | 1054 | } else { |
|---|
| 1033 | 1055 | isp3_param_clear_bits(params_vdev, ISP3X_IMG_EFF_CTRL, |
|---|
| 1034 | | - CIF_IMG_EFF_CTRL_ENABLE); |
|---|
| 1056 | + CIF_IMG_EFF_CTRL_ENABLE, id); |
|---|
| 1035 | 1057 | } |
|---|
| 1036 | 1058 | } |
|---|
| 1037 | 1059 | |
|---|
| 1038 | 1060 | static void |
|---|
| 1039 | 1061 | isp_rawae_config_foraf(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 1040 | | - const struct isp32_rawaf_meas_cfg *arg) |
|---|
| 1062 | + const struct isp32_rawaf_meas_cfg *arg, |
|---|
| 1063 | + struct isp2x_window *win, u32 id) |
|---|
| 1041 | 1064 | { |
|---|
| 1042 | 1065 | u32 block_hsize, block_vsize; |
|---|
| 1043 | 1066 | u32 addr, value; |
|---|
| .. | .. |
|---|
| 1052 | 1075 | } else { |
|---|
| 1053 | 1076 | addr = ISP3X_RAWAE_BIG1_BASE; |
|---|
| 1054 | 1077 | } |
|---|
| 1055 | | - value = isp3_param_read(params_vdev, addr + ISP3X_RAWAE_BIG_CTRL); |
|---|
| 1078 | + value = isp3_param_read(params_vdev, addr + ISP3X_RAWAE_BIG_CTRL, id); |
|---|
| 1056 | 1079 | value &= ISP3X_RAWAE_BIG_EN; |
|---|
| 1057 | 1080 | |
|---|
| 1058 | 1081 | value |= ISP3X_RAWAE_BIG_WND0_NUM(wnd_num_idx); |
|---|
| 1059 | | - isp3_param_write(params_vdev, value, addr + ISP3X_RAWAE_BIG_CTRL); |
|---|
| 1082 | + isp3_param_write(params_vdev, value, addr + ISP3X_RAWAE_BIG_CTRL, id); |
|---|
| 1060 | 1083 | |
|---|
| 1061 | 1084 | isp3_param_write(params_vdev, |
|---|
| 1062 | | - ISP_PACK_2SHORT(arg->win[0].h_offs, arg->win[0].v_offs), |
|---|
| 1063 | | - addr + ISP3X_RAWAE_BIG_OFFSET); |
|---|
| 1085 | + ISP_PACK_2SHORT(win->h_offs, win->v_offs), |
|---|
| 1086 | + addr + ISP3X_RAWAE_BIG_OFFSET, id); |
|---|
| 1064 | 1087 | |
|---|
| 1065 | | - block_hsize = arg->win[0].h_size / ae_wnd_num[wnd_num_idx]; |
|---|
| 1066 | | - block_vsize = arg->win[0].v_size / ae_wnd_num[wnd_num_idx]; |
|---|
| 1088 | + block_hsize = win->h_size / ae_wnd_num[wnd_num_idx]; |
|---|
| 1089 | + block_vsize = win->v_size / ae_wnd_num[wnd_num_idx]; |
|---|
| 1067 | 1090 | isp3_param_write(params_vdev, |
|---|
| 1068 | 1091 | ISP_PACK_2SHORT(block_hsize, block_vsize), |
|---|
| 1069 | | - addr + ISP3X_RAWAE_BIG_BLK_SIZE); |
|---|
| 1092 | + addr + ISP3X_RAWAE_BIG_BLK_SIZE, id); |
|---|
| 1070 | 1093 | } |
|---|
| 1071 | 1094 | |
|---|
| 1072 | 1095 | static void |
|---|
| 1073 | 1096 | isp_rawaf_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 1074 | | - const struct isp32_rawaf_meas_cfg *arg) |
|---|
| 1097 | + const struct isp32_rawaf_meas_cfg *arg, u32 id) |
|---|
| 1075 | 1098 | { |
|---|
| 1099 | + struct rkisp_device *dev = params_vdev->dev; |
|---|
| 1100 | + struct v4l2_rect *out_crop = &dev->isp_sdev.out_crop; |
|---|
| 1101 | + u32 width = out_crop->width, height = out_crop->height; |
|---|
| 1076 | 1102 | u32 i, var, ctrl; |
|---|
| 1077 | 1103 | u16 h_size, v_size; |
|---|
| 1078 | 1104 | u16 h_offs, v_offs; |
|---|
| 1079 | 1105 | u8 gaus_en, viir_en, v1_fir_sel; |
|---|
| 1080 | 1106 | size_t num_of_win = min_t(size_t, ARRAY_SIZE(arg->win), |
|---|
| 1081 | 1107 | arg->num_afm_win); |
|---|
| 1108 | + struct isp2x_window win_ae; |
|---|
| 1109 | + |
|---|
| 1110 | + if (dev->hw_dev->unite) |
|---|
| 1111 | + width = width / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL; |
|---|
| 1082 | 1112 | |
|---|
| 1083 | 1113 | for (i = 0; i < num_of_win; i++) { |
|---|
| 1084 | 1114 | h_size = arg->win[i].h_size; |
|---|
| .. | .. |
|---|
| 1086 | 1116 | h_offs = arg->win[i].h_offs < 2 ? 2 : arg->win[i].h_offs; |
|---|
| 1087 | 1117 | v_offs = arg->win[i].v_offs < 1 ? 1 : arg->win[i].v_offs; |
|---|
| 1088 | 1118 | |
|---|
| 1119 | + if (!v_size || v_size + v_offs - 2 > height) |
|---|
| 1120 | + v_size = height - v_offs - 2; |
|---|
| 1121 | + if (!h_size || h_size + h_offs - 2 > width) |
|---|
| 1122 | + h_size = width - h_offs - 2; |
|---|
| 1123 | + |
|---|
| 1089 | 1124 | if (i == 0) { |
|---|
| 1090 | 1125 | h_size = h_size / 15 * 15; |
|---|
| 1091 | 1126 | v_size = v_size / 15 * 15; |
|---|
| 1127 | + |
|---|
| 1128 | + win_ae.h_size = h_size; |
|---|
| 1129 | + win_ae.v_size = v_size; |
|---|
| 1130 | + win_ae.h_offs = h_offs; |
|---|
| 1131 | + win_ae.v_offs = v_offs; |
|---|
| 1092 | 1132 | } |
|---|
| 1093 | 1133 | |
|---|
| 1094 | 1134 | /* |
|---|
| .. | .. |
|---|
| 1097 | 1137 | */ |
|---|
| 1098 | 1138 | isp3_param_write(params_vdev, |
|---|
| 1099 | 1139 | ISP_PACK_2SHORT(v_offs, h_offs), |
|---|
| 1100 | | - ISP3X_RAWAF_OFFSET_WINA + i * 8); |
|---|
| 1140 | + ISP3X_RAWAF_OFFSET_WINA + i * 8, id); |
|---|
| 1101 | 1141 | |
|---|
| 1102 | 1142 | /* |
|---|
| 1103 | 1143 | * value must be smaller than [width of picture -2] |
|---|
| .. | .. |
|---|
| 1105 | 1145 | */ |
|---|
| 1106 | 1146 | isp3_param_write(params_vdev, |
|---|
| 1107 | 1147 | ISP_PACK_2SHORT(v_size, h_size), |
|---|
| 1108 | | - ISP3X_RAWAF_SIZE_WINA + i * 8); |
|---|
| 1148 | + ISP3X_RAWAF_SIZE_WINA + i * 8, id); |
|---|
| 1109 | 1149 | } |
|---|
| 1110 | 1150 | |
|---|
| 1111 | 1151 | var = 0; |
|---|
| .. | .. |
|---|
| 1114 | 1154 | var |= ISP3X_RAWAF_INTLINE0_EN << i; |
|---|
| 1115 | 1155 | var |= ISP3X_RAWAF_INELINE0(arg->line_num[i]) << 4 * i; |
|---|
| 1116 | 1156 | } |
|---|
| 1117 | | - isp3_param_write(params_vdev, var, ISP3X_RAWAF_INT_LINE); |
|---|
| 1157 | + isp3_param_write(params_vdev, var, ISP3X_RAWAF_INT_LINE, id); |
|---|
| 1118 | 1158 | |
|---|
| 1119 | 1159 | if (params_vdev->dev->isp_ver == ISP_V32_L) { |
|---|
| 1120 | 1160 | var = (arg->hldg_dilate_num & 0x7) << 16 | |
|---|
| 1121 | 1161 | !!arg->bls_en << 12 | (arg->bls_offset & 0x1FF); |
|---|
| 1122 | | - isp3_param_write(params_vdev, var, ISP32L_RAWAF_CTRL1); |
|---|
| 1162 | + isp3_param_write(params_vdev, var, ISP32L_RAWAF_CTRL1, id); |
|---|
| 1123 | 1163 | } |
|---|
| 1124 | 1164 | |
|---|
| 1125 | | - var = isp3_param_read(params_vdev, ISP3X_RAWAF_THRES); |
|---|
| 1165 | + var = isp3_param_read(params_vdev, ISP3X_RAWAF_THRES, id); |
|---|
| 1126 | 1166 | var &= ~0xFFFF; |
|---|
| 1127 | 1167 | var |= arg->afm_thres; |
|---|
| 1128 | | - isp3_param_write(params_vdev, var, ISP3X_RAWAF_THRES); |
|---|
| 1168 | + isp3_param_write(params_vdev, var, ISP3X_RAWAF_THRES, id); |
|---|
| 1129 | 1169 | |
|---|
| 1130 | 1170 | var = (arg->lum_var_shift[1] & 0x7) << 20 | (arg->lum_var_shift[0] & 0x7) << 16 | |
|---|
| 1131 | 1171 | (arg->afm_var_shift[1] & 0x7) << 4 | (arg->afm_var_shift[0] & 0x7); |
|---|
| 1132 | 1172 | if (params_vdev->dev->isp_ver == ISP_V32_L) |
|---|
| 1133 | 1173 | var |= (arg->tnrin_shift & 0xf) << 8; |
|---|
| 1134 | | - isp3_param_write(params_vdev, var, ISP3X_RAWAF_VAR_SHIFT); |
|---|
| 1174 | + isp3_param_write(params_vdev, var, ISP3X_RAWAF_VAR_SHIFT, id); |
|---|
| 1135 | 1175 | |
|---|
| 1136 | 1176 | for (i = 0; i < ISP32_RAWAF_GAMMA_NUM / 2; i++) { |
|---|
| 1137 | 1177 | var = ISP_PACK_2SHORT(arg->gamma_y[2 * i], arg->gamma_y[2 * i + 1]); |
|---|
| 1138 | | - isp3_param_write(params_vdev, var, ISP3X_RAWAF_GAMMA_Y0 + i * 4); |
|---|
| 1178 | + isp3_param_write(params_vdev, var, ISP3X_RAWAF_GAMMA_Y0 + i * 4, id); |
|---|
| 1139 | 1179 | } |
|---|
| 1140 | 1180 | var = ISP_PACK_2SHORT(arg->gamma_y[16], 0); |
|---|
| 1141 | | - isp3_param_write(params_vdev, var, ISP3X_RAWAF_GAMMA_Y8); |
|---|
| 1181 | + isp3_param_write(params_vdev, var, ISP3X_RAWAF_GAMMA_Y8, id); |
|---|
| 1142 | 1182 | |
|---|
| 1143 | 1183 | var = (arg->v1iir_var_shift & 0x7) << 8 | (arg->h1iir_var_shift & 0x7); |
|---|
| 1144 | 1184 | if (params_vdev->dev->isp_ver == ISP_V32) |
|---|
| 1145 | 1185 | var |= (arg->v2iir_var_shift & 0x7) << 12 | (arg->h2iir_var_shift & 0x7) << 4; |
|---|
| 1146 | | - isp3_param_write(params_vdev, var, ISP3X_RAWAF_HVIIR_VAR_SHIFT); |
|---|
| 1186 | + isp3_param_write(params_vdev, var, ISP3X_RAWAF_HVIIR_VAR_SHIFT, id); |
|---|
| 1147 | 1187 | |
|---|
| 1148 | 1188 | var = ISP_PACK_2SHORT(arg->h_fv_thresh, arg->v_fv_thresh); |
|---|
| 1149 | | - isp3_param_write(params_vdev, var, ISP3X_RAWAF_HIIR_THRESH); |
|---|
| 1189 | + isp3_param_write(params_vdev, var, ISP3X_RAWAF_HIIR_THRESH, id); |
|---|
| 1150 | 1190 | |
|---|
| 1151 | 1191 | for (i = 0; i < ISP32_RAWAF_VFIR_COE_NUM; i++) { |
|---|
| 1152 | 1192 | var = ISP_PACK_2SHORT(arg->v1fir_coe[i], arg->v2fir_coe[i]); |
|---|
| 1153 | | - isp3_param_write(params_vdev, var, ISP32_RAWAF_V_FIR_COE0 + i * 4); |
|---|
| 1193 | + isp3_param_write(params_vdev, var, ISP32_RAWAF_V_FIR_COE0 + i * 4, id); |
|---|
| 1154 | 1194 | } |
|---|
| 1155 | 1195 | |
|---|
| 1156 | 1196 | for (i = 0; i < ISP32_RAWAF_GAUS_COE_NUM / 4; i++) { |
|---|
| 1157 | 1197 | var = ISP_PACK_4BYTE(arg->gaus_coe[i * 4], arg->gaus_coe[i * 4 + 1], |
|---|
| 1158 | 1198 | arg->gaus_coe[i * 4 + 2], arg->gaus_coe[i * 4 + 3]); |
|---|
| 1159 | | - isp3_param_write(params_vdev, var, ISP32_RAWAF_GAUS_COE03 + i * 4); |
|---|
| 1199 | + isp3_param_write(params_vdev, var, ISP32_RAWAF_GAUS_COE03 + i * 4, id); |
|---|
| 1160 | 1200 | } |
|---|
| 1161 | 1201 | var = ISP_PACK_4BYTE(arg->gaus_coe[ISP32_RAWAF_GAUS_COE_NUM - 1], 0, 0, 0); |
|---|
| 1162 | | - isp3_param_write(params_vdev, var, ISP32_RAWAF_GAUS_COE8); |
|---|
| 1202 | + isp3_param_write(params_vdev, var, ISP32_RAWAF_GAUS_COE8, id); |
|---|
| 1163 | 1203 | |
|---|
| 1164 | | - isp3_param_write(params_vdev, arg->highlit_thresh, ISP3X_RAWAF_HIGHLIT_THRESH); |
|---|
| 1204 | + isp3_param_write(params_vdev, arg->highlit_thresh, ISP3X_RAWAF_HIGHLIT_THRESH, id); |
|---|
| 1165 | 1205 | |
|---|
| 1166 | 1206 | if (params_vdev->dev->isp_ver == ISP_V32_L) { |
|---|
| 1167 | 1207 | var = ISP_PACK_2SHORT(arg->h_fv_limit, arg->h_fv_slope); |
|---|
| 1168 | | - isp3_param_write(params_vdev, var, ISP32L_RAWAF_CORING_H); |
|---|
| 1208 | + isp3_param_write(params_vdev, var, ISP32L_RAWAF_CORING_H, id); |
|---|
| 1169 | 1209 | var = ISP_PACK_2SHORT(arg->v_fv_limit, arg->v_fv_slope); |
|---|
| 1170 | | - isp3_param_write(params_vdev, var, ISP32L_RAWAF_CORING_V); |
|---|
| 1210 | + isp3_param_write(params_vdev, var, ISP32L_RAWAF_CORING_V, id); |
|---|
| 1171 | 1211 | } |
|---|
| 1172 | 1212 | |
|---|
| 1173 | 1213 | viir_en = arg->viir_en; |
|---|
| .. | .. |
|---|
| 1176 | 1216 | if (viir_en == 0) |
|---|
| 1177 | 1217 | v1_fir_sel = 0; |
|---|
| 1178 | 1218 | |
|---|
| 1179 | | - ctrl = isp3_param_read(params_vdev, ISP3X_RAWAF_CTRL); |
|---|
| 1219 | + ctrl = isp3_param_read(params_vdev, ISP3X_RAWAF_CTRL, id); |
|---|
| 1180 | 1220 | ctrl &= ISP3X_RAWAF_EN; |
|---|
| 1181 | 1221 | if (arg->hiir_en) { |
|---|
| 1182 | 1222 | ctrl |= ISP3X_RAWAF_HIIR_EN; |
|---|
| 1183 | 1223 | for (i = 0; i < ISP32_RAWAF_HIIR_COE_NUM / 2; i++) { |
|---|
| 1184 | 1224 | var = ISP_PACK_2SHORT(arg->h1iir1_coe[i * 2], arg->h1iir1_coe[i * 2 + 1]); |
|---|
| 1185 | | - isp3_param_write(params_vdev, var, ISP3X_RAWAF_H1_IIR1_COE01 + i * 4); |
|---|
| 1225 | + isp3_param_write(params_vdev, var, ISP3X_RAWAF_H1_IIR1_COE01 + i * 4, id); |
|---|
| 1186 | 1226 | var = ISP_PACK_2SHORT(arg->h1iir2_coe[i * 2], arg->h1iir2_coe[i * 2 + 1]); |
|---|
| 1187 | | - isp3_param_write(params_vdev, var, ISP3X_RAWAF_H1_IIR2_COE01 + i * 4); |
|---|
| 1227 | + isp3_param_write(params_vdev, var, ISP3X_RAWAF_H1_IIR2_COE01 + i * 4, id); |
|---|
| 1188 | 1228 | |
|---|
| 1189 | 1229 | if (params_vdev->dev->isp_ver == ISP_V32_L) |
|---|
| 1190 | 1230 | continue; |
|---|
| 1191 | 1231 | |
|---|
| 1192 | 1232 | var = ISP_PACK_2SHORT(arg->h2iir1_coe[i * 2], arg->h2iir1_coe[i * 2 + 1]); |
|---|
| 1193 | | - isp3_param_write(params_vdev, var, ISP3X_RAWAF_H2_IIR1_COE01 + i * 4); |
|---|
| 1233 | + isp3_param_write(params_vdev, var, ISP3X_RAWAF_H2_IIR1_COE01 + i * 4, id); |
|---|
| 1194 | 1234 | var = ISP_PACK_2SHORT(arg->h2iir2_coe[i * 2], arg->h2iir2_coe[i * 2 + 1]); |
|---|
| 1195 | | - isp3_param_write(params_vdev, var, ISP3X_RAWAF_H2_IIR2_COE01 + i * 4); |
|---|
| 1235 | + isp3_param_write(params_vdev, var, ISP3X_RAWAF_H2_IIR2_COE01 + i * 4, id); |
|---|
| 1196 | 1236 | } |
|---|
| 1197 | 1237 | } |
|---|
| 1198 | 1238 | if (viir_en) { |
|---|
| .. | .. |
|---|
| 1202 | 1242 | var = ISP_PACK_2SHORT(arg->v1iir_coe[i], arg->v2iir_coe[i]); |
|---|
| 1203 | 1243 | else |
|---|
| 1204 | 1244 | var = ISP_PACK_2SHORT(arg->v1iir_coe[i], 0); |
|---|
| 1205 | | - isp3_param_write(params_vdev, var, ISP3X_RAWAF_V_IIR_COE0 + i * 4); |
|---|
| 1245 | + isp3_param_write(params_vdev, var, ISP3X_RAWAF_V_IIR_COE0 + i * 4, id); |
|---|
| 1206 | 1246 | } |
|---|
| 1207 | 1247 | } |
|---|
| 1208 | 1248 | if (arg->ldg_en) { |
|---|
| .. | .. |
|---|
| 1212 | 1252 | arg->curve_h[i].ldg_lumth | |
|---|
| 1213 | 1253 | arg->curve_h[i].ldg_gain << 8 | |
|---|
| 1214 | 1254 | arg->curve_h[i].ldg_gslp << 16, |
|---|
| 1215 | | - ISP3X_RAWAF_H_CURVEL + i * 16); |
|---|
| 1255 | + ISP3X_RAWAF_H_CURVEL + i * 16, id); |
|---|
| 1216 | 1256 | isp3_param_write(params_vdev, |
|---|
| 1217 | 1257 | arg->curve_v[i].ldg_lumth | |
|---|
| 1218 | 1258 | arg->curve_v[i].ldg_gain << 8 | |
|---|
| 1219 | 1259 | arg->curve_v[i].ldg_gslp << 16, |
|---|
| 1220 | | - ISP3X_RAWAF_V_CURVEL + i * 16); |
|---|
| 1260 | + ISP3X_RAWAF_V_CURVEL + i * 16, id); |
|---|
| 1221 | 1261 | } |
|---|
| 1222 | 1262 | } |
|---|
| 1223 | 1263 | |
|---|
| .. | .. |
|---|
| 1239 | 1279 | !!arg->v1_acc_mode << 26 | |
|---|
| 1240 | 1280 | !!arg->v2_acc_mode << 27 | |
|---|
| 1241 | 1281 | !!arg->ae_sel << 29; |
|---|
| 1242 | | - isp3_param_write(params_vdev, ctrl, ISP3X_RAWAF_CTRL); |
|---|
| 1282 | + isp3_param_write(params_vdev, ctrl, ISP3X_RAWAF_CTRL, id); |
|---|
| 1243 | 1283 | |
|---|
| 1244 | | - ctrl = isp3_param_read(params_vdev, ISP3X_VI_ISP_PATH); |
|---|
| 1284 | + ctrl = isp3_param_read(params_vdev, ISP3X_VI_ISP_PATH, id); |
|---|
| 1245 | 1285 | if (((ctrl & ISP3X_RAWAF_SEL(3)) != ISP3X_RAWAF_SEL(arg->rawaf_sel)) || |
|---|
| 1246 | 1286 | (((!!(ctrl & ISP32L_BNR2AF_SEL)) != arg->bnr2af_sel) && |
|---|
| 1247 | 1287 | (params_vdev->dev->isp_ver == ISP_V32_L))) { |
|---|
| .. | .. |
|---|
| 1254 | 1294 | else |
|---|
| 1255 | 1295 | ctrl &= ~ISP32L_BNR2AF_SEL; |
|---|
| 1256 | 1296 | } |
|---|
| 1257 | | - isp3_param_write(params_vdev, ctrl, ISP3X_VI_ISP_PATH); |
|---|
| 1297 | + isp3_param_write(params_vdev, ctrl, ISP3X_VI_ISP_PATH, id); |
|---|
| 1258 | 1298 | } |
|---|
| 1259 | 1299 | |
|---|
| 1260 | 1300 | params_vdev->afaemode_en = arg->ae_mode; |
|---|
| 1261 | 1301 | if (params_vdev->afaemode_en) |
|---|
| 1262 | | - isp_rawae_config_foraf(params_vdev, arg); |
|---|
| 1302 | + isp_rawae_config_foraf(params_vdev, arg, &win_ae, id); |
|---|
| 1263 | 1303 | } |
|---|
| 1264 | 1304 | |
|---|
| 1265 | 1305 | static void |
|---|
| 1266 | | -isp_rawae_enable_foraf(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 1306 | +isp_rawae_enable_foraf(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 1267 | 1307 | { |
|---|
| 1268 | 1308 | u32 exp_ctrl; |
|---|
| 1269 | 1309 | u32 addr = ISP3X_RAWAE_BIG1_BASE; |
|---|
| .. | .. |
|---|
| 1271 | 1311 | if (params_vdev->dev->isp_ver == ISP_V32_L) |
|---|
| 1272 | 1312 | addr = ISP3X_RAWAE_LITE_BASE; |
|---|
| 1273 | 1313 | |
|---|
| 1274 | | - exp_ctrl = isp3_param_read(params_vdev, addr + ISP3X_RAWAE_BIG_CTRL); |
|---|
| 1314 | + exp_ctrl = isp3_param_read(params_vdev, addr + ISP3X_RAWAE_BIG_CTRL, id); |
|---|
| 1275 | 1315 | exp_ctrl &= ~ISP32_REG_WR_MASK; |
|---|
| 1276 | 1316 | if (en) |
|---|
| 1277 | 1317 | exp_ctrl |= ISP32_MODULE_EN; |
|---|
| 1278 | 1318 | else |
|---|
| 1279 | 1319 | exp_ctrl &= ~ISP32_MODULE_EN; |
|---|
| 1280 | 1320 | |
|---|
| 1281 | | - isp3_param_write(params_vdev, exp_ctrl, addr + ISP3X_RAWAE_BIG_CTRL); |
|---|
| 1321 | + isp3_param_write(params_vdev, exp_ctrl, addr + ISP3X_RAWAE_BIG_CTRL, id); |
|---|
| 1282 | 1322 | } |
|---|
| 1283 | 1323 | |
|---|
| 1284 | 1324 | static void |
|---|
| 1285 | | -isp_rawaf_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 1325 | +isp_rawaf_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 1286 | 1326 | { |
|---|
| 1287 | | - u32 afm_ctrl = isp3_param_read(params_vdev, ISP3X_RAWAF_CTRL); |
|---|
| 1327 | + u32 afm_ctrl = isp3_param_read(params_vdev, ISP3X_RAWAF_CTRL, id); |
|---|
| 1288 | 1328 | |
|---|
| 1289 | 1329 | afm_ctrl &= ~ISP32_REG_WR_MASK; |
|---|
| 1290 | 1330 | if (en) |
|---|
| .. | .. |
|---|
| 1292 | 1332 | else |
|---|
| 1293 | 1333 | afm_ctrl &= ~ISP3X_RAWAF_EN; |
|---|
| 1294 | 1334 | |
|---|
| 1295 | | - isp3_param_write(params_vdev, afm_ctrl, ISP3X_RAWAF_CTRL); |
|---|
| 1335 | + isp3_param_write(params_vdev, afm_ctrl, ISP3X_RAWAF_CTRL, id); |
|---|
| 1296 | 1336 | if (params_vdev->afaemode_en) { |
|---|
| 1297 | | - isp_rawae_enable_foraf(params_vdev, en); |
|---|
| 1337 | + isp_rawae_enable_foraf(params_vdev, en, id); |
|---|
| 1298 | 1338 | if (!en) |
|---|
| 1299 | 1339 | params_vdev->afaemode_en = false; |
|---|
| 1300 | 1340 | } |
|---|
| .. | .. |
|---|
| 1302 | 1342 | |
|---|
| 1303 | 1343 | static void |
|---|
| 1304 | 1344 | isp_rawaelite_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 1305 | | - const struct isp2x_rawaelite_meas_cfg *arg) |
|---|
| 1345 | + const struct isp2x_rawaelite_meas_cfg *arg, u32 id) |
|---|
| 1306 | 1346 | { |
|---|
| 1307 | 1347 | struct rkisp_device *ispdev = params_vdev->dev; |
|---|
| 1308 | 1348 | struct v4l2_rect *out_crop = &ispdev->isp_sdev.out_crop; |
|---|
| 1309 | | - u32 width = out_crop->width; |
|---|
| 1349 | + u32 width = out_crop->width, height = out_crop->height; |
|---|
| 1350 | + u32 h_size, v_size, h_offs, v_offs; |
|---|
| 1310 | 1351 | u32 block_hsize, block_vsize, value; |
|---|
| 1311 | 1352 | u32 wnd_num_idx = 0; |
|---|
| 1312 | 1353 | const u32 ae_wnd_num[] = {1, 5}; |
|---|
| 1313 | 1354 | |
|---|
| 1314 | | - value = isp3_param_read(params_vdev, ISP3X_RAWAE_LITE_CTRL); |
|---|
| 1355 | + value = isp3_param_read(params_vdev, ISP3X_RAWAE_LITE_CTRL, id); |
|---|
| 1315 | 1356 | value &= ~(ISP3X_RAWAE_LITE_WNDNUM); |
|---|
| 1316 | 1357 | if (arg->wnd_num) { |
|---|
| 1317 | 1358 | value |= ISP3X_RAWAE_LITE_WNDNUM; |
|---|
| 1318 | 1359 | wnd_num_idx = 1; |
|---|
| 1319 | 1360 | } |
|---|
| 1320 | 1361 | value &= ~ISP32_REG_WR_MASK; |
|---|
| 1321 | | - isp3_param_write(params_vdev, value, ISP3X_RAWAE_LITE_CTRL); |
|---|
| 1362 | + isp3_param_write(params_vdev, value, ISP3X_RAWAE_LITE_CTRL, id); |
|---|
| 1322 | 1363 | |
|---|
| 1364 | + h_offs = arg->win.h_offs & ~0x1; |
|---|
| 1365 | + v_offs = arg->win.v_offs & ~0x1; |
|---|
| 1323 | 1366 | isp3_param_write(params_vdev, |
|---|
| 1324 | | - ISP_PACK_2SHORT(arg->win.h_offs, arg->win.v_offs), |
|---|
| 1325 | | - ISP3X_RAWAE_LITE_OFFSET); |
|---|
| 1367 | + ISP_PACK_2SHORT(h_offs, v_offs), |
|---|
| 1368 | + ISP3X_RAWAE_LITE_OFFSET, id); |
|---|
| 1326 | 1369 | |
|---|
| 1327 | | - block_hsize = arg->win.h_size / ae_wnd_num[wnd_num_idx]; |
|---|
| 1328 | | - value = block_hsize * ae_wnd_num[wnd_num_idx] + arg->win.h_offs; |
|---|
| 1329 | | - if (ispdev->hw_dev->is_unite) |
|---|
| 1370 | + if (ispdev->hw_dev->unite) |
|---|
| 1330 | 1371 | width = width / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL; |
|---|
| 1331 | | - if (value + 1 > width) |
|---|
| 1332 | | - block_hsize -= 1; |
|---|
| 1333 | | - block_vsize = arg->win.v_size / ae_wnd_num[wnd_num_idx]; |
|---|
| 1334 | | - value = block_vsize * ae_wnd_num[wnd_num_idx] + arg->win.v_offs; |
|---|
| 1335 | | - if (value + 2 > out_crop->height) |
|---|
| 1336 | | - block_vsize -= 1; |
|---|
| 1337 | | - if (block_vsize % 2) |
|---|
| 1338 | | - block_vsize -= 1; |
|---|
| 1372 | + h_size = arg->win.h_size; |
|---|
| 1373 | + v_size = arg->win.v_size; |
|---|
| 1374 | + if (!h_size || h_size + h_offs + 1 > width) |
|---|
| 1375 | + h_size = width - h_offs - 1; |
|---|
| 1376 | + if (!v_size || v_size + v_offs + 2 > height) |
|---|
| 1377 | + v_size = height - v_offs - 2; |
|---|
| 1378 | + block_hsize = (h_size / ae_wnd_num[wnd_num_idx]) & ~0x1; |
|---|
| 1379 | + block_vsize = (v_size / ae_wnd_num[wnd_num_idx]) & ~0x1; |
|---|
| 1339 | 1380 | isp3_param_write(params_vdev, |
|---|
| 1340 | 1381 | ISP_PACK_2SHORT(block_hsize, block_vsize), |
|---|
| 1341 | | - ISP3X_RAWAE_LITE_BLK_SIZ); |
|---|
| 1382 | + ISP3X_RAWAE_LITE_BLK_SIZ, id); |
|---|
| 1342 | 1383 | |
|---|
| 1343 | | - value = isp3_param_read(params_vdev, ISP3X_VI_ISP_PATH); |
|---|
| 1384 | + value = isp3_param_read(params_vdev, ISP3X_VI_ISP_PATH, id); |
|---|
| 1344 | 1385 | if ((value & ISP3X_RAWAE012_SEL(3)) != ISP3X_RAWAE012_SEL(arg->rawae_sel)) { |
|---|
| 1345 | 1386 | value &= ~(ISP3X_RAWAE012_SEL(3)); |
|---|
| 1346 | 1387 | value |= ISP3X_RAWAE012_SEL(arg->rawae_sel); |
|---|
| 1347 | | - isp3_param_write(params_vdev, value, ISP3X_VI_ISP_PATH); |
|---|
| 1388 | + isp3_param_write(params_vdev, value, ISP3X_VI_ISP_PATH, id); |
|---|
| 1348 | 1389 | } |
|---|
| 1349 | 1390 | } |
|---|
| 1350 | 1391 | |
|---|
| 1351 | 1392 | static void |
|---|
| 1352 | | -isp_rawaelite_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 1393 | +isp_rawaelite_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 1353 | 1394 | { |
|---|
| 1354 | 1395 | u32 exp_ctrl; |
|---|
| 1355 | 1396 | |
|---|
| 1356 | | - exp_ctrl = isp3_param_read(params_vdev, ISP3X_RAWAE_LITE_CTRL); |
|---|
| 1397 | + exp_ctrl = isp3_param_read(params_vdev, ISP3X_RAWAE_LITE_CTRL, id); |
|---|
| 1357 | 1398 | exp_ctrl &= ~ISP32_REG_WR_MASK; |
|---|
| 1358 | 1399 | if (en) |
|---|
| 1359 | 1400 | exp_ctrl |= ISP3X_RAWAE_LITE_EN; |
|---|
| 1360 | 1401 | else |
|---|
| 1361 | 1402 | exp_ctrl &= ~ISP3X_RAWAE_LITE_EN; |
|---|
| 1362 | 1403 | |
|---|
| 1363 | | - isp3_param_write(params_vdev, exp_ctrl, ISP3X_RAWAE_LITE_CTRL); |
|---|
| 1404 | + isp3_param_write(params_vdev, exp_ctrl, ISP3X_RAWAE_LITE_CTRL, id); |
|---|
| 1364 | 1405 | } |
|---|
| 1365 | 1406 | |
|---|
| 1366 | 1407 | static void |
|---|
| 1367 | 1408 | isp_rawaebig_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 1368 | 1409 | const struct isp2x_rawaebig_meas_cfg *arg, |
|---|
| 1369 | | - u32 blk_no) |
|---|
| 1410 | + u32 blk_no, u32 id) |
|---|
| 1370 | 1411 | { |
|---|
| 1371 | 1412 | struct rkisp_device *ispdev = params_vdev->dev; |
|---|
| 1372 | 1413 | struct v4l2_rect *out_crop = &ispdev->isp_sdev.out_crop; |
|---|
| 1373 | | - u32 width = out_crop->width; |
|---|
| 1374 | | - u32 block_hsize, block_vsize; |
|---|
| 1375 | | - u32 addr, i, value, h_size, v_size; |
|---|
| 1376 | | - u32 wnd_num_idx = 0; |
|---|
| 1414 | + u32 width = out_crop->width, height = out_crop->height; |
|---|
| 1415 | + u32 addr, i, value, h_size, v_size, h_offs, v_offs; |
|---|
| 1416 | + u32 block_hsize, block_vsize, wnd_num_idx = 0; |
|---|
| 1377 | 1417 | const u32 ae_wnd_num[] = { |
|---|
| 1378 | 1418 | 1, 5, 15, 15 |
|---|
| 1379 | 1419 | }; |
|---|
| .. | .. |
|---|
| 1392 | 1432 | } |
|---|
| 1393 | 1433 | |
|---|
| 1394 | 1434 | /* avoid to override the old enable value */ |
|---|
| 1395 | | - value = isp3_param_read(params_vdev, addr + ISP3X_RAWAE_BIG_CTRL); |
|---|
| 1435 | + value = isp3_param_read(params_vdev, addr + ISP3X_RAWAE_BIG_CTRL, id); |
|---|
| 1396 | 1436 | value &= ISP3X_RAWAE_BIG_EN; |
|---|
| 1397 | 1437 | |
|---|
| 1398 | 1438 | wnd_num_idx = arg->wnd_num; |
|---|
| 1439 | + if (wnd_num_idx >= ARRAY_SIZE(ae_wnd_num)) { |
|---|
| 1440 | + wnd_num_idx = ARRAY_SIZE(ae_wnd_num) - 1; |
|---|
| 1441 | + dev_err(params_vdev->dev->dev, |
|---|
| 1442 | + "%s invalid wnd_num:%d, set to %d\n", |
|---|
| 1443 | + __func__, arg->wnd_num, wnd_num_idx); |
|---|
| 1444 | + } |
|---|
| 1399 | 1445 | value |= ISP3X_RAWAE_BIG_WND0_NUM(wnd_num_idx); |
|---|
| 1400 | 1446 | |
|---|
| 1401 | 1447 | if (arg->subwin_en[0]) |
|---|
| .. | .. |
|---|
| 1408 | 1454 | if (arg->subwin_en[3]) |
|---|
| 1409 | 1455 | value |= ISP3X_RAWAE_BIG_WND4_EN; |
|---|
| 1410 | 1456 | } |
|---|
| 1411 | | - isp3_param_write(params_vdev, value, addr + ISP3X_RAWAE_BIG_CTRL); |
|---|
| 1457 | + isp3_param_write(params_vdev, value, addr + ISP3X_RAWAE_BIG_CTRL, id); |
|---|
| 1412 | 1458 | |
|---|
| 1459 | + h_offs = arg->win.h_offs & ~0x1; |
|---|
| 1460 | + v_offs = arg->win.v_offs & ~0x1; |
|---|
| 1413 | 1461 | isp3_param_write(params_vdev, |
|---|
| 1414 | | - ISP_PACK_2SHORT(arg->win.h_offs, arg->win.v_offs), |
|---|
| 1415 | | - addr + ISP3X_RAWAE_BIG_OFFSET); |
|---|
| 1462 | + ISP_PACK_2SHORT(h_offs, v_offs), |
|---|
| 1463 | + addr + ISP3X_RAWAE_BIG_OFFSET, id); |
|---|
| 1416 | 1464 | |
|---|
| 1417 | | - block_hsize = arg->win.h_size / ae_wnd_num[wnd_num_idx]; |
|---|
| 1418 | | - value = block_hsize * ae_wnd_num[wnd_num_idx] + arg->win.h_offs; |
|---|
| 1419 | | - if (ispdev->hw_dev->is_unite) |
|---|
| 1465 | + if (ispdev->hw_dev->unite) |
|---|
| 1420 | 1466 | width = width / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL; |
|---|
| 1421 | | - if (value + 1 > width) |
|---|
| 1422 | | - block_hsize -= 1; |
|---|
| 1423 | | - block_vsize = arg->win.v_size / ae_wnd_num[wnd_num_idx]; |
|---|
| 1424 | | - value = block_vsize * ae_wnd_num[wnd_num_idx] + arg->win.v_offs; |
|---|
| 1425 | | - if (value + 2 > out_crop->height) |
|---|
| 1426 | | - block_vsize -= 1; |
|---|
| 1427 | | - if (block_vsize % 2) |
|---|
| 1428 | | - block_vsize -= 1; |
|---|
| 1467 | + h_size = arg->win.h_size; |
|---|
| 1468 | + v_size = arg->win.v_size; |
|---|
| 1469 | + if (!h_size || h_size + h_offs + 1 > width) |
|---|
| 1470 | + h_size = width - h_offs - 1; |
|---|
| 1471 | + if (!v_size || v_size + v_offs + 2 > height) |
|---|
| 1472 | + v_size = height - v_offs - 2; |
|---|
| 1473 | + block_hsize = (h_size / ae_wnd_num[wnd_num_idx]) & ~0x1; |
|---|
| 1474 | + block_vsize = (v_size / ae_wnd_num[wnd_num_idx]) & ~0x1; |
|---|
| 1429 | 1475 | isp3_param_write(params_vdev, |
|---|
| 1430 | 1476 | ISP_PACK_2SHORT(block_hsize, block_vsize), |
|---|
| 1431 | | - addr + ISP3X_RAWAE_BIG_BLK_SIZE); |
|---|
| 1477 | + addr + ISP3X_RAWAE_BIG_BLK_SIZE, id); |
|---|
| 1432 | 1478 | |
|---|
| 1433 | 1479 | for (i = 0; i < ISP32_RAWAEBIG_SUBWIN_NUM; i++) { |
|---|
| 1434 | | - isp3_param_write(params_vdev, |
|---|
| 1435 | | - ISP_PACK_2SHORT(arg->subwin[i].h_offs, arg->subwin[i].v_offs), |
|---|
| 1436 | | - addr + ISP3X_RAWAE_BIG_WND1_OFFSET + 8 * i); |
|---|
| 1480 | + h_offs = arg->subwin[i].h_offs & ~0x1; |
|---|
| 1481 | + v_offs = arg->subwin[i].v_offs & ~0x1; |
|---|
| 1482 | + isp3_param_write(params_vdev, ISP_PACK_2SHORT(h_offs, v_offs), |
|---|
| 1483 | + addr + ISP3X_RAWAE_BIG_WND1_OFFSET + 8 * i, id); |
|---|
| 1437 | 1484 | |
|---|
| 1438 | | - v_size = arg->subwin[i].v_size + arg->subwin[i].v_offs; |
|---|
| 1439 | | - h_size = arg->subwin[i].h_size + arg->subwin[i].h_offs; |
|---|
| 1440 | | - isp3_param_write(params_vdev, |
|---|
| 1441 | | - ISP_PACK_2SHORT(h_size, v_size), |
|---|
| 1442 | | - addr + ISP3X_RAWAE_BIG_WND1_SIZE + 8 * i); |
|---|
| 1485 | + v_size = arg->subwin[i].v_size; |
|---|
| 1486 | + h_size = arg->subwin[i].h_size; |
|---|
| 1487 | + if (!h_size || h_size + h_offs > width) |
|---|
| 1488 | + h_size = width - h_offs; |
|---|
| 1489 | + if (!v_size || v_size + v_offs > height) |
|---|
| 1490 | + v_size = height - v_offs; |
|---|
| 1491 | + h_size = (h_size + h_offs) & ~0x1; |
|---|
| 1492 | + v_size = (v_size + v_offs) & ~0x1; |
|---|
| 1493 | + isp3_param_write(params_vdev, ISP_PACK_2SHORT(h_size, v_size), |
|---|
| 1494 | + addr + ISP3X_RAWAE_BIG_WND1_SIZE + 8 * i, id); |
|---|
| 1443 | 1495 | } |
|---|
| 1444 | 1496 | |
|---|
| 1445 | | - value = isp3_param_read(params_vdev, ISP3X_VI_ISP_PATH); |
|---|
| 1497 | + value = isp3_param_read(params_vdev, ISP3X_VI_ISP_PATH, id); |
|---|
| 1446 | 1498 | if (blk_no == 0) { |
|---|
| 1447 | 1499 | if ((value & ISP3X_RAWAE3_SEL(3)) != ISP3X_RAWAE3_SEL(arg->rawae_sel)) { |
|---|
| 1448 | 1500 | value &= ~(ISP3X_RAWAE3_SEL(3)); |
|---|
| 1449 | 1501 | value |= ISP3X_RAWAE3_SEL(arg->rawae_sel); |
|---|
| 1450 | | - isp3_param_write(params_vdev, value, ISP3X_VI_ISP_PATH); |
|---|
| 1502 | + isp3_param_write(params_vdev, value, ISP3X_VI_ISP_PATH, id); |
|---|
| 1451 | 1503 | } |
|---|
| 1452 | 1504 | } else { |
|---|
| 1453 | 1505 | if ((value & ISP3X_RAWAE012_SEL(3)) != ISP3X_RAWAE012_SEL(arg->rawae_sel)) { |
|---|
| 1454 | 1506 | value &= ~(ISP3X_RAWAE012_SEL(3)); |
|---|
| 1455 | 1507 | value |= ISP3X_RAWAE012_SEL(arg->rawae_sel); |
|---|
| 1456 | | - isp3_param_write(params_vdev, value, ISP3X_VI_ISP_PATH); |
|---|
| 1508 | + isp3_param_write(params_vdev, value, ISP3X_VI_ISP_PATH, id); |
|---|
| 1457 | 1509 | } |
|---|
| 1458 | 1510 | } |
|---|
| 1459 | 1511 | } |
|---|
| 1460 | 1512 | |
|---|
| 1461 | 1513 | static void |
|---|
| 1462 | 1514 | isp_rawaebig_enable(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 1463 | | - bool en, u32 blk_no) |
|---|
| 1515 | + bool en, u32 blk_no, u32 id) |
|---|
| 1464 | 1516 | { |
|---|
| 1465 | 1517 | u32 exp_ctrl; |
|---|
| 1466 | 1518 | u32 addr; |
|---|
| .. | .. |
|---|
| 1478 | 1530 | break; |
|---|
| 1479 | 1531 | } |
|---|
| 1480 | 1532 | |
|---|
| 1481 | | - exp_ctrl = isp3_param_read(params_vdev, addr + ISP3X_RAWAE_BIG_CTRL); |
|---|
| 1533 | + exp_ctrl = isp3_param_read(params_vdev, addr + ISP3X_RAWAE_BIG_CTRL, id); |
|---|
| 1482 | 1534 | exp_ctrl &= ~ISP32_REG_WR_MASK; |
|---|
| 1483 | 1535 | if (en) |
|---|
| 1484 | 1536 | exp_ctrl |= ISP32_MODULE_EN; |
|---|
| 1485 | 1537 | else |
|---|
| 1486 | 1538 | exp_ctrl &= ~ISP32_MODULE_EN; |
|---|
| 1487 | 1539 | |
|---|
| 1488 | | - isp3_param_write(params_vdev, exp_ctrl, addr + ISP3X_RAWAE_BIG_CTRL); |
|---|
| 1540 | + isp3_param_write(params_vdev, exp_ctrl, addr + ISP3X_RAWAE_BIG_CTRL, id); |
|---|
| 1489 | 1541 | } |
|---|
| 1490 | 1542 | |
|---|
| 1491 | 1543 | static void |
|---|
| 1492 | 1544 | isp_rawae1_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 1493 | | - const struct isp2x_rawaebig_meas_cfg *arg) |
|---|
| 1545 | + const struct isp2x_rawaebig_meas_cfg *arg, u32 id) |
|---|
| 1494 | 1546 | { |
|---|
| 1495 | | - isp_rawaebig_config(params_vdev, arg, 1); |
|---|
| 1547 | + isp_rawaebig_config(params_vdev, arg, 1, id); |
|---|
| 1496 | 1548 | } |
|---|
| 1497 | 1549 | |
|---|
| 1498 | 1550 | static void |
|---|
| 1499 | | -isp_rawae1_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 1551 | +isp_rawae1_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 1500 | 1552 | { |
|---|
| 1501 | | - isp_rawaebig_enable(params_vdev, en, 1); |
|---|
| 1553 | + isp_rawaebig_enable(params_vdev, en, 1, id); |
|---|
| 1502 | 1554 | } |
|---|
| 1503 | 1555 | |
|---|
| 1504 | 1556 | static void |
|---|
| 1505 | 1557 | isp_rawae2_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 1506 | | - const struct isp2x_rawaebig_meas_cfg *arg) |
|---|
| 1558 | + const struct isp2x_rawaebig_meas_cfg *arg, u32 id) |
|---|
| 1507 | 1559 | { |
|---|
| 1508 | | - isp_rawaebig_config(params_vdev, arg, 2); |
|---|
| 1560 | + isp_rawaebig_config(params_vdev, arg, 2, id); |
|---|
| 1509 | 1561 | } |
|---|
| 1510 | 1562 | |
|---|
| 1511 | 1563 | static void |
|---|
| 1512 | | -isp_rawae2_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 1564 | +isp_rawae2_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 1513 | 1565 | { |
|---|
| 1514 | | - isp_rawaebig_enable(params_vdev, en, 2); |
|---|
| 1566 | + isp_rawaebig_enable(params_vdev, en, 2, id); |
|---|
| 1515 | 1567 | } |
|---|
| 1516 | 1568 | |
|---|
| 1517 | 1569 | static void |
|---|
| 1518 | 1570 | isp_rawae3_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 1519 | | - const struct isp2x_rawaebig_meas_cfg *arg) |
|---|
| 1571 | + const struct isp2x_rawaebig_meas_cfg *arg, u32 id) |
|---|
| 1520 | 1572 | { |
|---|
| 1521 | | - isp_rawaebig_config(params_vdev, arg, 0); |
|---|
| 1573 | + isp_rawaebig_config(params_vdev, arg, 0, id); |
|---|
| 1522 | 1574 | } |
|---|
| 1523 | 1575 | |
|---|
| 1524 | 1576 | static void |
|---|
| 1525 | | -isp_rawae3_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 1577 | +isp_rawae3_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 1526 | 1578 | { |
|---|
| 1527 | | - isp_rawaebig_enable(params_vdev, en, 0); |
|---|
| 1579 | + isp_rawaebig_enable(params_vdev, en, 0, id); |
|---|
| 1528 | 1580 | } |
|---|
| 1529 | 1581 | |
|---|
| 1530 | 1582 | static void |
|---|
| 1531 | 1583 | isp_rawawb_cfg_sram(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 1532 | | - const struct isp32_rawawb_meas_cfg *arg, bool is_check) |
|---|
| 1584 | + const struct isp32_rawawb_meas_cfg *arg, bool is_check, u32 id) |
|---|
| 1533 | 1585 | { |
|---|
| 1534 | | - u32 i, val = ISP32_MODULE_EN; |
|---|
| 1586 | + u32 i, val = isp3_param_read(params_vdev, ISP3X_RAWAWB_CTRL, id); |
|---|
| 1535 | 1587 | |
|---|
| 1536 | | - if (params_vdev->dev->isp_ver == ISP_V32 && is_check && |
|---|
| 1537 | | - !(isp3_param_read(params_vdev, ISP3X_RAWAWB_CTRL) & val)) |
|---|
| 1588 | + if (params_vdev->dev->isp_ver != ISP_V32 || |
|---|
| 1589 | + (is_check && !(val & ISP32_MODULE_EN))) |
|---|
| 1538 | 1590 | return; |
|---|
| 1539 | 1591 | |
|---|
| 1540 | 1592 | for (i = 0; i < ISP32_RAWAWB_WEIGHT_NUM / 5; i++) { |
|---|
| 1541 | | - isp3_param_write(params_vdev, |
|---|
| 1542 | | - (arg->wp_blk_wei_w[5 * i] & 0x3f) | |
|---|
| 1543 | | - (arg->wp_blk_wei_w[5 * i + 1] & 0x3f) << 6 | |
|---|
| 1544 | | - (arg->wp_blk_wei_w[5 * i + 2] & 0x3f) << 12 | |
|---|
| 1545 | | - (arg->wp_blk_wei_w[5 * i + 3] & 0x3f) << 18 | |
|---|
| 1546 | | - (arg->wp_blk_wei_w[5 * i + 4] & 0x3f) << 24, |
|---|
| 1547 | | - ISP3X_RAWAWB_WRAM_DATA_BASE); |
|---|
| 1593 | + val = (arg->wp_blk_wei_w[5 * i] & 0x3f) | |
|---|
| 1594 | + (arg->wp_blk_wei_w[5 * i + 1] & 0x3f) << 6 | |
|---|
| 1595 | + (arg->wp_blk_wei_w[5 * i + 2] & 0x3f) << 12 | |
|---|
| 1596 | + (arg->wp_blk_wei_w[5 * i + 3] & 0x3f) << 18 | |
|---|
| 1597 | + (arg->wp_blk_wei_w[5 * i + 4] & 0x3f) << 24; |
|---|
| 1598 | + isp3_param_write_direct(params_vdev, val, ISP3X_RAWAWB_WRAM_DATA_BASE); |
|---|
| 1548 | 1599 | } |
|---|
| 1549 | 1600 | } |
|---|
| 1550 | 1601 | |
|---|
| 1551 | 1602 | static void |
|---|
| 1552 | 1603 | isp_rawawb_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 1553 | | - const struct isp32_rawawb_meas_cfg *arg) |
|---|
| 1604 | + const struct isp32_rawawb_meas_cfg *arg, u32 id) |
|---|
| 1554 | 1605 | { |
|---|
| 1555 | | - struct isp32_isp_params_cfg *params_rec = params_vdev->isp32_params; |
|---|
| 1606 | + struct rkisp_device *dev = params_vdev->dev; |
|---|
| 1607 | + struct v4l2_rect *out_crop = &dev->isp_sdev.out_crop; |
|---|
| 1608 | + struct isp32_isp_params_cfg *params_rec = params_vdev->isp32_params + id; |
|---|
| 1556 | 1609 | struct isp32_rawawb_meas_cfg *arg_rec = ¶ms_rec->meas.rawawb; |
|---|
| 1557 | 1610 | const struct isp2x_bls_fixed_val *pval = &arg->bls2_val; |
|---|
| 1558 | | - u32 value, val, mask, i; |
|---|
| 1611 | + u32 width = out_crop->width, height = out_crop->height; |
|---|
| 1612 | + u32 value, val, mask, i, h_size, v_size, h_offs, v_offs; |
|---|
| 1559 | 1613 | |
|---|
| 1560 | | - value = isp3_param_read(params_vdev, ISP3X_BLS_CTRL); |
|---|
| 1614 | + value = isp3_param_read(params_vdev, ISP3X_BLS_CTRL, id); |
|---|
| 1561 | 1615 | value &= ~ISP32_BLS_BLS2_EN; |
|---|
| 1562 | 1616 | if (arg->bls2_en) { |
|---|
| 1563 | 1617 | switch (params_vdev->raw_type) { |
|---|
| 1564 | 1618 | case RAW_BGGR: |
|---|
| 1565 | | - isp3_param_write(params_vdev, pval->r, ISP32_BLS2_D_FIXED); |
|---|
| 1566 | | - isp3_param_write(params_vdev, pval->gr, ISP32_BLS2_C_FIXED); |
|---|
| 1567 | | - isp3_param_write(params_vdev, pval->gb, ISP32_BLS2_B_FIXED); |
|---|
| 1568 | | - isp3_param_write(params_vdev, pval->b, ISP32_BLS2_A_FIXED); |
|---|
| 1619 | + isp3_param_write(params_vdev, pval->r, ISP32_BLS2_D_FIXED, id); |
|---|
| 1620 | + isp3_param_write(params_vdev, pval->gr, ISP32_BLS2_C_FIXED, id); |
|---|
| 1621 | + isp3_param_write(params_vdev, pval->gb, ISP32_BLS2_B_FIXED, id); |
|---|
| 1622 | + isp3_param_write(params_vdev, pval->b, ISP32_BLS2_A_FIXED, id); |
|---|
| 1569 | 1623 | break; |
|---|
| 1570 | 1624 | case RAW_GBRG: |
|---|
| 1571 | | - isp3_param_write(params_vdev, pval->r, ISP32_BLS2_C_FIXED); |
|---|
| 1572 | | - isp3_param_write(params_vdev, pval->gr, ISP32_BLS2_D_FIXED); |
|---|
| 1573 | | - isp3_param_write(params_vdev, pval->gb, ISP32_BLS2_A_FIXED); |
|---|
| 1574 | | - isp3_param_write(params_vdev, pval->b, ISP32_BLS2_B_FIXED); |
|---|
| 1625 | + isp3_param_write(params_vdev, pval->r, ISP32_BLS2_C_FIXED, id); |
|---|
| 1626 | + isp3_param_write(params_vdev, pval->gr, ISP32_BLS2_D_FIXED, id); |
|---|
| 1627 | + isp3_param_write(params_vdev, pval->gb, ISP32_BLS2_A_FIXED, id); |
|---|
| 1628 | + isp3_param_write(params_vdev, pval->b, ISP32_BLS2_B_FIXED, id); |
|---|
| 1575 | 1629 | break; |
|---|
| 1576 | 1630 | case RAW_GRBG: |
|---|
| 1577 | | - isp3_param_write(params_vdev, pval->r, ISP32_BLS2_B_FIXED); |
|---|
| 1578 | | - isp3_param_write(params_vdev, pval->gr, ISP32_BLS2_A_FIXED); |
|---|
| 1579 | | - isp3_param_write(params_vdev, pval->gb, ISP32_BLS2_D_FIXED); |
|---|
| 1580 | | - isp3_param_write(params_vdev, pval->b, ISP32_BLS2_C_FIXED); |
|---|
| 1631 | + isp3_param_write(params_vdev, pval->r, ISP32_BLS2_B_FIXED, id); |
|---|
| 1632 | + isp3_param_write(params_vdev, pval->gr, ISP32_BLS2_A_FIXED, id); |
|---|
| 1633 | + isp3_param_write(params_vdev, pval->gb, ISP32_BLS2_D_FIXED, id); |
|---|
| 1634 | + isp3_param_write(params_vdev, pval->b, ISP32_BLS2_C_FIXED, id); |
|---|
| 1581 | 1635 | break; |
|---|
| 1582 | 1636 | case RAW_RGGB: |
|---|
| 1583 | 1637 | default: |
|---|
| 1584 | | - isp3_param_write(params_vdev, pval->r, ISP32_BLS2_A_FIXED); |
|---|
| 1585 | | - isp3_param_write(params_vdev, pval->gr, ISP32_BLS2_B_FIXED); |
|---|
| 1586 | | - isp3_param_write(params_vdev, pval->gb, ISP32_BLS2_C_FIXED); |
|---|
| 1587 | | - isp3_param_write(params_vdev, pval->b, ISP32_BLS2_D_FIXED); |
|---|
| 1638 | + isp3_param_write(params_vdev, pval->r, ISP32_BLS2_A_FIXED, id); |
|---|
| 1639 | + isp3_param_write(params_vdev, pval->gr, ISP32_BLS2_B_FIXED, id); |
|---|
| 1640 | + isp3_param_write(params_vdev, pval->gb, ISP32_BLS2_C_FIXED, id); |
|---|
| 1641 | + isp3_param_write(params_vdev, pval->b, ISP32_BLS2_D_FIXED, id); |
|---|
| 1588 | 1642 | } |
|---|
| 1589 | 1643 | value |= ISP32_BLS_BLS2_EN; |
|---|
| 1590 | 1644 | } |
|---|
| 1591 | | - isp3_param_write(params_vdev, value, ISP3X_BLS_CTRL); |
|---|
| 1645 | + isp3_param_write(params_vdev, value, ISP3X_BLS_CTRL, id); |
|---|
| 1592 | 1646 | |
|---|
| 1593 | 1647 | value = arg->in_overexposure_threshold << 16 | |
|---|
| 1594 | 1648 | !!arg->blk_with_luma_wei_en << 8 | |
|---|
| .. | .. |
|---|
| 1599 | 1653 | !!arg->blk_measure_enable; |
|---|
| 1600 | 1654 | if (params_vdev->dev->isp_ver == ISP_V32_L) |
|---|
| 1601 | 1655 | value |= !!arg->ds16x8_mode_en << 7; |
|---|
| 1602 | | - isp3_param_write(params_vdev, value, ISP3X_RAWAWB_BLK_CTRL); |
|---|
| 1656 | + isp3_param_write(params_vdev, value, ISP3X_RAWAWB_BLK_CTRL, id); |
|---|
| 1603 | 1657 | |
|---|
| 1604 | | - isp3_param_write(params_vdev, |
|---|
| 1605 | | - ISP_PACK_2SHORT(arg->h_offs, arg->v_offs), |
|---|
| 1606 | | - ISP3X_RAWAWB_WIN_OFFS); |
|---|
| 1607 | 1658 | |
|---|
| 1659 | + h_offs = arg->h_offs & ~0x1; |
|---|
| 1660 | + v_offs = arg->v_offs & ~0x1; |
|---|
| 1608 | 1661 | isp3_param_write(params_vdev, |
|---|
| 1609 | | - ISP_PACK_2SHORT(arg->h_size, arg->v_size), |
|---|
| 1610 | | - ISP3X_RAWAWB_WIN_SIZE); |
|---|
| 1662 | + ISP_PACK_2SHORT(h_offs, v_offs), |
|---|
| 1663 | + ISP3X_RAWAWB_WIN_OFFS, id); |
|---|
| 1664 | + |
|---|
| 1665 | + if (dev->hw_dev->unite) |
|---|
| 1666 | + width = width / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL; |
|---|
| 1667 | + h_size = arg->h_size; |
|---|
| 1668 | + v_size = arg->v_size; |
|---|
| 1669 | + if (!h_size || h_size + h_offs > width) |
|---|
| 1670 | + h_size = width - h_offs; |
|---|
| 1671 | + if (!v_size || v_size + v_offs > height) |
|---|
| 1672 | + v_size = height - v_offs; |
|---|
| 1673 | + isp3_param_write(params_vdev, |
|---|
| 1674 | + ISP_PACK_2SHORT(h_size, v_size), |
|---|
| 1675 | + ISP3X_RAWAWB_WIN_SIZE, id); |
|---|
| 1611 | 1676 | |
|---|
| 1612 | 1677 | isp3_param_write(params_vdev, |
|---|
| 1613 | 1678 | ISP_PACK_2SHORT(arg->r_max, arg->g_max), |
|---|
| 1614 | | - ISP3X_RAWAWB_LIMIT_RG_MAX); |
|---|
| 1679 | + ISP3X_RAWAWB_LIMIT_RG_MAX, id); |
|---|
| 1615 | 1680 | |
|---|
| 1616 | 1681 | isp3_param_write(params_vdev, |
|---|
| 1617 | 1682 | ISP_PACK_2SHORT(arg->b_max, arg->y_max), |
|---|
| 1618 | | - ISP3X_RAWAWB_LIMIT_BY_MAX); |
|---|
| 1683 | + ISP3X_RAWAWB_LIMIT_BY_MAX, id); |
|---|
| 1619 | 1684 | |
|---|
| 1620 | 1685 | isp3_param_write(params_vdev, |
|---|
| 1621 | 1686 | ISP_PACK_2SHORT(arg->r_min, arg->g_min), |
|---|
| 1622 | | - ISP3X_RAWAWB_LIMIT_RG_MIN); |
|---|
| 1687 | + ISP3X_RAWAWB_LIMIT_RG_MIN, id); |
|---|
| 1623 | 1688 | |
|---|
| 1624 | 1689 | isp3_param_write(params_vdev, |
|---|
| 1625 | 1690 | ISP_PACK_2SHORT(arg->b_min, arg->y_min), |
|---|
| 1626 | | - ISP3X_RAWAWB_LIMIT_BY_MIN); |
|---|
| 1691 | + ISP3X_RAWAWB_LIMIT_BY_MIN, id); |
|---|
| 1627 | 1692 | |
|---|
| 1628 | 1693 | value = !!arg->wp_hist_xytype << 4 | |
|---|
| 1629 | 1694 | !!arg->wp_blk_wei_en1 << 3 | |
|---|
| 1630 | 1695 | !!arg->wp_blk_wei_en0 << 2 | |
|---|
| 1631 | 1696 | !!arg->wp_luma_wei_en1 << 1 | |
|---|
| 1632 | 1697 | !!arg->wp_luma_wei_en0; |
|---|
| 1633 | | - isp3_param_write(params_vdev, value, ISP3X_RAWAWB_WEIGHT_CURVE_CTRL); |
|---|
| 1698 | + isp3_param_write(params_vdev, value, ISP3X_RAWAWB_WEIGHT_CURVE_CTRL, id); |
|---|
| 1634 | 1699 | |
|---|
| 1635 | 1700 | isp3_param_write(params_vdev, |
|---|
| 1636 | 1701 | ISP_PACK_4BYTE(arg->wp_luma_weicurve_y0, |
|---|
| 1637 | 1702 | arg->wp_luma_weicurve_y1, |
|---|
| 1638 | 1703 | arg->wp_luma_weicurve_y2, |
|---|
| 1639 | 1704 | arg->wp_luma_weicurve_y3), |
|---|
| 1640 | | - ISP3X_RAWAWB_YWEIGHT_CURVE_XCOOR03); |
|---|
| 1705 | + ISP3X_RAWAWB_YWEIGHT_CURVE_XCOOR03, id); |
|---|
| 1641 | 1706 | |
|---|
| 1642 | 1707 | isp3_param_write(params_vdev, |
|---|
| 1643 | 1708 | ISP_PACK_4BYTE(arg->wp_luma_weicurve_y4, |
|---|
| 1644 | 1709 | arg->wp_luma_weicurve_y5, |
|---|
| 1645 | 1710 | arg->wp_luma_weicurve_y6, |
|---|
| 1646 | 1711 | arg->wp_luma_weicurve_y7), |
|---|
| 1647 | | - ISP3X_RAWAWB_YWEIGHT_CURVE_XCOOR47); |
|---|
| 1712 | + ISP3X_RAWAWB_YWEIGHT_CURVE_XCOOR47, id); |
|---|
| 1648 | 1713 | |
|---|
| 1649 | 1714 | isp3_param_write(params_vdev, |
|---|
| 1650 | 1715 | arg->wp_luma_weicurve_y8, |
|---|
| 1651 | | - ISP3X_RAWAWB_YWEIGHT_CURVE_XCOOR8); |
|---|
| 1716 | + ISP3X_RAWAWB_YWEIGHT_CURVE_XCOOR8, id); |
|---|
| 1652 | 1717 | |
|---|
| 1653 | 1718 | isp3_param_write(params_vdev, |
|---|
| 1654 | 1719 | ISP_PACK_4BYTE(arg->wp_luma_weicurve_w0, |
|---|
| 1655 | 1720 | arg->wp_luma_weicurve_w1, |
|---|
| 1656 | 1721 | arg->wp_luma_weicurve_w2, |
|---|
| 1657 | 1722 | arg->wp_luma_weicurve_w3), |
|---|
| 1658 | | - ISP3X_RAWAWB_YWEIGHT_CURVE_YCOOR03); |
|---|
| 1723 | + ISP3X_RAWAWB_YWEIGHT_CURVE_YCOOR03, id); |
|---|
| 1659 | 1724 | |
|---|
| 1660 | 1725 | isp3_param_write(params_vdev, |
|---|
| 1661 | 1726 | ISP_PACK_4BYTE(arg->wp_luma_weicurve_w4, |
|---|
| 1662 | 1727 | arg->wp_luma_weicurve_w5, |
|---|
| 1663 | 1728 | arg->wp_luma_weicurve_w6, |
|---|
| 1664 | 1729 | arg->wp_luma_weicurve_w7), |
|---|
| 1665 | | - ISP3X_RAWAWB_YWEIGHT_CURVE_YCOOR47); |
|---|
| 1730 | + ISP3X_RAWAWB_YWEIGHT_CURVE_YCOOR47, id); |
|---|
| 1666 | 1731 | |
|---|
| 1667 | 1732 | isp3_param_write(params_vdev, |
|---|
| 1668 | 1733 | ISP_PACK_2SHORT(arg->wp_luma_weicurve_w8, |
|---|
| 1669 | 1734 | arg->pre_wbgain_inv_r), |
|---|
| 1670 | | - ISP3X_RAWAWB_YWEIGHT_CURVE_YCOOR8); |
|---|
| 1735 | + ISP3X_RAWAWB_YWEIGHT_CURVE_YCOOR8, id); |
|---|
| 1671 | 1736 | |
|---|
| 1672 | 1737 | isp3_param_write(params_vdev, |
|---|
| 1673 | 1738 | ISP_PACK_2SHORT(arg->pre_wbgain_inv_g, |
|---|
| 1674 | 1739 | arg->pre_wbgain_inv_b), |
|---|
| 1675 | | - ISP3X_RAWAWB_PRE_WBGAIN_INV); |
|---|
| 1740 | + ISP3X_RAWAWB_PRE_WBGAIN_INV, id); |
|---|
| 1676 | 1741 | |
|---|
| 1677 | 1742 | isp3_param_write(params_vdev, |
|---|
| 1678 | 1743 | ISP_PACK_2SHORT(arg->vertex0_u_0, arg->vertex0_v_0), |
|---|
| 1679 | | - ISP3X_RAWAWB_UV_DETC_VERTEX0_0); |
|---|
| 1744 | + ISP3X_RAWAWB_UV_DETC_VERTEX0_0, id); |
|---|
| 1680 | 1745 | |
|---|
| 1681 | 1746 | isp3_param_write(params_vdev, |
|---|
| 1682 | 1747 | ISP_PACK_2SHORT(arg->vertex1_u_0, arg->vertex1_v_0), |
|---|
| 1683 | | - ISP3X_RAWAWB_UV_DETC_VERTEX1_0); |
|---|
| 1748 | + ISP3X_RAWAWB_UV_DETC_VERTEX1_0, id); |
|---|
| 1684 | 1749 | |
|---|
| 1685 | 1750 | isp3_param_write(params_vdev, |
|---|
| 1686 | 1751 | ISP_PACK_2SHORT(arg->vertex2_u_0, arg->vertex2_v_0), |
|---|
| 1687 | | - ISP3X_RAWAWB_UV_DETC_VERTEX2_0); |
|---|
| 1752 | + ISP3X_RAWAWB_UV_DETC_VERTEX2_0, id); |
|---|
| 1688 | 1753 | |
|---|
| 1689 | 1754 | isp3_param_write(params_vdev, |
|---|
| 1690 | 1755 | ISP_PACK_2SHORT(arg->vertex3_u_0, arg->vertex3_v_0), |
|---|
| 1691 | | - ISP3X_RAWAWB_UV_DETC_VERTEX3_0); |
|---|
| 1756 | + ISP3X_RAWAWB_UV_DETC_VERTEX3_0, id); |
|---|
| 1692 | 1757 | |
|---|
| 1693 | 1758 | isp3_param_write(params_vdev, arg->islope01_0, |
|---|
| 1694 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE01_0); |
|---|
| 1759 | + ISP3X_RAWAWB_UV_DETC_ISLOPE01_0, id); |
|---|
| 1695 | 1760 | |
|---|
| 1696 | 1761 | isp3_param_write(params_vdev, arg->islope12_0, |
|---|
| 1697 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE12_0); |
|---|
| 1762 | + ISP3X_RAWAWB_UV_DETC_ISLOPE12_0, id); |
|---|
| 1698 | 1763 | |
|---|
| 1699 | 1764 | isp3_param_write(params_vdev, arg->islope23_0, |
|---|
| 1700 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE23_0); |
|---|
| 1765 | + ISP3X_RAWAWB_UV_DETC_ISLOPE23_0, id); |
|---|
| 1701 | 1766 | |
|---|
| 1702 | 1767 | isp3_param_write(params_vdev, arg->islope30_0, |
|---|
| 1703 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE30_0); |
|---|
| 1768 | + ISP3X_RAWAWB_UV_DETC_ISLOPE30_0, id); |
|---|
| 1704 | 1769 | |
|---|
| 1705 | 1770 | isp3_param_write(params_vdev, |
|---|
| 1706 | 1771 | ISP_PACK_2SHORT(arg->vertex0_u_1, |
|---|
| 1707 | 1772 | arg->vertex0_v_1), |
|---|
| 1708 | | - ISP3X_RAWAWB_UV_DETC_VERTEX0_1); |
|---|
| 1773 | + ISP3X_RAWAWB_UV_DETC_VERTEX0_1, id); |
|---|
| 1709 | 1774 | |
|---|
| 1710 | 1775 | isp3_param_write(params_vdev, |
|---|
| 1711 | 1776 | ISP_PACK_2SHORT(arg->vertex1_u_1, |
|---|
| 1712 | 1777 | arg->vertex1_v_1), |
|---|
| 1713 | | - ISP3X_RAWAWB_UV_DETC_VERTEX1_1); |
|---|
| 1778 | + ISP3X_RAWAWB_UV_DETC_VERTEX1_1, id); |
|---|
| 1714 | 1779 | |
|---|
| 1715 | 1780 | isp3_param_write(params_vdev, |
|---|
| 1716 | 1781 | ISP_PACK_2SHORT(arg->vertex2_u_1, |
|---|
| 1717 | 1782 | arg->vertex2_v_1), |
|---|
| 1718 | | - ISP3X_RAWAWB_UV_DETC_VERTEX2_1); |
|---|
| 1783 | + ISP3X_RAWAWB_UV_DETC_VERTEX2_1, id); |
|---|
| 1719 | 1784 | |
|---|
| 1720 | 1785 | isp3_param_write(params_vdev, |
|---|
| 1721 | 1786 | ISP_PACK_2SHORT(arg->vertex3_u_1, |
|---|
| 1722 | 1787 | arg->vertex3_v_1), |
|---|
| 1723 | | - ISP3X_RAWAWB_UV_DETC_VERTEX3_1); |
|---|
| 1788 | + ISP3X_RAWAWB_UV_DETC_VERTEX3_1, id); |
|---|
| 1724 | 1789 | |
|---|
| 1725 | 1790 | isp3_param_write(params_vdev, arg->islope01_1, |
|---|
| 1726 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE01_1); |
|---|
| 1791 | + ISP3X_RAWAWB_UV_DETC_ISLOPE01_1, id); |
|---|
| 1727 | 1792 | |
|---|
| 1728 | 1793 | isp3_param_write(params_vdev, arg->islope12_1, |
|---|
| 1729 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE12_1); |
|---|
| 1794 | + ISP3X_RAWAWB_UV_DETC_ISLOPE12_1, id); |
|---|
| 1730 | 1795 | |
|---|
| 1731 | 1796 | isp3_param_write(params_vdev, arg->islope23_1, |
|---|
| 1732 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE23_1); |
|---|
| 1797 | + ISP3X_RAWAWB_UV_DETC_ISLOPE23_1, id); |
|---|
| 1733 | 1798 | |
|---|
| 1734 | 1799 | isp3_param_write(params_vdev, arg->islope30_1, |
|---|
| 1735 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE30_1); |
|---|
| 1800 | + ISP3X_RAWAWB_UV_DETC_ISLOPE30_1, id); |
|---|
| 1736 | 1801 | |
|---|
| 1737 | 1802 | isp3_param_write(params_vdev, |
|---|
| 1738 | 1803 | ISP_PACK_2SHORT(arg->vertex0_u_2, |
|---|
| 1739 | 1804 | arg->vertex0_v_2), |
|---|
| 1740 | | - ISP3X_RAWAWB_UV_DETC_VERTEX0_2); |
|---|
| 1805 | + ISP3X_RAWAWB_UV_DETC_VERTEX0_2, id); |
|---|
| 1741 | 1806 | |
|---|
| 1742 | 1807 | isp3_param_write(params_vdev, |
|---|
| 1743 | 1808 | ISP_PACK_2SHORT(arg->vertex1_u_2, |
|---|
| 1744 | 1809 | arg->vertex1_v_2), |
|---|
| 1745 | | - ISP3X_RAWAWB_UV_DETC_VERTEX1_2); |
|---|
| 1810 | + ISP3X_RAWAWB_UV_DETC_VERTEX1_2, id); |
|---|
| 1746 | 1811 | |
|---|
| 1747 | 1812 | isp3_param_write(params_vdev, |
|---|
| 1748 | 1813 | ISP_PACK_2SHORT(arg->vertex2_u_2, |
|---|
| 1749 | 1814 | arg->vertex2_v_2), |
|---|
| 1750 | | - ISP3X_RAWAWB_UV_DETC_VERTEX2_2); |
|---|
| 1815 | + ISP3X_RAWAWB_UV_DETC_VERTEX2_2, id); |
|---|
| 1751 | 1816 | |
|---|
| 1752 | 1817 | isp3_param_write(params_vdev, |
|---|
| 1753 | 1818 | ISP_PACK_2SHORT(arg->vertex3_u_2, |
|---|
| 1754 | 1819 | arg->vertex3_v_2), |
|---|
| 1755 | | - ISP3X_RAWAWB_UV_DETC_VERTEX3_2); |
|---|
| 1820 | + ISP3X_RAWAWB_UV_DETC_VERTEX3_2, id); |
|---|
| 1756 | 1821 | |
|---|
| 1757 | 1822 | isp3_param_write(params_vdev, arg->islope01_2, |
|---|
| 1758 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE01_2); |
|---|
| 1823 | + ISP3X_RAWAWB_UV_DETC_ISLOPE01_2, id); |
|---|
| 1759 | 1824 | |
|---|
| 1760 | 1825 | isp3_param_write(params_vdev, arg->islope12_2, |
|---|
| 1761 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE12_2); |
|---|
| 1826 | + ISP3X_RAWAWB_UV_DETC_ISLOPE12_2, id); |
|---|
| 1762 | 1827 | |
|---|
| 1763 | 1828 | isp3_param_write(params_vdev, arg->islope23_2, |
|---|
| 1764 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE23_2); |
|---|
| 1829 | + ISP3X_RAWAWB_UV_DETC_ISLOPE23_2, id); |
|---|
| 1765 | 1830 | |
|---|
| 1766 | 1831 | isp3_param_write(params_vdev, arg->islope30_2, |
|---|
| 1767 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE30_2); |
|---|
| 1832 | + ISP3X_RAWAWB_UV_DETC_ISLOPE30_2, id); |
|---|
| 1768 | 1833 | |
|---|
| 1769 | 1834 | isp3_param_write(params_vdev, |
|---|
| 1770 | 1835 | ISP_PACK_2SHORT(arg->vertex0_u_3, |
|---|
| 1771 | 1836 | arg->vertex0_v_3), |
|---|
| 1772 | | - ISP3X_RAWAWB_UV_DETC_VERTEX0_3); |
|---|
| 1837 | + ISP3X_RAWAWB_UV_DETC_VERTEX0_3, id); |
|---|
| 1773 | 1838 | |
|---|
| 1774 | 1839 | isp3_param_write(params_vdev, |
|---|
| 1775 | 1840 | ISP_PACK_2SHORT(arg->vertex1_u_3, |
|---|
| 1776 | 1841 | arg->vertex1_v_3), |
|---|
| 1777 | | - ISP3X_RAWAWB_UV_DETC_VERTEX1_3); |
|---|
| 1842 | + ISP3X_RAWAWB_UV_DETC_VERTEX1_3, id); |
|---|
| 1778 | 1843 | |
|---|
| 1779 | 1844 | isp3_param_write(params_vdev, |
|---|
| 1780 | 1845 | ISP_PACK_2SHORT(arg->vertex2_u_3, |
|---|
| 1781 | 1846 | arg->vertex2_v_3), |
|---|
| 1782 | | - ISP3X_RAWAWB_UV_DETC_VERTEX2_3); |
|---|
| 1847 | + ISP3X_RAWAWB_UV_DETC_VERTEX2_3, id); |
|---|
| 1783 | 1848 | |
|---|
| 1784 | 1849 | isp3_param_write(params_vdev, |
|---|
| 1785 | 1850 | ISP_PACK_2SHORT(arg->vertex3_u_3, |
|---|
| 1786 | 1851 | arg->vertex3_v_3), |
|---|
| 1787 | | - ISP3X_RAWAWB_UV_DETC_VERTEX3_3); |
|---|
| 1852 | + ISP3X_RAWAWB_UV_DETC_VERTEX3_3, id); |
|---|
| 1788 | 1853 | |
|---|
| 1789 | 1854 | isp3_param_write(params_vdev, arg->islope01_3, |
|---|
| 1790 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE01_3); |
|---|
| 1855 | + ISP3X_RAWAWB_UV_DETC_ISLOPE01_3, id); |
|---|
| 1791 | 1856 | |
|---|
| 1792 | 1857 | isp3_param_write(params_vdev, arg->islope12_3, |
|---|
| 1793 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE12_3); |
|---|
| 1858 | + ISP3X_RAWAWB_UV_DETC_ISLOPE12_3, id); |
|---|
| 1794 | 1859 | |
|---|
| 1795 | 1860 | isp3_param_write(params_vdev, arg->islope23_3, |
|---|
| 1796 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE23_3); |
|---|
| 1861 | + ISP3X_RAWAWB_UV_DETC_ISLOPE23_3, id); |
|---|
| 1797 | 1862 | |
|---|
| 1798 | 1863 | isp3_param_write(params_vdev, arg->islope30_3, |
|---|
| 1799 | | - ISP3X_RAWAWB_UV_DETC_ISLOPE30_3); |
|---|
| 1864 | + ISP3X_RAWAWB_UV_DETC_ISLOPE30_3, id); |
|---|
| 1800 | 1865 | |
|---|
| 1801 | 1866 | isp3_param_write(params_vdev, |
|---|
| 1802 | 1867 | ISP_PACK_2SHORT(arg->rgb2ryuvmat0_y, |
|---|
| 1803 | 1868 | arg->rgb2ryuvmat1_y), |
|---|
| 1804 | | - ISP3X_RAWAWB_YUV_RGB2ROTY_0); |
|---|
| 1869 | + ISP3X_RAWAWB_YUV_RGB2ROTY_0, id); |
|---|
| 1805 | 1870 | |
|---|
| 1806 | 1871 | isp3_param_write(params_vdev, |
|---|
| 1807 | 1872 | ISP_PACK_2SHORT(arg->rgb2ryuvmat2_y, |
|---|
| 1808 | 1873 | arg->rgb2ryuvofs_y), |
|---|
| 1809 | | - ISP3X_RAWAWB_YUV_RGB2ROTY_1); |
|---|
| 1874 | + ISP3X_RAWAWB_YUV_RGB2ROTY_1, id); |
|---|
| 1810 | 1875 | |
|---|
| 1811 | 1876 | isp3_param_write(params_vdev, |
|---|
| 1812 | 1877 | ISP_PACK_2SHORT(arg->rgb2ryuvmat0_u, |
|---|
| 1813 | 1878 | arg->rgb2ryuvmat1_u), |
|---|
| 1814 | | - ISP3X_RAWAWB_YUV_RGB2ROTU_0); |
|---|
| 1879 | + ISP3X_RAWAWB_YUV_RGB2ROTU_0, id); |
|---|
| 1815 | 1880 | |
|---|
| 1816 | 1881 | |
|---|
| 1817 | 1882 | isp3_param_write(params_vdev, |
|---|
| 1818 | 1883 | ISP_PACK_2SHORT(arg->rgb2ryuvmat2_u, |
|---|
| 1819 | 1884 | arg->rgb2ryuvofs_u), |
|---|
| 1820 | | - ISP3X_RAWAWB_YUV_RGB2ROTU_1); |
|---|
| 1885 | + ISP3X_RAWAWB_YUV_RGB2ROTU_1, id); |
|---|
| 1821 | 1886 | |
|---|
| 1822 | 1887 | isp3_param_write(params_vdev, |
|---|
| 1823 | 1888 | ISP_PACK_2SHORT(arg->rgb2ryuvmat0_v, |
|---|
| 1824 | 1889 | arg->rgb2ryuvmat1_v), |
|---|
| 1825 | | - ISP3X_RAWAWB_YUV_RGB2ROTV_0); |
|---|
| 1890 | + ISP3X_RAWAWB_YUV_RGB2ROTV_0, id); |
|---|
| 1826 | 1891 | |
|---|
| 1827 | 1892 | isp3_param_write(params_vdev, |
|---|
| 1828 | 1893 | ISP_PACK_2SHORT(arg->rgb2ryuvmat2_v, |
|---|
| 1829 | 1894 | arg->rgb2ryuvofs_v), |
|---|
| 1830 | | - ISP3X_RAWAWB_YUV_RGB2ROTV_1); |
|---|
| 1895 | + ISP3X_RAWAWB_YUV_RGB2ROTV_1, id); |
|---|
| 1831 | 1896 | |
|---|
| 1832 | 1897 | isp3_param_write(params_vdev, |
|---|
| 1833 | 1898 | ISP_PACK_2SHORT(arg->coor_x1_ls0_y, |
|---|
| 1834 | 1899 | arg->vec_x21_ls0_y), |
|---|
| 1835 | | - ISP3X_RAWAWB_YUV_X_COOR_Y_0); |
|---|
| 1900 | + ISP3X_RAWAWB_YUV_X_COOR_Y_0, id); |
|---|
| 1836 | 1901 | |
|---|
| 1837 | 1902 | isp3_param_write(params_vdev, |
|---|
| 1838 | 1903 | ISP_PACK_2SHORT(arg->coor_x1_ls0_u, |
|---|
| 1839 | 1904 | arg->vec_x21_ls0_u), |
|---|
| 1840 | | - ISP3X_RAWAWB_YUV_X_COOR_U_0); |
|---|
| 1905 | + ISP3X_RAWAWB_YUV_X_COOR_U_0, id); |
|---|
| 1841 | 1906 | |
|---|
| 1842 | 1907 | isp3_param_write(params_vdev, |
|---|
| 1843 | 1908 | ISP_PACK_2SHORT(arg->coor_x1_ls0_v, |
|---|
| 1844 | 1909 | arg->vec_x21_ls0_v), |
|---|
| 1845 | | - ISP3X_RAWAWB_YUV_X_COOR_V_0); |
|---|
| 1910 | + ISP3X_RAWAWB_YUV_X_COOR_V_0, id); |
|---|
| 1846 | 1911 | |
|---|
| 1847 | 1912 | isp3_param_write(params_vdev, |
|---|
| 1848 | 1913 | ISP_PACK_4BYTE(arg->dis_x1x2_ls0, 0, |
|---|
| 1849 | 1914 | arg->rotu0_ls0, arg->rotu1_ls0), |
|---|
| 1850 | | - ISP3X_RAWAWB_YUV_X1X2_DIS_0); |
|---|
| 1915 | + ISP3X_RAWAWB_YUV_X1X2_DIS_0, id); |
|---|
| 1851 | 1916 | |
|---|
| 1852 | 1917 | isp3_param_write(params_vdev, |
|---|
| 1853 | 1918 | ISP_PACK_4BYTE(arg->rotu2_ls0, arg->rotu3_ls0, |
|---|
| 1854 | 1919 | arg->rotu4_ls0, arg->rotu5_ls0), |
|---|
| 1855 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_UCOOR_0); |
|---|
| 1920 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_UCOOR_0, id); |
|---|
| 1856 | 1921 | |
|---|
| 1857 | 1922 | isp3_param_write(params_vdev, |
|---|
| 1858 | 1923 | ISP_PACK_2SHORT(arg->th0_ls0, arg->th1_ls0), |
|---|
| 1859 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_TH0_0); |
|---|
| 1924 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_TH0_0, id); |
|---|
| 1860 | 1925 | |
|---|
| 1861 | 1926 | isp3_param_write(params_vdev, |
|---|
| 1862 | 1927 | ISP_PACK_2SHORT(arg->th2_ls0, arg->th3_ls0), |
|---|
| 1863 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_TH1_0); |
|---|
| 1928 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_TH1_0, id); |
|---|
| 1864 | 1929 | |
|---|
| 1865 | 1930 | isp3_param_write(params_vdev, |
|---|
| 1866 | 1931 | ISP_PACK_2SHORT(arg->th4_ls0, arg->th5_ls0), |
|---|
| 1867 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_TH2_0); |
|---|
| 1932 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_TH2_0, id); |
|---|
| 1868 | 1933 | |
|---|
| 1869 | 1934 | isp3_param_write(params_vdev, |
|---|
| 1870 | 1935 | ISP_PACK_2SHORT(arg->coor_x1_ls1_y, |
|---|
| 1871 | 1936 | arg->vec_x21_ls1_y), |
|---|
| 1872 | | - ISP3X_RAWAWB_YUV_X_COOR_Y_1); |
|---|
| 1937 | + ISP3X_RAWAWB_YUV_X_COOR_Y_1, id); |
|---|
| 1873 | 1938 | |
|---|
| 1874 | 1939 | isp3_param_write(params_vdev, |
|---|
| 1875 | 1940 | ISP_PACK_2SHORT(arg->coor_x1_ls1_u, |
|---|
| 1876 | 1941 | arg->vec_x21_ls1_u), |
|---|
| 1877 | | - ISP3X_RAWAWB_YUV_X_COOR_U_1); |
|---|
| 1942 | + ISP3X_RAWAWB_YUV_X_COOR_U_1, id); |
|---|
| 1878 | 1943 | |
|---|
| 1879 | 1944 | isp3_param_write(params_vdev, |
|---|
| 1880 | 1945 | ISP_PACK_2SHORT(arg->coor_x1_ls1_v, |
|---|
| 1881 | 1946 | arg->vec_x21_ls1_v), |
|---|
| 1882 | | - ISP3X_RAWAWB_YUV_X_COOR_V_1); |
|---|
| 1947 | + ISP3X_RAWAWB_YUV_X_COOR_V_1, id); |
|---|
| 1883 | 1948 | |
|---|
| 1884 | 1949 | isp3_param_write(params_vdev, |
|---|
| 1885 | 1950 | ISP_PACK_4BYTE(arg->dis_x1x2_ls1, 0, |
|---|
| 1886 | 1951 | arg->rotu0_ls1, arg->rotu1_ls1), |
|---|
| 1887 | | - ISP3X_RAWAWB_YUV_X1X2_DIS_1); |
|---|
| 1952 | + ISP3X_RAWAWB_YUV_X1X2_DIS_1, id); |
|---|
| 1888 | 1953 | |
|---|
| 1889 | 1954 | isp3_param_write(params_vdev, |
|---|
| 1890 | 1955 | ISP_PACK_4BYTE(arg->rotu2_ls1, arg->rotu3_ls1, |
|---|
| 1891 | 1956 | arg->rotu4_ls1, arg->rotu5_ls1), |
|---|
| 1892 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_UCOOR_1); |
|---|
| 1957 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_UCOOR_1, id); |
|---|
| 1893 | 1958 | |
|---|
| 1894 | 1959 | isp3_param_write(params_vdev, |
|---|
| 1895 | 1960 | ISP_PACK_2SHORT(arg->th0_ls1, arg->th1_ls1), |
|---|
| 1896 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_TH0_1); |
|---|
| 1961 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_TH0_1, id); |
|---|
| 1897 | 1962 | |
|---|
| 1898 | 1963 | isp3_param_write(params_vdev, |
|---|
| 1899 | 1964 | ISP_PACK_2SHORT(arg->th2_ls1, arg->th3_ls1), |
|---|
| 1900 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_TH1_1); |
|---|
| 1965 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_TH1_1, id); |
|---|
| 1901 | 1966 | |
|---|
| 1902 | 1967 | isp3_param_write(params_vdev, |
|---|
| 1903 | 1968 | ISP_PACK_2SHORT(arg->th4_ls1, arg->th5_ls1), |
|---|
| 1904 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_TH2_1); |
|---|
| 1969 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_TH2_1, id); |
|---|
| 1905 | 1970 | |
|---|
| 1906 | 1971 | isp3_param_write(params_vdev, |
|---|
| 1907 | 1972 | ISP_PACK_2SHORT(arg->coor_x1_ls2_y, arg->vec_x21_ls2_y), |
|---|
| 1908 | | - ISP3X_RAWAWB_YUV_X_COOR_Y_2); |
|---|
| 1973 | + ISP3X_RAWAWB_YUV_X_COOR_Y_2, id); |
|---|
| 1909 | 1974 | |
|---|
| 1910 | 1975 | isp3_param_write(params_vdev, |
|---|
| 1911 | 1976 | ISP_PACK_2SHORT(arg->coor_x1_ls2_u, arg->vec_x21_ls2_u), |
|---|
| 1912 | | - ISP3X_RAWAWB_YUV_X_COOR_U_2); |
|---|
| 1977 | + ISP3X_RAWAWB_YUV_X_COOR_U_2, id); |
|---|
| 1913 | 1978 | |
|---|
| 1914 | 1979 | isp3_param_write(params_vdev, |
|---|
| 1915 | 1980 | ISP_PACK_2SHORT(arg->coor_x1_ls2_v, arg->vec_x21_ls2_v), |
|---|
| 1916 | | - ISP3X_RAWAWB_YUV_X_COOR_V_2); |
|---|
| 1981 | + ISP3X_RAWAWB_YUV_X_COOR_V_2, id); |
|---|
| 1917 | 1982 | |
|---|
| 1918 | 1983 | isp3_param_write(params_vdev, |
|---|
| 1919 | 1984 | ISP_PACK_4BYTE(arg->dis_x1x2_ls2, 0, |
|---|
| 1920 | 1985 | arg->rotu0_ls2, arg->rotu1_ls2), |
|---|
| 1921 | | - ISP3X_RAWAWB_YUV_X1X2_DIS_2); |
|---|
| 1986 | + ISP3X_RAWAWB_YUV_X1X2_DIS_2, id); |
|---|
| 1922 | 1987 | |
|---|
| 1923 | 1988 | isp3_param_write(params_vdev, |
|---|
| 1924 | 1989 | ISP_PACK_4BYTE(arg->rotu2_ls2, arg->rotu3_ls2, |
|---|
| 1925 | 1990 | arg->rotu4_ls2, arg->rotu5_ls2), |
|---|
| 1926 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_UCOOR_2); |
|---|
| 1991 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_UCOOR_2, id); |
|---|
| 1927 | 1992 | |
|---|
| 1928 | 1993 | isp3_param_write(params_vdev, |
|---|
| 1929 | 1994 | ISP_PACK_2SHORT(arg->th0_ls2, arg->th1_ls2), |
|---|
| 1930 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_TH0_2); |
|---|
| 1995 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_TH0_2, id); |
|---|
| 1931 | 1996 | |
|---|
| 1932 | 1997 | isp3_param_write(params_vdev, |
|---|
| 1933 | 1998 | ISP_PACK_2SHORT(arg->th2_ls2, arg->th3_ls2), |
|---|
| 1934 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_TH1_2); |
|---|
| 1999 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_TH1_2, id); |
|---|
| 1935 | 2000 | |
|---|
| 1936 | 2001 | isp3_param_write(params_vdev, |
|---|
| 1937 | 2002 | ISP_PACK_2SHORT(arg->th4_ls2, arg->th5_ls2), |
|---|
| 1938 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_TH2_2); |
|---|
| 2003 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_TH2_2, id); |
|---|
| 1939 | 2004 | |
|---|
| 1940 | 2005 | isp3_param_write(params_vdev, |
|---|
| 1941 | 2006 | ISP_PACK_2SHORT(arg->coor_x1_ls3_y, |
|---|
| 1942 | 2007 | arg->vec_x21_ls3_y), |
|---|
| 1943 | | - ISP3X_RAWAWB_YUV_X_COOR_Y_3); |
|---|
| 2008 | + ISP3X_RAWAWB_YUV_X_COOR_Y_3, id); |
|---|
| 1944 | 2009 | |
|---|
| 1945 | 2010 | isp3_param_write(params_vdev, |
|---|
| 1946 | 2011 | ISP_PACK_2SHORT(arg->coor_x1_ls3_u, |
|---|
| 1947 | 2012 | arg->vec_x21_ls3_u), |
|---|
| 1948 | | - ISP3X_RAWAWB_YUV_X_COOR_U_3); |
|---|
| 2013 | + ISP3X_RAWAWB_YUV_X_COOR_U_3, id); |
|---|
| 1949 | 2014 | |
|---|
| 1950 | 2015 | isp3_param_write(params_vdev, |
|---|
| 1951 | 2016 | ISP_PACK_2SHORT(arg->coor_x1_ls3_v, |
|---|
| 1952 | 2017 | arg->vec_x21_ls3_v), |
|---|
| 1953 | | - ISP3X_RAWAWB_YUV_X_COOR_V_3); |
|---|
| 2018 | + ISP3X_RAWAWB_YUV_X_COOR_V_3, id); |
|---|
| 1954 | 2019 | |
|---|
| 1955 | 2020 | isp3_param_write(params_vdev, |
|---|
| 1956 | 2021 | ISP_PACK_4BYTE(arg->dis_x1x2_ls3, 0, |
|---|
| 1957 | 2022 | arg->rotu0_ls3, arg->rotu1_ls3), |
|---|
| 1958 | | - ISP3X_RAWAWB_YUV_X1X2_DIS_3); |
|---|
| 2023 | + ISP3X_RAWAWB_YUV_X1X2_DIS_3, id); |
|---|
| 1959 | 2024 | |
|---|
| 1960 | 2025 | isp3_param_write(params_vdev, |
|---|
| 1961 | 2026 | ISP_PACK_4BYTE(arg->rotu2_ls3, arg->rotu3_ls3, |
|---|
| 1962 | 2027 | arg->rotu4_ls3, arg->rotu5_ls3), |
|---|
| 1963 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_UCOOR_3); |
|---|
| 2028 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_UCOOR_3, id); |
|---|
| 1964 | 2029 | |
|---|
| 1965 | 2030 | isp3_param_write(params_vdev, |
|---|
| 1966 | 2031 | ISP_PACK_2SHORT(arg->th0_ls3, arg->th1_ls3), |
|---|
| 1967 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_TH0_3); |
|---|
| 2032 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_TH0_3, id); |
|---|
| 1968 | 2033 | |
|---|
| 1969 | 2034 | isp3_param_write(params_vdev, |
|---|
| 1970 | 2035 | ISP_PACK_2SHORT(arg->th2_ls3, arg->th3_ls3), |
|---|
| 1971 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_TH1_3); |
|---|
| 2036 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_TH1_3, id); |
|---|
| 1972 | 2037 | |
|---|
| 1973 | 2038 | isp3_param_write(params_vdev, |
|---|
| 1974 | 2039 | ISP_PACK_2SHORT(arg->th4_ls3, arg->th5_ls3), |
|---|
| 1975 | | - ISP3X_RAWAWB_YUV_INTERP_CURVE_TH2_3); |
|---|
| 2040 | + ISP3X_RAWAWB_YUV_INTERP_CURVE_TH2_3, id); |
|---|
| 1976 | 2041 | |
|---|
| 1977 | 2042 | isp3_param_write(params_vdev, |
|---|
| 1978 | 2043 | ISP_PACK_2SHORT(arg->wt0, arg->wt1), |
|---|
| 1979 | | - ISP3X_RAWAWB_RGB2XY_WT01); |
|---|
| 2044 | + ISP3X_RAWAWB_RGB2XY_WT01, id); |
|---|
| 1980 | 2045 | |
|---|
| 1981 | | - isp3_param_write(params_vdev, arg->wt2, |
|---|
| 1982 | | - ISP3X_RAWAWB_RGB2XY_WT2); |
|---|
| 2046 | + isp3_param_write(params_vdev, arg->wt2, ISP3X_RAWAWB_RGB2XY_WT2, id); |
|---|
| 1983 | 2047 | |
|---|
| 1984 | 2048 | isp3_param_write(params_vdev, |
|---|
| 1985 | 2049 | ISP_PACK_2SHORT(arg->mat0_x, arg->mat0_y), |
|---|
| 1986 | | - ISP3X_RAWAWB_RGB2XY_MAT0_XY); |
|---|
| 2050 | + ISP3X_RAWAWB_RGB2XY_MAT0_XY, id); |
|---|
| 1987 | 2051 | |
|---|
| 1988 | 2052 | isp3_param_write(params_vdev, |
|---|
| 1989 | 2053 | ISP_PACK_2SHORT(arg->mat1_x, arg->mat1_y), |
|---|
| 1990 | | - ISP3X_RAWAWB_RGB2XY_MAT1_XY); |
|---|
| 2054 | + ISP3X_RAWAWB_RGB2XY_MAT1_XY, id); |
|---|
| 1991 | 2055 | |
|---|
| 1992 | 2056 | isp3_param_write(params_vdev, |
|---|
| 1993 | 2057 | ISP_PACK_2SHORT(arg->mat2_x, arg->mat2_y), |
|---|
| 1994 | | - ISP3X_RAWAWB_RGB2XY_MAT2_XY); |
|---|
| 2058 | + ISP3X_RAWAWB_RGB2XY_MAT2_XY, id); |
|---|
| 1995 | 2059 | |
|---|
| 1996 | 2060 | isp3_param_write(params_vdev, |
|---|
| 1997 | 2061 | ISP_PACK_2SHORT(arg->nor_x0_0, arg->nor_x1_0), |
|---|
| 1998 | | - ISP3X_RAWAWB_XY_DETC_NOR_X_0); |
|---|
| 2062 | + ISP3X_RAWAWB_XY_DETC_NOR_X_0, id); |
|---|
| 1999 | 2063 | |
|---|
| 2000 | 2064 | isp3_param_write(params_vdev, |
|---|
| 2001 | 2065 | ISP_PACK_2SHORT(arg->nor_y0_0, arg->nor_y1_0), |
|---|
| 2002 | | - ISP3X_RAWAWB_XY_DETC_NOR_Y_0); |
|---|
| 2066 | + ISP3X_RAWAWB_XY_DETC_NOR_Y_0, id); |
|---|
| 2003 | 2067 | |
|---|
| 2004 | 2068 | isp3_param_write(params_vdev, |
|---|
| 2005 | 2069 | ISP_PACK_2SHORT(arg->big_x0_0, arg->big_x1_0), |
|---|
| 2006 | | - ISP3X_RAWAWB_XY_DETC_BIG_X_0); |
|---|
| 2070 | + ISP3X_RAWAWB_XY_DETC_BIG_X_0, id); |
|---|
| 2007 | 2071 | |
|---|
| 2008 | 2072 | isp3_param_write(params_vdev, |
|---|
| 2009 | 2073 | ISP_PACK_2SHORT(arg->big_y0_0, arg->big_y1_0), |
|---|
| 2010 | | - ISP3X_RAWAWB_XY_DETC_BIG_Y_0); |
|---|
| 2074 | + ISP3X_RAWAWB_XY_DETC_BIG_Y_0, id); |
|---|
| 2011 | 2075 | |
|---|
| 2012 | 2076 | isp3_param_write(params_vdev, |
|---|
| 2013 | 2077 | ISP_PACK_2SHORT(arg->nor_x0_1, arg->nor_x1_1), |
|---|
| 2014 | | - ISP3X_RAWAWB_XY_DETC_NOR_X_1); |
|---|
| 2078 | + ISP3X_RAWAWB_XY_DETC_NOR_X_1, id); |
|---|
| 2015 | 2079 | |
|---|
| 2016 | 2080 | isp3_param_write(params_vdev, |
|---|
| 2017 | 2081 | ISP_PACK_2SHORT(arg->nor_y0_1, arg->nor_y1_1), |
|---|
| 2018 | | - ISP3X_RAWAWB_XY_DETC_NOR_Y_1); |
|---|
| 2082 | + ISP3X_RAWAWB_XY_DETC_NOR_Y_1, id); |
|---|
| 2019 | 2083 | |
|---|
| 2020 | 2084 | isp3_param_write(params_vdev, |
|---|
| 2021 | 2085 | ISP_PACK_2SHORT(arg->big_x0_1, arg->big_x1_1), |
|---|
| 2022 | | - ISP3X_RAWAWB_XY_DETC_BIG_X_1); |
|---|
| 2086 | + ISP3X_RAWAWB_XY_DETC_BIG_X_1, id); |
|---|
| 2023 | 2087 | |
|---|
| 2024 | 2088 | isp3_param_write(params_vdev, |
|---|
| 2025 | 2089 | ISP_PACK_2SHORT(arg->big_y0_1, arg->big_y1_1), |
|---|
| 2026 | | - ISP3X_RAWAWB_XY_DETC_BIG_Y_1); |
|---|
| 2090 | + ISP3X_RAWAWB_XY_DETC_BIG_Y_1, id); |
|---|
| 2027 | 2091 | |
|---|
| 2028 | 2092 | isp3_param_write(params_vdev, |
|---|
| 2029 | 2093 | ISP_PACK_2SHORT(arg->nor_x0_2, arg->nor_x1_2), |
|---|
| 2030 | | - ISP3X_RAWAWB_XY_DETC_NOR_X_2); |
|---|
| 2094 | + ISP3X_RAWAWB_XY_DETC_NOR_X_2, id); |
|---|
| 2031 | 2095 | |
|---|
| 2032 | 2096 | isp3_param_write(params_vdev, |
|---|
| 2033 | 2097 | ISP_PACK_2SHORT(arg->nor_y0_2, arg->nor_y1_2), |
|---|
| 2034 | | - ISP3X_RAWAWB_XY_DETC_NOR_Y_2); |
|---|
| 2098 | + ISP3X_RAWAWB_XY_DETC_NOR_Y_2, id); |
|---|
| 2035 | 2099 | |
|---|
| 2036 | 2100 | isp3_param_write(params_vdev, |
|---|
| 2037 | 2101 | ISP_PACK_2SHORT(arg->big_x0_2, arg->big_x1_2), |
|---|
| 2038 | | - ISP3X_RAWAWB_XY_DETC_BIG_X_2); |
|---|
| 2102 | + ISP3X_RAWAWB_XY_DETC_BIG_X_2, id); |
|---|
| 2039 | 2103 | |
|---|
| 2040 | 2104 | isp3_param_write(params_vdev, |
|---|
| 2041 | 2105 | ISP_PACK_2SHORT(arg->big_y0_2, arg->big_y1_2), |
|---|
| 2042 | | - ISP3X_RAWAWB_XY_DETC_BIG_Y_2); |
|---|
| 2106 | + ISP3X_RAWAWB_XY_DETC_BIG_Y_2, id); |
|---|
| 2043 | 2107 | |
|---|
| 2044 | 2108 | isp3_param_write(params_vdev, |
|---|
| 2045 | 2109 | ISP_PACK_2SHORT(arg->nor_x0_3, arg->nor_x1_3), |
|---|
| 2046 | | - ISP3X_RAWAWB_XY_DETC_NOR_X_3); |
|---|
| 2110 | + ISP3X_RAWAWB_XY_DETC_NOR_X_3, id); |
|---|
| 2047 | 2111 | |
|---|
| 2048 | 2112 | isp3_param_write(params_vdev, |
|---|
| 2049 | 2113 | ISP_PACK_2SHORT(arg->nor_y0_3, arg->nor_y1_3), |
|---|
| 2050 | | - ISP3X_RAWAWB_XY_DETC_NOR_Y_3); |
|---|
| 2114 | + ISP3X_RAWAWB_XY_DETC_NOR_Y_3, id); |
|---|
| 2051 | 2115 | |
|---|
| 2052 | 2116 | isp3_param_write(params_vdev, |
|---|
| 2053 | 2117 | ISP_PACK_2SHORT(arg->big_x0_3, arg->big_x1_3), |
|---|
| 2054 | | - ISP3X_RAWAWB_XY_DETC_BIG_X_3); |
|---|
| 2118 | + ISP3X_RAWAWB_XY_DETC_BIG_X_3, id); |
|---|
| 2055 | 2119 | |
|---|
| 2056 | 2120 | isp3_param_write(params_vdev, |
|---|
| 2057 | 2121 | ISP_PACK_2SHORT(arg->big_y0_3, arg->big_y1_3), |
|---|
| 2058 | | - ISP3X_RAWAWB_XY_DETC_BIG_Y_3); |
|---|
| 2122 | + ISP3X_RAWAWB_XY_DETC_BIG_Y_3, id); |
|---|
| 2059 | 2123 | |
|---|
| 2060 | 2124 | value = (arg->exc_wp_region0_excen & 0x3) | |
|---|
| 2061 | 2125 | !!arg->exc_wp_region0_measen << 2 | |
|---|
| .. | .. |
|---|
| 2076 | 2140 | (arg->exc_wp_region6_excen & 0x3) << 24 | |
|---|
| 2077 | 2141 | !!arg->exc_wp_region6_domain << 27 | |
|---|
| 2078 | 2142 | !!arg->multiwindow_en << 31; |
|---|
| 2079 | | - isp3_param_write(params_vdev, value, ISP3X_RAWAWB_MULTIWINDOW_EXC_CTRL); |
|---|
| 2143 | + isp3_param_write(params_vdev, value, ISP3X_RAWAWB_MULTIWINDOW_EXC_CTRL, id); |
|---|
| 2080 | 2144 | |
|---|
| 2081 | 2145 | isp3_param_write(params_vdev, |
|---|
| 2082 | 2146 | ISP_PACK_2SHORT(arg->multiwindow0_h_offs, |
|---|
| 2083 | 2147 | arg->multiwindow0_v_offs), |
|---|
| 2084 | | - ISP3X_RAWAWB_MULTIWINDOW0_OFFS); |
|---|
| 2148 | + ISP3X_RAWAWB_MULTIWINDOW0_OFFS, id); |
|---|
| 2085 | 2149 | isp3_param_write(params_vdev, |
|---|
| 2086 | 2150 | ISP_PACK_2SHORT(arg->multiwindow0_h_size, |
|---|
| 2087 | 2151 | arg->multiwindow0_v_size), |
|---|
| 2088 | | - ISP3X_RAWAWB_MULTIWINDOW0_SIZE); |
|---|
| 2152 | + ISP3X_RAWAWB_MULTIWINDOW0_SIZE, id); |
|---|
| 2089 | 2153 | isp3_param_write(params_vdev, |
|---|
| 2090 | 2154 | ISP_PACK_2SHORT(arg->multiwindow1_h_offs, |
|---|
| 2091 | 2155 | arg->multiwindow1_v_offs), |
|---|
| 2092 | | - ISP3X_RAWAWB_MULTIWINDOW1_OFFS); |
|---|
| 2156 | + ISP3X_RAWAWB_MULTIWINDOW1_OFFS, id); |
|---|
| 2093 | 2157 | isp3_param_write(params_vdev, |
|---|
| 2094 | 2158 | ISP_PACK_2SHORT(arg->multiwindow1_h_size, |
|---|
| 2095 | 2159 | arg->multiwindow1_v_size), |
|---|
| 2096 | | - ISP3X_RAWAWB_MULTIWINDOW1_SIZE); |
|---|
| 2160 | + ISP3X_RAWAWB_MULTIWINDOW1_SIZE, id); |
|---|
| 2097 | 2161 | isp3_param_write(params_vdev, |
|---|
| 2098 | 2162 | ISP_PACK_2SHORT(arg->multiwindow2_h_offs, |
|---|
| 2099 | 2163 | arg->multiwindow2_v_offs), |
|---|
| 2100 | | - ISP3X_RAWAWB_MULTIWINDOW2_OFFS); |
|---|
| 2164 | + ISP3X_RAWAWB_MULTIWINDOW2_OFFS, id); |
|---|
| 2101 | 2165 | isp3_param_write(params_vdev, |
|---|
| 2102 | 2166 | ISP_PACK_2SHORT(arg->multiwindow2_h_size, |
|---|
| 2103 | 2167 | arg->multiwindow2_v_size), |
|---|
| 2104 | | - ISP3X_RAWAWB_MULTIWINDOW2_SIZE); |
|---|
| 2168 | + ISP3X_RAWAWB_MULTIWINDOW2_SIZE, id); |
|---|
| 2105 | 2169 | isp3_param_write(params_vdev, |
|---|
| 2106 | 2170 | ISP_PACK_2SHORT(arg->multiwindow3_h_offs, |
|---|
| 2107 | 2171 | arg->multiwindow3_v_offs), |
|---|
| 2108 | | - ISP3X_RAWAWB_MULTIWINDOW3_OFFS); |
|---|
| 2172 | + ISP3X_RAWAWB_MULTIWINDOW3_OFFS, id); |
|---|
| 2109 | 2173 | isp3_param_write(params_vdev, |
|---|
| 2110 | 2174 | ISP_PACK_2SHORT(arg->multiwindow3_h_size, |
|---|
| 2111 | 2175 | arg->multiwindow3_v_size), |
|---|
| 2112 | | - ISP3X_RAWAWB_MULTIWINDOW3_SIZE); |
|---|
| 2176 | + ISP3X_RAWAWB_MULTIWINDOW3_SIZE, id); |
|---|
| 2113 | 2177 | |
|---|
| 2114 | 2178 | isp3_param_write(params_vdev, |
|---|
| 2115 | 2179 | ISP_PACK_2SHORT(arg->exc_wp_region0_xu0, |
|---|
| 2116 | 2180 | arg->exc_wp_region0_xu1), |
|---|
| 2117 | | - ISP3X_RAWAWB_EXC_WP_REGION0_XU); |
|---|
| 2181 | + ISP3X_RAWAWB_EXC_WP_REGION0_XU, id); |
|---|
| 2118 | 2182 | |
|---|
| 2119 | 2183 | isp3_param_write(params_vdev, |
|---|
| 2120 | 2184 | ISP_PACK_2SHORT(arg->exc_wp_region0_yv0, |
|---|
| 2121 | 2185 | arg->exc_wp_region0_yv1), |
|---|
| 2122 | | - ISP3X_RAWAWB_EXC_WP_REGION0_YV); |
|---|
| 2186 | + ISP3X_RAWAWB_EXC_WP_REGION0_YV, id); |
|---|
| 2123 | 2187 | |
|---|
| 2124 | 2188 | isp3_param_write(params_vdev, |
|---|
| 2125 | 2189 | ISP_PACK_2SHORT(arg->exc_wp_region1_xu0, |
|---|
| 2126 | 2190 | arg->exc_wp_region1_xu1), |
|---|
| 2127 | | - ISP3X_RAWAWB_EXC_WP_REGION1_XU); |
|---|
| 2191 | + ISP3X_RAWAWB_EXC_WP_REGION1_XU, id); |
|---|
| 2128 | 2192 | |
|---|
| 2129 | 2193 | isp3_param_write(params_vdev, |
|---|
| 2130 | 2194 | ISP_PACK_2SHORT(arg->exc_wp_region1_yv0, |
|---|
| 2131 | 2195 | arg->exc_wp_region1_yv1), |
|---|
| 2132 | | - ISP3X_RAWAWB_EXC_WP_REGION1_YV); |
|---|
| 2196 | + ISP3X_RAWAWB_EXC_WP_REGION1_YV, id); |
|---|
| 2133 | 2197 | |
|---|
| 2134 | 2198 | isp3_param_write(params_vdev, |
|---|
| 2135 | 2199 | ISP_PACK_2SHORT(arg->exc_wp_region2_xu0, |
|---|
| 2136 | 2200 | arg->exc_wp_region2_xu1), |
|---|
| 2137 | | - ISP3X_RAWAWB_EXC_WP_REGION2_XU); |
|---|
| 2201 | + ISP3X_RAWAWB_EXC_WP_REGION2_XU, id); |
|---|
| 2138 | 2202 | |
|---|
| 2139 | 2203 | isp3_param_write(params_vdev, |
|---|
| 2140 | 2204 | ISP_PACK_2SHORT(arg->exc_wp_region2_yv0, |
|---|
| 2141 | 2205 | arg->exc_wp_region2_yv1), |
|---|
| 2142 | | - ISP3X_RAWAWB_EXC_WP_REGION2_YV); |
|---|
| 2206 | + ISP3X_RAWAWB_EXC_WP_REGION2_YV, id); |
|---|
| 2143 | 2207 | |
|---|
| 2144 | 2208 | isp3_param_write(params_vdev, |
|---|
| 2145 | 2209 | ISP_PACK_2SHORT(arg->exc_wp_region3_xu0, |
|---|
| 2146 | 2210 | arg->exc_wp_region3_xu1), |
|---|
| 2147 | | - ISP3X_RAWAWB_EXC_WP_REGION3_XU); |
|---|
| 2211 | + ISP3X_RAWAWB_EXC_WP_REGION3_XU, id); |
|---|
| 2148 | 2212 | |
|---|
| 2149 | 2213 | isp3_param_write(params_vdev, |
|---|
| 2150 | 2214 | ISP_PACK_2SHORT(arg->exc_wp_region3_yv0, |
|---|
| 2151 | 2215 | arg->exc_wp_region3_yv1), |
|---|
| 2152 | | - ISP3X_RAWAWB_EXC_WP_REGION3_YV); |
|---|
| 2216 | + ISP3X_RAWAWB_EXC_WP_REGION3_YV, id); |
|---|
| 2153 | 2217 | |
|---|
| 2154 | 2218 | isp3_param_write(params_vdev, |
|---|
| 2155 | 2219 | ISP_PACK_2SHORT(arg->exc_wp_region4_xu0, |
|---|
| 2156 | 2220 | arg->exc_wp_region4_xu1), |
|---|
| 2157 | | - ISP3X_RAWAWB_EXC_WP_REGION4_XU); |
|---|
| 2221 | + ISP3X_RAWAWB_EXC_WP_REGION4_XU, id); |
|---|
| 2158 | 2222 | |
|---|
| 2159 | 2223 | isp3_param_write(params_vdev, |
|---|
| 2160 | 2224 | ISP_PACK_2SHORT(arg->exc_wp_region4_yv0, |
|---|
| 2161 | 2225 | arg->exc_wp_region4_yv1), |
|---|
| 2162 | | - ISP3X_RAWAWB_EXC_WP_REGION4_YV); |
|---|
| 2226 | + ISP3X_RAWAWB_EXC_WP_REGION4_YV, id); |
|---|
| 2163 | 2227 | |
|---|
| 2164 | 2228 | isp3_param_write(params_vdev, |
|---|
| 2165 | 2229 | ISP_PACK_2SHORT(arg->exc_wp_region5_xu0, |
|---|
| 2166 | 2230 | arg->exc_wp_region5_xu1), |
|---|
| 2167 | | - ISP3X_RAWAWB_EXC_WP_REGION5_XU); |
|---|
| 2231 | + ISP3X_RAWAWB_EXC_WP_REGION5_XU, id); |
|---|
| 2168 | 2232 | |
|---|
| 2169 | 2233 | isp3_param_write(params_vdev, |
|---|
| 2170 | 2234 | ISP_PACK_2SHORT(arg->exc_wp_region5_yv0, |
|---|
| 2171 | 2235 | arg->exc_wp_region5_yv1), |
|---|
| 2172 | | - ISP3X_RAWAWB_EXC_WP_REGION5_YV); |
|---|
| 2236 | + ISP3X_RAWAWB_EXC_WP_REGION5_YV, id); |
|---|
| 2173 | 2237 | |
|---|
| 2174 | 2238 | isp3_param_write(params_vdev, |
|---|
| 2175 | 2239 | ISP_PACK_2SHORT(arg->exc_wp_region6_xu0, |
|---|
| 2176 | 2240 | arg->exc_wp_region6_xu1), |
|---|
| 2177 | | - ISP3X_RAWAWB_EXC_WP_REGION6_XU); |
|---|
| 2241 | + ISP3X_RAWAWB_EXC_WP_REGION6_XU, id); |
|---|
| 2178 | 2242 | |
|---|
| 2179 | 2243 | isp3_param_write(params_vdev, |
|---|
| 2180 | 2244 | ISP_PACK_2SHORT(arg->exc_wp_region6_yv0, |
|---|
| 2181 | 2245 | arg->exc_wp_region6_yv1), |
|---|
| 2182 | | - ISP3X_RAWAWB_EXC_WP_REGION6_YV); |
|---|
| 2246 | + ISP3X_RAWAWB_EXC_WP_REGION6_YV, id); |
|---|
| 2183 | 2247 | |
|---|
| 2184 | 2248 | isp3_param_write(params_vdev, |
|---|
| 2185 | 2249 | ISP_PACK_4BYTE(arg->exc_wp_region0_weight, |
|---|
| 2186 | 2250 | arg->exc_wp_region1_weight, |
|---|
| 2187 | 2251 | arg->exc_wp_region2_weight, |
|---|
| 2188 | 2252 | arg->exc_wp_region3_weight), |
|---|
| 2189 | | - ISP32_RAWAWB_EXC_WP_WEIGHT0_3); |
|---|
| 2253 | + ISP32_RAWAWB_EXC_WP_WEIGHT0_3, id); |
|---|
| 2190 | 2254 | |
|---|
| 2191 | 2255 | isp3_param_write(params_vdev, |
|---|
| 2192 | 2256 | ISP_PACK_4BYTE(arg->exc_wp_region4_weight, |
|---|
| 2193 | 2257 | arg->exc_wp_region5_weight, |
|---|
| 2194 | 2258 | arg->exc_wp_region6_weight, 0), |
|---|
| 2195 | | - ISP32_RAWAWB_EXC_WP_WEIGHT4_6); |
|---|
| 2259 | + ISP32_RAWAWB_EXC_WP_WEIGHT4_6, id); |
|---|
| 2196 | 2260 | |
|---|
| 2197 | 2261 | if (params_vdev->dev->isp_ver == ISP_V32) { |
|---|
| 2198 | 2262 | if (params_vdev->dev->hw_dev->is_single) |
|---|
| 2199 | | - isp_rawawb_cfg_sram(params_vdev, arg, false); |
|---|
| 2200 | | - else |
|---|
| 2201 | | - memcpy(arg_rec->wp_blk_wei_w, arg->wp_blk_wei_w, |
|---|
| 2202 | | - ISP32_RAWAWB_WEIGHT_NUM); |
|---|
| 2263 | + isp_rawawb_cfg_sram(params_vdev, arg, false, id); |
|---|
| 2264 | + memcpy(arg_rec->wp_blk_wei_w, arg->wp_blk_wei_w, ISP32_RAWAWB_WEIGHT_NUM); |
|---|
| 2203 | 2265 | } else { |
|---|
| 2204 | 2266 | for (i = 0; i < ISP32L_RAWAWB_WEIGHT_NUM; i++) |
|---|
| 2205 | 2267 | isp3_param_write(params_vdev, arg->win_weight[i], |
|---|
| 2206 | | - ISP32L_RAWAWB_WIN_WEIGHT_0 + i * 4); |
|---|
| 2268 | + ISP32L_RAWAWB_WIN_WEIGHT_0 + i * 4, id); |
|---|
| 2207 | 2269 | } |
|---|
| 2208 | 2270 | |
|---|
| 2209 | 2271 | /* avoid to override the old enable value */ |
|---|
| 2210 | | - value = isp3_param_read_cache(params_vdev, ISP3X_RAWAWB_CTRL); |
|---|
| 2272 | + value = isp3_param_read_cache(params_vdev, ISP3X_RAWAWB_CTRL, id); |
|---|
| 2211 | 2273 | value &= (ISP32_MODULE_EN | |
|---|
| 2212 | 2274 | ISP32_RAWAWB_2DDR_PATH_EN | |
|---|
| 2213 | 2275 | ISP32_RAWAWB_2DDR_PATH_DS); |
|---|
| .. | .. |
|---|
| 2227 | 2289 | !!arg->yuv3d_en0 << 3 | |
|---|
| 2228 | 2290 | !!arg->xy_en0 << 2 | |
|---|
| 2229 | 2291 | !!arg->uv_en0 << 1; |
|---|
| 2230 | | - isp3_param_write(params_vdev, value, ISP3X_RAWAWB_CTRL); |
|---|
| 2292 | + isp3_param_write(params_vdev, value, ISP3X_RAWAWB_CTRL, id); |
|---|
| 2231 | 2293 | |
|---|
| 2232 | 2294 | mask = ISP32_DRC2AWB_SEL | ISP32_BNR2AWB_SEL | ISP3X_RAWAWB_SEL(3); |
|---|
| 2233 | 2295 | val = ISP3X_RAWAWB_SEL(arg->rawawb_sel) | |
|---|
| 2234 | 2296 | (arg->bnr2awb_sel & 0x1) << 26 | (arg->drc2awb_sel & 0x1) << 27; |
|---|
| 2235 | | - value = isp3_param_read(params_vdev, ISP3X_VI_ISP_PATH); |
|---|
| 2297 | + value = isp3_param_read(params_vdev, ISP3X_VI_ISP_PATH, id); |
|---|
| 2236 | 2298 | if ((value & mask) != val) { |
|---|
| 2237 | 2299 | value &= ~mask; |
|---|
| 2238 | 2300 | value |= val; |
|---|
| 2239 | | - isp3_param_write(params_vdev, value, ISP3X_VI_ISP_PATH); |
|---|
| 2301 | + isp3_param_write(params_vdev, value, ISP3X_VI_ISP_PATH, id); |
|---|
| 2240 | 2302 | } |
|---|
| 2241 | 2303 | } |
|---|
| 2242 | 2304 | |
|---|
| 2243 | 2305 | static void |
|---|
| 2244 | | -isp_rawawb_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 2306 | +isp_rawawb_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 2245 | 2307 | { |
|---|
| 2246 | 2308 | u32 awb_ctrl; |
|---|
| 2247 | 2309 | |
|---|
| 2248 | | - awb_ctrl = isp3_param_read_cache(params_vdev, ISP3X_RAWAWB_CTRL); |
|---|
| 2310 | + awb_ctrl = isp3_param_read_cache(params_vdev, ISP3X_RAWAWB_CTRL, id); |
|---|
| 2249 | 2311 | awb_ctrl &= ~ISP32_REG_WR_MASK; |
|---|
| 2250 | 2312 | if (en) |
|---|
| 2251 | 2313 | awb_ctrl |= ISP32_MODULE_EN; |
|---|
| 2252 | 2314 | else |
|---|
| 2253 | 2315 | awb_ctrl &= ~ISP32_MODULE_EN; |
|---|
| 2254 | 2316 | |
|---|
| 2255 | | - isp3_param_write(params_vdev, awb_ctrl, ISP3X_RAWAWB_CTRL); |
|---|
| 2317 | + isp3_param_write(params_vdev, awb_ctrl, ISP3X_RAWAWB_CTRL, id); |
|---|
| 2256 | 2318 | } |
|---|
| 2257 | 2319 | |
|---|
| 2258 | 2320 | static void |
|---|
| 2259 | 2321 | isp_rawhstlite_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 2260 | | - const struct isp2x_rawhistlite_cfg *arg) |
|---|
| 2322 | + const struct isp2x_rawhistlite_cfg *arg, u32 id) |
|---|
| 2261 | 2323 | { |
|---|
| 2262 | | - u32 i; |
|---|
| 2263 | | - u32 value; |
|---|
| 2264 | | - u32 hist_ctrl; |
|---|
| 2265 | | - u32 block_hsize, block_vsize; |
|---|
| 2324 | + struct rkisp_device *ispdev = params_vdev->dev; |
|---|
| 2325 | + struct v4l2_rect *out_crop = &ispdev->isp_sdev.out_crop; |
|---|
| 2326 | + u32 width = out_crop->width, height = out_crop->height; |
|---|
| 2327 | + u32 i, value, hist_ctrl, block_hsize, block_vsize; |
|---|
| 2328 | + u32 h_size, v_size, h_offs, v_offs; |
|---|
| 2266 | 2329 | |
|---|
| 2267 | 2330 | /* avoid to override the old enable value */ |
|---|
| 2268 | | - hist_ctrl = isp3_param_read(params_vdev, ISP3X_RAWHIST_LITE_CTRL); |
|---|
| 2331 | + hist_ctrl = isp3_param_read(params_vdev, ISP3X_RAWHIST_LITE_CTRL, id); |
|---|
| 2269 | 2332 | hist_ctrl &= ISP3X_RAWHIST_EN; |
|---|
| 2270 | 2333 | hist_ctrl = hist_ctrl | |
|---|
| 2271 | 2334 | ISP3X_RAWHIST_MODE(arg->mode) | |
|---|
| .. | .. |
|---|
| 2273 | 2336 | if (params_vdev->dev->isp_ver == ISP_V32) |
|---|
| 2274 | 2337 | hist_ctrl |= ISP3X_RAWHIST_DATASEL(arg->data_sel) | |
|---|
| 2275 | 2338 | ISP3X_RAWHIST_WATERLINE(arg->waterline); |
|---|
| 2276 | | - isp3_param_write(params_vdev, hist_ctrl, ISP3X_RAWHIST_LITE_CTRL); |
|---|
| 2339 | + isp3_param_write(params_vdev, hist_ctrl, ISP3X_RAWHIST_LITE_CTRL, id); |
|---|
| 2277 | 2340 | |
|---|
| 2341 | + h_offs = arg->win.h_offs & ~0x1; |
|---|
| 2342 | + v_offs = arg->win.v_offs & ~0x1; |
|---|
| 2278 | 2343 | isp3_param_write(params_vdev, |
|---|
| 2279 | | - ISP_PACK_2SHORT(arg->win.h_offs, arg->win.v_offs), |
|---|
| 2280 | | - ISP3X_RAWHIST_LITE_OFFS); |
|---|
| 2344 | + ISP_PACK_2SHORT(h_offs, v_offs), |
|---|
| 2345 | + ISP3X_RAWHIST_LITE_OFFS, id); |
|---|
| 2281 | 2346 | |
|---|
| 2282 | | - block_hsize = arg->win.h_size / ISP32_RAWHISTLITE_ROW_NUM - 1; |
|---|
| 2283 | | - block_vsize = arg->win.v_size / ISP32_RAWHISTLITE_COLUMN_NUM - 1; |
|---|
| 2284 | | - block_hsize &= 0xFFFE; |
|---|
| 2285 | | - block_vsize &= 0xFFFE; |
|---|
| 2347 | + if (ispdev->hw_dev->unite) |
|---|
| 2348 | + width = width / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL; |
|---|
| 2349 | + h_size = arg->win.h_size; |
|---|
| 2350 | + v_size = arg->win.v_size; |
|---|
| 2351 | + if (!h_size || h_size + h_offs + 1 > width) |
|---|
| 2352 | + h_size = width - h_offs - 1; |
|---|
| 2353 | + if (!v_size || v_size + v_offs + 1 > height) |
|---|
| 2354 | + v_size = height - v_offs - 1; |
|---|
| 2355 | + block_hsize = (h_size / ISP32_RAWHISTLITE_ROW_NUM) & ~0x1; |
|---|
| 2356 | + block_vsize = (v_size / ISP32_RAWHISTLITE_COLUMN_NUM) & ~0x1; |
|---|
| 2286 | 2357 | isp3_param_write(params_vdev, |
|---|
| 2287 | 2358 | ISP_PACK_2SHORT(block_hsize, block_vsize), |
|---|
| 2288 | | - ISP3X_RAWHIST_LITE_SIZE); |
|---|
| 2359 | + ISP3X_RAWHIST_LITE_SIZE, id); |
|---|
| 2289 | 2360 | |
|---|
| 2290 | 2361 | isp3_param_write(params_vdev, |
|---|
| 2291 | 2362 | ISP_PACK_4BYTE(arg->rcc, arg->gcc, arg->bcc, arg->off), |
|---|
| 2292 | | - ISP3X_RAWHIST_LITE_RAW2Y_CC); |
|---|
| 2363 | + ISP3X_RAWHIST_LITE_RAW2Y_CC, id); |
|---|
| 2293 | 2364 | |
|---|
| 2294 | 2365 | for (i = 0; i < (ISP32_RAWHISTLITE_WEIGHT_REG_SIZE / 4); i++) { |
|---|
| 2295 | 2366 | value = ISP_PACK_4BYTE(arg->weight[4 * i + 0], |
|---|
| .. | .. |
|---|
| 2297 | 2368 | arg->weight[4 * i + 2], |
|---|
| 2298 | 2369 | arg->weight[4 * i + 3]); |
|---|
| 2299 | 2370 | isp3_param_write(params_vdev, value, |
|---|
| 2300 | | - ISP3X_RAWHIST_LITE_WEIGHT + 4 * i); |
|---|
| 2371 | + ISP3X_RAWHIST_LITE_WEIGHT + 4 * i, id); |
|---|
| 2301 | 2372 | } |
|---|
| 2302 | 2373 | |
|---|
| 2303 | 2374 | value = ISP_PACK_4BYTE(arg->weight[4 * i + 0], 0, 0, 0); |
|---|
| 2304 | 2375 | isp3_param_write(params_vdev, value, |
|---|
| 2305 | | - ISP3X_RAWHIST_LITE_WEIGHT + 4 * i); |
|---|
| 2376 | + ISP3X_RAWHIST_LITE_WEIGHT + 4 * i, id); |
|---|
| 2306 | 2377 | } |
|---|
| 2307 | 2378 | |
|---|
| 2308 | 2379 | static void |
|---|
| 2309 | | -isp_rawhstlite_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 2380 | +isp_rawhstlite_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 2310 | 2381 | { |
|---|
| 2311 | 2382 | u32 hist_ctrl; |
|---|
| 2312 | 2383 | |
|---|
| 2313 | | - hist_ctrl = isp3_param_read(params_vdev, ISP3X_RAWHIST_LITE_CTRL); |
|---|
| 2384 | + hist_ctrl = isp3_param_read(params_vdev, ISP3X_RAWHIST_LITE_CTRL, id); |
|---|
| 2314 | 2385 | hist_ctrl &= ~(ISP32_MODULE_EN | ISP32_REG_WR_MASK); |
|---|
| 2315 | 2386 | |
|---|
| 2316 | 2387 | if (en) |
|---|
| 2317 | 2388 | hist_ctrl |= ISP32_MODULE_EN; |
|---|
| 2318 | 2389 | |
|---|
| 2319 | | - isp3_param_write(params_vdev, hist_ctrl, ISP3X_RAWHIST_LITE_CTRL); |
|---|
| 2390 | + isp3_param_write(params_vdev, hist_ctrl, ISP3X_RAWHIST_LITE_CTRL, id); |
|---|
| 2320 | 2391 | } |
|---|
| 2321 | 2392 | |
|---|
| 2322 | 2393 | static void |
|---|
| 2323 | 2394 | isp_rawhstbig_cfg_sram(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 2324 | 2395 | const struct isp2x_rawhistbig_cfg *arg, |
|---|
| 2325 | | - u32 blk_no, bool is_check) |
|---|
| 2396 | + u32 blk_no, bool is_check, u32 id) |
|---|
| 2326 | 2397 | { |
|---|
| 2327 | 2398 | u32 i, j, wnd_num_idx, value; |
|---|
| 2328 | 2399 | u8 weight15x15[ISP32_RAWHISTBIG_WEIGHT_REG_SIZE]; |
|---|
| .. | .. |
|---|
| 2344 | 2415 | |
|---|
| 2345 | 2416 | value = ISP3X_RAWHIST_EN; |
|---|
| 2346 | 2417 | if (is_check && |
|---|
| 2347 | | - !(isp3_param_read(params_vdev, addr + ISP3X_RAWHIST_BIG_CTRL) & value)) |
|---|
| 2418 | + !(isp3_param_read(params_vdev, addr + ISP3X_RAWHIST_BIG_CTRL, id) & value)) |
|---|
| 2348 | 2419 | return; |
|---|
| 2349 | 2420 | |
|---|
| 2350 | 2421 | wnd_num_idx = arg->wnd_num; |
|---|
| 2422 | + if (wnd_num_idx >= ARRAY_SIZE(hist_wnd_num)) { |
|---|
| 2423 | + wnd_num_idx = ARRAY_SIZE(hist_wnd_num) - 1; |
|---|
| 2424 | + dev_err(params_vdev->dev->dev, |
|---|
| 2425 | + "%s invalid wnd_num:%d, set to %d\n", |
|---|
| 2426 | + __func__, arg->wnd_num, wnd_num_idx); |
|---|
| 2427 | + } |
|---|
| 2351 | 2428 | memset(weight15x15, 0, sizeof(weight15x15)); |
|---|
| 2352 | 2429 | for (i = 0; i < hist_wnd_num[wnd_num_idx]; i++) { |
|---|
| 2353 | 2430 | for (j = 0; j < hist_wnd_num[wnd_num_idx]; j++) { |
|---|
| .. | .. |
|---|
| 2369 | 2446 | |
|---|
| 2370 | 2447 | static void |
|---|
| 2371 | 2448 | isp_rawhstbig_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 2372 | | - const struct isp2x_rawhistbig_cfg *arg, u32 blk_no) |
|---|
| 2449 | + const struct isp2x_rawhistbig_cfg *arg, u32 blk_no, u32 id) |
|---|
| 2373 | 2450 | { |
|---|
| 2374 | | - struct isp32_isp_params_cfg *params_rec = params_vdev->isp32_params; |
|---|
| 2451 | + struct isp32_isp_params_cfg *params_rec = params_vdev->isp32_params + id; |
|---|
| 2375 | 2452 | struct rkisp_device *dev = params_vdev->dev; |
|---|
| 2453 | + struct v4l2_rect *out_crop = &dev->isp_sdev.out_crop; |
|---|
| 2454 | + u32 width = out_crop->width, height = out_crop->height; |
|---|
| 2376 | 2455 | struct isp2x_rawhistbig_cfg *arg_rec; |
|---|
| 2377 | 2456 | u32 hist_ctrl, block_hsize, block_vsize, wnd_num_idx; |
|---|
| 2378 | 2457 | const u32 hist_wnd_num[] = {5, 5, 15, 15}; |
|---|
| 2458 | + u32 h_size, v_size, h_offs, v_offs; |
|---|
| 2379 | 2459 | u32 addr; |
|---|
| 2380 | 2460 | |
|---|
| 2381 | 2461 | switch (blk_no) { |
|---|
| .. | .. |
|---|
| 2395 | 2475 | } |
|---|
| 2396 | 2476 | |
|---|
| 2397 | 2477 | wnd_num_idx = arg->wnd_num; |
|---|
| 2478 | + if (wnd_num_idx >= ARRAY_SIZE(hist_wnd_num)) { |
|---|
| 2479 | + wnd_num_idx = ARRAY_SIZE(hist_wnd_num) - 1; |
|---|
| 2480 | + dev_err(params_vdev->dev->dev, |
|---|
| 2481 | + "%s invalid wnd_num:%d, set to %d\n", |
|---|
| 2482 | + __func__, arg->wnd_num, wnd_num_idx); |
|---|
| 2483 | + } |
|---|
| 2398 | 2484 | /* avoid to override the old enable value */ |
|---|
| 2399 | | - hist_ctrl = isp3_param_read(params_vdev, addr + ISP3X_RAWHIST_BIG_CTRL); |
|---|
| 2485 | + hist_ctrl = isp3_param_read(params_vdev, addr + ISP3X_RAWHIST_BIG_CTRL, id); |
|---|
| 2400 | 2486 | hist_ctrl &= ISP3X_RAWHIST_EN; |
|---|
| 2401 | 2487 | hist_ctrl = hist_ctrl | |
|---|
| 2402 | 2488 | ISP3X_RAWHIST_MODE(arg->mode) | |
|---|
| .. | .. |
|---|
| 2405 | 2491 | if (params_vdev->dev->isp_ver == ISP_V32) |
|---|
| 2406 | 2492 | hist_ctrl |= ISP3X_RAWHIST_DATASEL(arg->data_sel) | |
|---|
| 2407 | 2493 | ISP3X_RAWHIST_WATERLINE(arg->waterline); |
|---|
| 2408 | | - isp3_param_write(params_vdev, hist_ctrl, addr + ISP3X_RAWHIST_BIG_CTRL); |
|---|
| 2494 | + isp3_param_write(params_vdev, hist_ctrl, addr + ISP3X_RAWHIST_BIG_CTRL, id); |
|---|
| 2409 | 2495 | |
|---|
| 2496 | + h_offs = arg->win.h_offs & ~0x1; |
|---|
| 2497 | + v_offs = arg->win.v_offs & ~0x1; |
|---|
| 2410 | 2498 | isp3_param_write(params_vdev, |
|---|
| 2411 | | - ISP_PACK_2SHORT(arg->win.h_offs, arg->win.v_offs), |
|---|
| 2412 | | - addr + ISP3X_RAWHIST_BIG_OFFS); |
|---|
| 2499 | + ISP_PACK_2SHORT(h_offs, v_offs), |
|---|
| 2500 | + addr + ISP3X_RAWHIST_BIG_OFFS, id); |
|---|
| 2413 | 2501 | |
|---|
| 2414 | | - block_hsize = arg->win.h_size / hist_wnd_num[wnd_num_idx] - 1; |
|---|
| 2415 | | - block_vsize = arg->win.v_size / hist_wnd_num[wnd_num_idx] - 1; |
|---|
| 2416 | | - block_hsize &= 0xFFFE; |
|---|
| 2417 | | - block_vsize &= 0xFFFE; |
|---|
| 2502 | + if (dev->hw_dev->unite) |
|---|
| 2503 | + width = width / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL; |
|---|
| 2504 | + h_size = arg->win.h_size; |
|---|
| 2505 | + v_size = arg->win.v_size; |
|---|
| 2506 | + if (!h_size || h_size + h_offs + 1 > width) |
|---|
| 2507 | + h_size = width - h_offs - 1; |
|---|
| 2508 | + if (!v_size || v_size + v_offs + 1 > height) |
|---|
| 2509 | + v_size = height - v_offs - 1; |
|---|
| 2510 | + block_hsize = (h_size / hist_wnd_num[wnd_num_idx]) & ~0x1; |
|---|
| 2511 | + block_vsize = (v_size / hist_wnd_num[wnd_num_idx]) & ~0x1; |
|---|
| 2418 | 2512 | isp3_param_write(params_vdev, |
|---|
| 2419 | 2513 | ISP_PACK_2SHORT(block_hsize, block_vsize), |
|---|
| 2420 | | - addr + ISP3X_RAWHIST_BIG_SIZE); |
|---|
| 2514 | + addr + ISP3X_RAWHIST_BIG_SIZE, id); |
|---|
| 2421 | 2515 | |
|---|
| 2422 | 2516 | isp3_param_write(params_vdev, |
|---|
| 2423 | 2517 | ISP_PACK_4BYTE(arg->rcc, arg->gcc, arg->bcc, arg->off), |
|---|
| 2424 | | - addr + ISP3X_RAWHIST_BIG_RAW2Y_CC); |
|---|
| 2518 | + addr + ISP3X_RAWHIST_BIG_RAW2Y_CC, id); |
|---|
| 2425 | 2519 | |
|---|
| 2426 | 2520 | if (dev->hw_dev->is_single) |
|---|
| 2427 | | - isp_rawhstbig_cfg_sram(params_vdev, arg, blk_no, false); |
|---|
| 2428 | | - else |
|---|
| 2429 | | - *arg_rec = *arg; |
|---|
| 2521 | + isp_rawhstbig_cfg_sram(params_vdev, arg, blk_no, false, id); |
|---|
| 2522 | + *arg_rec = *arg; |
|---|
| 2430 | 2523 | } |
|---|
| 2431 | 2524 | |
|---|
| 2432 | 2525 | static void |
|---|
| 2433 | 2526 | isp_rawhstbig_enable(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 2434 | | - bool en, u32 blk_no) |
|---|
| 2527 | + bool en, u32 blk_no, u32 id) |
|---|
| 2435 | 2528 | { |
|---|
| 2436 | 2529 | u32 hist_ctrl; |
|---|
| 2437 | 2530 | u32 addr; |
|---|
| .. | .. |
|---|
| 2449 | 2542 | break; |
|---|
| 2450 | 2543 | } |
|---|
| 2451 | 2544 | |
|---|
| 2452 | | - hist_ctrl = isp3_param_read(params_vdev, addr + ISP3X_RAWHIST_BIG_CTRL); |
|---|
| 2545 | + hist_ctrl = isp3_param_read(params_vdev, addr + ISP3X_RAWHIST_BIG_CTRL, id); |
|---|
| 2453 | 2546 | hist_ctrl &= ~(ISP3X_RAWHIST_EN | ISP32_REG_WR_MASK); |
|---|
| 2454 | 2547 | if (en) |
|---|
| 2455 | 2548 | hist_ctrl |= ISP3X_RAWHIST_EN; |
|---|
| 2456 | 2549 | |
|---|
| 2457 | | - isp3_param_write(params_vdev, hist_ctrl, addr + ISP3X_RAWHIST_BIG_CTRL); |
|---|
| 2550 | + isp3_param_write(params_vdev, hist_ctrl, addr + ISP3X_RAWHIST_BIG_CTRL, id); |
|---|
| 2458 | 2551 | } |
|---|
| 2459 | 2552 | |
|---|
| 2460 | 2553 | static void |
|---|
| 2461 | 2554 | isp_rawhst1_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 2462 | | - const struct isp2x_rawhistbig_cfg *arg) |
|---|
| 2555 | + const struct isp2x_rawhistbig_cfg *arg, u32 id) |
|---|
| 2463 | 2556 | { |
|---|
| 2464 | | - isp_rawhstbig_config(params_vdev, arg, 1); |
|---|
| 2557 | + isp_rawhstbig_config(params_vdev, arg, 1, id); |
|---|
| 2465 | 2558 | } |
|---|
| 2466 | 2559 | |
|---|
| 2467 | 2560 | static void |
|---|
| 2468 | | -isp_rawhst1_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 2561 | +isp_rawhst1_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 2469 | 2562 | { |
|---|
| 2470 | | - isp_rawhstbig_enable(params_vdev, en, 1); |
|---|
| 2563 | + isp_rawhstbig_enable(params_vdev, en, 1, id); |
|---|
| 2471 | 2564 | } |
|---|
| 2472 | 2565 | |
|---|
| 2473 | 2566 | static void |
|---|
| 2474 | 2567 | isp_rawhst2_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 2475 | | - const struct isp2x_rawhistbig_cfg *arg) |
|---|
| 2568 | + const struct isp2x_rawhistbig_cfg *arg, u32 id) |
|---|
| 2476 | 2569 | { |
|---|
| 2477 | | - isp_rawhstbig_config(params_vdev, arg, 2); |
|---|
| 2570 | + isp_rawhstbig_config(params_vdev, arg, 2, id); |
|---|
| 2478 | 2571 | } |
|---|
| 2479 | 2572 | |
|---|
| 2480 | 2573 | static void |
|---|
| 2481 | | -isp_rawhst2_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 2574 | +isp_rawhst2_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 2482 | 2575 | { |
|---|
| 2483 | | - isp_rawhstbig_enable(params_vdev, en, 2); |
|---|
| 2576 | + isp_rawhstbig_enable(params_vdev, en, 2, id); |
|---|
| 2484 | 2577 | } |
|---|
| 2485 | 2578 | |
|---|
| 2486 | 2579 | static void |
|---|
| 2487 | 2580 | isp_rawhst3_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 2488 | | - const struct isp2x_rawhistbig_cfg *arg) |
|---|
| 2581 | + const struct isp2x_rawhistbig_cfg *arg, u32 id) |
|---|
| 2489 | 2582 | { |
|---|
| 2490 | | - isp_rawhstbig_config(params_vdev, arg, 0); |
|---|
| 2583 | + isp_rawhstbig_config(params_vdev, arg, 0, id); |
|---|
| 2491 | 2584 | } |
|---|
| 2492 | 2585 | |
|---|
| 2493 | 2586 | static void |
|---|
| 2494 | | -isp_rawhst3_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 2587 | +isp_rawhst3_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 2495 | 2588 | { |
|---|
| 2496 | | - isp_rawhstbig_enable(params_vdev, en, 0); |
|---|
| 2589 | + isp_rawhstbig_enable(params_vdev, en, 0, id); |
|---|
| 2497 | 2590 | } |
|---|
| 2498 | 2591 | |
|---|
| 2499 | 2592 | static void |
|---|
| 2500 | 2593 | isp_hdrmge_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 2501 | 2594 | const struct isp32_hdrmge_cfg *arg, |
|---|
| 2502 | | - enum rkisp_params_type type) |
|---|
| 2595 | + enum rkisp_params_type type, u32 id) |
|---|
| 2503 | 2596 | { |
|---|
| 2504 | 2597 | u32 value; |
|---|
| 2505 | 2598 | int i; |
|---|
| 2506 | 2599 | |
|---|
| 2507 | 2600 | if (type == RKISP_PARAMS_SHD || type == RKISP_PARAMS_ALL) { |
|---|
| 2508 | 2601 | value = ISP_PACK_2SHORT(arg->gain0, arg->gain0_inv); |
|---|
| 2509 | | - isp3_param_write(params_vdev, value, ISP3X_HDRMGE_GAIN0); |
|---|
| 2602 | + isp3_param_write(params_vdev, value, ISP3X_HDRMGE_GAIN0, id); |
|---|
| 2510 | 2603 | |
|---|
| 2511 | 2604 | value = ISP_PACK_2SHORT(arg->gain1, arg->gain1_inv); |
|---|
| 2512 | | - isp3_param_write(params_vdev, value, ISP3X_HDRMGE_GAIN1); |
|---|
| 2605 | + isp3_param_write(params_vdev, value, ISP3X_HDRMGE_GAIN1, id); |
|---|
| 2513 | 2606 | |
|---|
| 2514 | 2607 | value = arg->gain2; |
|---|
| 2515 | | - isp3_param_write(params_vdev, value, ISP3X_HDRMGE_GAIN2); |
|---|
| 2608 | + isp3_param_write(params_vdev, value, ISP3X_HDRMGE_GAIN2, id); |
|---|
| 2516 | 2609 | |
|---|
| 2517 | | - value = isp3_param_read_cache(params_vdev, ISP3X_HDRMGE_CTRL); |
|---|
| 2610 | + value = isp3_param_read_cache(params_vdev, ISP3X_HDRMGE_CTRL, id); |
|---|
| 2518 | 2611 | if (arg->s_base) |
|---|
| 2519 | 2612 | value |= BIT(1); |
|---|
| 2520 | 2613 | else |
|---|
| .. | .. |
|---|
| 2523 | 2616 | value |= BIT(6); |
|---|
| 2524 | 2617 | else |
|---|
| 2525 | 2618 | value &= ~BIT(6); |
|---|
| 2526 | | - isp3_param_write(params_vdev, value, ISP3X_HDRMGE_CTRL); |
|---|
| 2619 | + isp3_param_write(params_vdev, value, ISP3X_HDRMGE_CTRL, id); |
|---|
| 2527 | 2620 | } |
|---|
| 2528 | 2621 | |
|---|
| 2529 | 2622 | if (type == RKISP_PARAMS_IMD || type == RKISP_PARAMS_ALL) { |
|---|
| 2530 | 2623 | value = ISP_PACK_4BYTE(arg->ms_dif_0p8, arg->ms_diff_0p15, |
|---|
| 2531 | 2624 | arg->lm_dif_0p9, arg->lm_dif_0p15); |
|---|
| 2532 | | - isp3_param_write(params_vdev, value, ISP3X_HDRMGE_LIGHTZ); |
|---|
| 2625 | + isp3_param_write(params_vdev, value, ISP3X_HDRMGE_LIGHTZ, id); |
|---|
| 2533 | 2626 | value = (arg->ms_scl & 0x7ff) | |
|---|
| 2534 | 2627 | (arg->ms_thd0 & 0x3ff) << 12 | |
|---|
| 2535 | 2628 | (arg->ms_thd1 & 0x3ff) << 22; |
|---|
| 2536 | | - isp3_param_write(params_vdev, value, ISP3X_HDRMGE_MS_DIFF); |
|---|
| 2629 | + isp3_param_write(params_vdev, value, ISP3X_HDRMGE_MS_DIFF, id); |
|---|
| 2537 | 2630 | value = (arg->lm_scl & 0x7ff) | |
|---|
| 2538 | 2631 | (arg->lm_thd0 & 0x3ff) << 12 | |
|---|
| 2539 | 2632 | (arg->lm_thd1 & 0x3ff) << 22; |
|---|
| 2540 | | - isp3_param_write(params_vdev, value, ISP3X_HDRMGE_LM_DIFF); |
|---|
| 2633 | + isp3_param_write(params_vdev, value, ISP3X_HDRMGE_LM_DIFF, id); |
|---|
| 2541 | 2634 | |
|---|
| 2542 | 2635 | for (i = 0; i < ISP32_HDRMGE_L_CURVE_NUM; i++) { |
|---|
| 2543 | 2636 | value = ISP_PACK_2SHORT(arg->curve.curve_0[i], arg->curve.curve_1[i]); |
|---|
| 2544 | | - isp3_param_write(params_vdev, value, ISP3X_HDRMGE_DIFF_Y0 + 4 * i); |
|---|
| 2637 | + isp3_param_write(params_vdev, value, ISP3X_HDRMGE_DIFF_Y0 + 4 * i, id); |
|---|
| 2545 | 2638 | } |
|---|
| 2546 | 2639 | |
|---|
| 2547 | 2640 | for (i = 0; i < ISP32_HDRMGE_E_CURVE_NUM; i++) { |
|---|
| 2548 | 2641 | value = (arg->l_raw1[i] & 0x3ff) << 20 | |
|---|
| 2549 | 2642 | (arg->l_raw0[i] & 0x3ff) << 10 | |
|---|
| 2550 | 2643 | (arg->e_y[i] & 0x3ff); |
|---|
| 2551 | | - isp3_param_write(params_vdev, value, ISP3X_HDRMGE_OVER_Y0 + 4 * i); |
|---|
| 2644 | + isp3_param_write(params_vdev, value, ISP3X_HDRMGE_OVER_Y0 + 4 * i, id); |
|---|
| 2552 | 2645 | } |
|---|
| 2553 | 2646 | |
|---|
| 2554 | 2647 | value = ISP_PACK_2SHORT(arg->each_raw_gain0, arg->each_raw_gain1); |
|---|
| 2555 | | - isp3_param_write(params_vdev, value, ISP32_HDRMGE_EACH_GAIN); |
|---|
| 2648 | + isp3_param_write(params_vdev, value, ISP32_HDRMGE_EACH_GAIN, id); |
|---|
| 2556 | 2649 | } |
|---|
| 2557 | 2650 | } |
|---|
| 2558 | 2651 | |
|---|
| 2559 | 2652 | static void |
|---|
| 2560 | | -isp_hdrmge_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 2653 | +isp_hdrmge_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 2561 | 2654 | { |
|---|
| 2562 | 2655 | } |
|---|
| 2563 | 2656 | |
|---|
| 2564 | 2657 | static void |
|---|
| 2565 | 2658 | isp_hdrdrc_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 2566 | 2659 | const struct isp32_drc_cfg *arg, |
|---|
| 2567 | | - enum rkisp_params_type type) |
|---|
| 2660 | + enum rkisp_params_type type, u32 id) |
|---|
| 2568 | 2661 | { |
|---|
| 2569 | 2662 | u32 i, value; |
|---|
| 2570 | 2663 | |
|---|
| .. | .. |
|---|
| 2574 | 2667 | value = (arg->offset_pow2 & 0x0F) << 28 | |
|---|
| 2575 | 2668 | (arg->compres_scl & 0x1FFF) << 14 | |
|---|
| 2576 | 2669 | (arg->position & 0x03FFF); |
|---|
| 2577 | | - isp3_param_write(params_vdev, value, ISP3X_DRC_CTRL1); |
|---|
| 2670 | + isp3_param_write(params_vdev, value, ISP3X_DRC_CTRL1, id); |
|---|
| 2578 | 2671 | |
|---|
| 2579 | 2672 | value = arg->delta_scalein << 24 | |
|---|
| 2580 | 2673 | (arg->hpdetail_ratio & 0xFFF) << 12 | |
|---|
| 2581 | 2674 | (arg->lpdetail_ratio & 0xFFF); |
|---|
| 2582 | | - isp3_param_write(params_vdev, value, ISP3X_DRC_LPRATIO); |
|---|
| 2675 | + isp3_param_write(params_vdev, value, ISP3X_DRC_LPRATIO, id); |
|---|
| 2583 | 2676 | |
|---|
| 2584 | 2677 | value = ISP_PACK_4BYTE(arg->bilat_wt_off, 0, arg->weipre_frame, arg->weicur_pix); |
|---|
| 2585 | | - isp3_param_write(params_vdev, value, ISP3X_DRC_EXPLRATIO); |
|---|
| 2678 | + isp3_param_write(params_vdev, value, ISP3X_DRC_EXPLRATIO, id); |
|---|
| 2586 | 2679 | |
|---|
| 2587 | 2680 | value = (arg->force_sgm_inv0 & 0xFFFF) << 16 | |
|---|
| 2588 | 2681 | arg->motion_scl << 8 | arg->edge_scl; |
|---|
| 2589 | | - isp3_param_write(params_vdev, value, ISP3X_DRC_SIGMA); |
|---|
| 2682 | + isp3_param_write(params_vdev, value, ISP3X_DRC_SIGMA, id); |
|---|
| 2590 | 2683 | |
|---|
| 2591 | 2684 | value = ISP_PACK_2SHORT(arg->space_sgm_inv0, arg->space_sgm_inv1); |
|---|
| 2592 | | - isp3_param_write(params_vdev, value, ISP3X_DRC_SPACESGM); |
|---|
| 2685 | + isp3_param_write(params_vdev, value, ISP3X_DRC_SPACESGM, id); |
|---|
| 2593 | 2686 | |
|---|
| 2594 | 2687 | value = ISP_PACK_2SHORT(arg->range_sgm_inv0, arg->range_sgm_inv1); |
|---|
| 2595 | | - isp3_param_write(params_vdev, value, ISP3X_DRC_RANESGM); |
|---|
| 2688 | + isp3_param_write(params_vdev, value, ISP3X_DRC_RANESGM, id); |
|---|
| 2596 | 2689 | |
|---|
| 2597 | 2690 | value = (arg->weig_bilat & 0x1f) | (arg->weig_maxl & 0x1f) << 8 | |
|---|
| 2598 | 2691 | (arg->bilat_soft_thd & 0x3fff) << 16; |
|---|
| 2599 | 2692 | if (arg->enable_soft_thd) |
|---|
| 2600 | 2693 | value |= BIT(31); |
|---|
| 2601 | | - isp3_param_write(params_vdev, value, ISP3X_DRC_BILAT); |
|---|
| 2694 | + isp3_param_write(params_vdev, value, ISP3X_DRC_BILAT, id); |
|---|
| 2602 | 2695 | |
|---|
| 2603 | 2696 | for (i = 0; i < ISP32_DRC_Y_NUM / 2; i++) { |
|---|
| 2604 | 2697 | value = ISP_PACK_2SHORT(arg->gain_y[2 * i], |
|---|
| 2605 | 2698 | arg->gain_y[2 * i + 1]); |
|---|
| 2606 | | - isp3_param_write(params_vdev, value, ISP3X_DRC_GAIN_Y0 + 4 * i); |
|---|
| 2699 | + isp3_param_write(params_vdev, value, ISP3X_DRC_GAIN_Y0 + 4 * i, id); |
|---|
| 2607 | 2700 | } |
|---|
| 2608 | 2701 | value = ISP_PACK_2SHORT(arg->gain_y[2 * i], 0); |
|---|
| 2609 | | - isp3_param_write(params_vdev, value, ISP3X_DRC_GAIN_Y0 + 4 * i); |
|---|
| 2702 | + isp3_param_write(params_vdev, value, ISP3X_DRC_GAIN_Y0 + 4 * i, id); |
|---|
| 2610 | 2703 | |
|---|
| 2611 | 2704 | for (i = 0; i < ISP32_DRC_Y_NUM / 2; i++) { |
|---|
| 2612 | 2705 | value = ISP_PACK_2SHORT(arg->compres_y[2 * i], |
|---|
| 2613 | 2706 | arg->compres_y[2 * i + 1]); |
|---|
| 2614 | | - isp3_param_write(params_vdev, value, ISP3X_DRC_COMPRES_Y0 + 4 * i); |
|---|
| 2707 | + isp3_param_write(params_vdev, value, ISP3X_DRC_COMPRES_Y0 + 4 * i, id); |
|---|
| 2615 | 2708 | } |
|---|
| 2616 | 2709 | value = ISP_PACK_2SHORT(arg->compres_y[2 * i], 0); |
|---|
| 2617 | | - isp3_param_write(params_vdev, value, ISP3X_DRC_COMPRES_Y0 + 4 * i); |
|---|
| 2710 | + isp3_param_write(params_vdev, value, ISP3X_DRC_COMPRES_Y0 + 4 * i, id); |
|---|
| 2618 | 2711 | |
|---|
| 2619 | 2712 | for (i = 0; i < ISP32_DRC_Y_NUM / 2; i++) { |
|---|
| 2620 | 2713 | value = ISP_PACK_2SHORT(arg->scale_y[2 * i], |
|---|
| 2621 | 2714 | arg->scale_y[2 * i + 1]); |
|---|
| 2622 | | - isp3_param_write(params_vdev, value, ISP3X_DRC_SCALE_Y0 + 4 * i); |
|---|
| 2715 | + isp3_param_write(params_vdev, value, ISP3X_DRC_SCALE_Y0 + 4 * i, id); |
|---|
| 2623 | 2716 | } |
|---|
| 2624 | 2717 | value = ISP_PACK_2SHORT(arg->scale_y[2 * i], 0); |
|---|
| 2625 | | - isp3_param_write(params_vdev, value, ISP3X_DRC_SCALE_Y0 + 4 * i); |
|---|
| 2718 | + isp3_param_write(params_vdev, value, ISP3X_DRC_SCALE_Y0 + 4 * i, id); |
|---|
| 2626 | 2719 | |
|---|
| 2627 | 2720 | if (params_vdev->dev->isp_ver == ISP_V32) |
|---|
| 2628 | 2721 | value = ISP_PACK_2SHORT(arg->min_ogain, arg->iir_weight); |
|---|
| 2629 | 2722 | else |
|---|
| 2630 | 2723 | value = ISP_PACK_2SHORT(arg->min_ogain, 0); |
|---|
| 2631 | | - isp3_param_write(params_vdev, value, ISP3X_DRC_IIRWG_GAIN); |
|---|
| 2724 | + isp3_param_write(params_vdev, value, ISP3X_DRC_IIRWG_GAIN, id); |
|---|
| 2632 | 2725 | |
|---|
| 2633 | 2726 | value = arg->gas_t & 0x1fff; |
|---|
| 2634 | | - isp3_param_write(params_vdev, value, ISP32_DRC_LUM3X2_CTRL); |
|---|
| 2727 | + isp3_param_write(params_vdev, value, ISP32_DRC_LUM3X2_CTRL, id); |
|---|
| 2635 | 2728 | |
|---|
| 2636 | 2729 | value = ISP_PACK_4BYTE(arg->gas_l0, arg->gas_l1, arg->gas_l2, arg->gas_l3); |
|---|
| 2637 | | - isp3_param_write(params_vdev, value, ISP32_DRC_LUM3X2_GAS); |
|---|
| 2730 | + isp3_param_write(params_vdev, value, ISP32_DRC_LUM3X2_GAS, id); |
|---|
| 2638 | 2731 | } |
|---|
| 2639 | 2732 | |
|---|
| 2640 | 2733 | static void |
|---|
| 2641 | | -isp_hdrdrc_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 2734 | +isp_hdrdrc_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 2642 | 2735 | { |
|---|
| 2643 | 2736 | u32 value; |
|---|
| 2644 | 2737 | bool real_en; |
|---|
| 2645 | 2738 | |
|---|
| 2646 | | - value = isp3_param_read(params_vdev, ISP3X_DRC_CTRL0); |
|---|
| 2739 | + value = isp3_param_read(params_vdev, ISP3X_DRC_CTRL0, id); |
|---|
| 2647 | 2740 | real_en = !!(value & ISP32_MODULE_EN); |
|---|
| 2648 | 2741 | if ((en && real_en) || (!en && !real_en)) |
|---|
| 2649 | 2742 | return; |
|---|
| .. | .. |
|---|
| 2651 | 2744 | if (en) { |
|---|
| 2652 | 2745 | value |= ISP32_MODULE_EN; |
|---|
| 2653 | 2746 | isp3_param_set_bits(params_vdev, ISP3X_ISP_CTRL1, |
|---|
| 2654 | | - ISP3X_ADRC_FST_FRAME); |
|---|
| 2747 | + ISP3X_ADRC_FST_FRAME, id); |
|---|
| 2655 | 2748 | } else { |
|---|
| 2656 | 2749 | value = 0; |
|---|
| 2657 | | - isp3_param_clear_bits(params_vdev, ISP3X_GAIN_CTRL, BIT(12)); |
|---|
| 2750 | + isp3_param_clear_bits(params_vdev, ISP3X_GAIN_CTRL, BIT(12), id); |
|---|
| 2658 | 2751 | } |
|---|
| 2659 | | - isp3_param_write(params_vdev, value, ISP3X_DRC_CTRL0); |
|---|
| 2752 | + isp3_param_write(params_vdev, value, ISP3X_DRC_CTRL0, id); |
|---|
| 2660 | 2753 | } |
|---|
| 2661 | 2754 | |
|---|
| 2662 | 2755 | static void |
|---|
| 2663 | 2756 | isp_gic_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 2664 | | - const struct isp21_gic_cfg *arg) |
|---|
| 2757 | + const struct isp21_gic_cfg *arg, u32 id) |
|---|
| 2665 | 2758 | { |
|---|
| 2666 | 2759 | u32 value; |
|---|
| 2667 | 2760 | s32 i; |
|---|
| .. | .. |
|---|
| 2669 | 2762 | value = (arg->regmingradthrdark2 & 0x03FF) << 20 | |
|---|
| 2670 | 2763 | (arg->regmingradthrdark1 & 0x03FF) << 10 | |
|---|
| 2671 | 2764 | (arg->regminbusythre & 0x03FF); |
|---|
| 2672 | | - isp3_param_write(params_vdev, value, ISP3X_GIC_DIFF_PARA1); |
|---|
| 2765 | + isp3_param_write(params_vdev, value, ISP3X_GIC_DIFF_PARA1, id); |
|---|
| 2673 | 2766 | |
|---|
| 2674 | 2767 | value = (arg->regdarkthre & 0x07FF) << 21 | |
|---|
| 2675 | 2768 | (arg->regmaxcorvboth & 0x03FF) << 11 | |
|---|
| 2676 | 2769 | (arg->regdarktthrehi & 0x07FF); |
|---|
| 2677 | | - isp3_param_write(params_vdev, value, ISP3X_GIC_DIFF_PARA2); |
|---|
| 2770 | + isp3_param_write(params_vdev, value, ISP3X_GIC_DIFF_PARA2, id); |
|---|
| 2678 | 2771 | |
|---|
| 2679 | 2772 | value = (arg->regkgrad2dark & 0x0F) << 28 | |
|---|
| 2680 | 2773 | (arg->regkgrad1dark & 0x0F) << 24 | |
|---|
| .. | .. |
|---|
| 2683 | 2776 | (arg->regkgrad2 & 0x0F) << 8 | |
|---|
| 2684 | 2777 | (arg->regkgrad1 & 0x0F) << 4 | |
|---|
| 2685 | 2778 | (arg->reggbthre & 0x0F); |
|---|
| 2686 | | - isp3_param_write(params_vdev, value, ISP3X_GIC_DIFF_PARA3); |
|---|
| 2779 | + isp3_param_write(params_vdev, value, ISP3X_GIC_DIFF_PARA3, id); |
|---|
| 2687 | 2780 | |
|---|
| 2688 | 2781 | value = (arg->regmaxcorv & 0x03FF) << 20 | |
|---|
| 2689 | 2782 | (arg->regmingradthr2 & 0x03FF) << 10 | |
|---|
| 2690 | 2783 | (arg->regmingradthr1 & 0x03FF); |
|---|
| 2691 | | - isp3_param_write(params_vdev, value, ISP3X_GIC_DIFF_PARA4); |
|---|
| 2784 | + isp3_param_write(params_vdev, value, ISP3X_GIC_DIFF_PARA4, id); |
|---|
| 2692 | 2785 | |
|---|
| 2693 | 2786 | value = (arg->gr_ratio & 0x03) << 28 | |
|---|
| 2694 | 2787 | (arg->noise_scale & 0x7F) << 12 | |
|---|
| 2695 | 2788 | (arg->noise_base & 0xFFF); |
|---|
| 2696 | | - isp3_param_write(params_vdev, value, ISP3X_GIC_NOISE_PARA1); |
|---|
| 2789 | + isp3_param_write(params_vdev, value, ISP3X_GIC_NOISE_PARA1, id); |
|---|
| 2697 | 2790 | |
|---|
| 2698 | 2791 | value = arg->diff_clip & 0x7fff; |
|---|
| 2699 | | - isp3_param_write(params_vdev, value, ISP3X_GIC_NOISE_PARA2); |
|---|
| 2792 | + isp3_param_write(params_vdev, value, ISP3X_GIC_NOISE_PARA2, id); |
|---|
| 2700 | 2793 | |
|---|
| 2701 | 2794 | for (i = 0; i < ISP32_GIC_SIGMA_Y_NUM / 2; i++) { |
|---|
| 2702 | 2795 | value = ISP_PACK_2SHORT(arg->sigma_y[2 * i], arg->sigma_y[2 * i + 1]); |
|---|
| 2703 | | - isp3_param_write(params_vdev, value, ISP3X_GIC_SIGMA_VALUE0 + 4 * i); |
|---|
| 2796 | + isp3_param_write(params_vdev, value, ISP3X_GIC_SIGMA_VALUE0 + 4 * i, id); |
|---|
| 2704 | 2797 | } |
|---|
| 2705 | 2798 | value = ISP_PACK_2SHORT(arg->sigma_y[2 * i], 0); |
|---|
| 2706 | | - isp3_param_write(params_vdev, value, ISP3X_GIC_SIGMA_VALUE0 + 4 * i); |
|---|
| 2799 | + isp3_param_write(params_vdev, value, ISP3X_GIC_SIGMA_VALUE0 + 4 * i, id); |
|---|
| 2707 | 2800 | } |
|---|
| 2708 | 2801 | |
|---|
| 2709 | 2802 | static void |
|---|
| 2710 | | -isp_gic_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 2803 | +isp_gic_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 2711 | 2804 | { |
|---|
| 2712 | 2805 | u32 value = 0; |
|---|
| 2713 | 2806 | |
|---|
| 2714 | 2807 | if (en) |
|---|
| 2715 | 2808 | value |= ISP32_MODULE_EN; |
|---|
| 2716 | | - isp3_param_write(params_vdev, value, ISP3X_GIC_CONTROL); |
|---|
| 2809 | + isp3_param_write(params_vdev, value, ISP3X_GIC_CONTROL, id); |
|---|
| 2717 | 2810 | } |
|---|
| 2718 | 2811 | |
|---|
| 2719 | 2812 | static void |
|---|
| 2720 | 2813 | isp_dhaz_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 2721 | | - const struct isp32_dhaz_cfg *arg) |
|---|
| 2814 | + const struct isp32_dhaz_cfg *arg, u32 id) |
|---|
| 2722 | 2815 | { |
|---|
| 2723 | 2816 | u32 i, value, ctrl; |
|---|
| 2724 | 2817 | |
|---|
| 2725 | | - ctrl = isp3_param_read(params_vdev, ISP3X_DHAZ_CTRL); |
|---|
| 2818 | + ctrl = isp3_param_read(params_vdev, ISP3X_DHAZ_CTRL, id); |
|---|
| 2726 | 2819 | ctrl &= ISP3X_DHAZ_ENMUX; |
|---|
| 2727 | 2820 | |
|---|
| 2728 | 2821 | ctrl |= !!arg->enh_luma_en << 28 | !!arg->color_deviate_en << 27 | |
|---|
| .. | .. |
|---|
| 2736 | 2829 | value = (arg->hist_wr[i * 3] & 0x3ff) | |
|---|
| 2737 | 2830 | (arg->hist_wr[i * 3 + 1] & 0x3ff) << 10 | |
|---|
| 2738 | 2831 | (arg->hist_wr[i * 3 + 2] & 0x3ff) << 20; |
|---|
| 2739 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_HIST_WR0 + i * 4); |
|---|
| 2832 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_HIST_WR0 + i * 4, id); |
|---|
| 2740 | 2833 | } |
|---|
| 2741 | 2834 | value = arg->hist_wr[i * 3] & 0x3ff; |
|---|
| 2742 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_HIST_WR0 + i * 4); |
|---|
| 2835 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_HIST_WR0 + i * 4, id); |
|---|
| 2743 | 2836 | } |
|---|
| 2744 | | - isp3_param_write(params_vdev, ctrl, ISP3X_DHAZ_CTRL); |
|---|
| 2837 | + isp3_param_write(params_vdev, ctrl, ISP3X_DHAZ_CTRL, id); |
|---|
| 2745 | 2838 | |
|---|
| 2746 | 2839 | value = ISP_PACK_4BYTE(arg->dc_min_th, arg->dc_max_th, |
|---|
| 2747 | 2840 | arg->yhist_th, arg->yblk_th); |
|---|
| 2748 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_ADP0); |
|---|
| 2841 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_ADP0, id); |
|---|
| 2749 | 2842 | |
|---|
| 2750 | 2843 | value = ISP_PACK_4BYTE(arg->bright_min, arg->bright_max, |
|---|
| 2751 | 2844 | arg->wt_max, 0); |
|---|
| 2752 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_ADP1); |
|---|
| 2845 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_ADP1, id); |
|---|
| 2753 | 2846 | |
|---|
| 2754 | 2847 | value = ISP_PACK_4BYTE(arg->air_min, arg->air_max, |
|---|
| 2755 | 2848 | arg->dark_th, arg->tmax_base); |
|---|
| 2756 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_ADP2); |
|---|
| 2849 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_ADP2, id); |
|---|
| 2757 | 2850 | |
|---|
| 2758 | 2851 | value = ISP_PACK_2SHORT(arg->tmax_off, arg->tmax_max); |
|---|
| 2759 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_ADP_TMAX); |
|---|
| 2852 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_ADP_TMAX, id); |
|---|
| 2760 | 2853 | |
|---|
| 2761 | 2854 | value = (arg->hist_min & 0xFFFF) << 16 | |
|---|
| 2762 | 2855 | (arg->hist_th_off & 0xFF) << 8 | |
|---|
| 2763 | 2856 | (arg->hist_k & 0x1F); |
|---|
| 2764 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_ADP_HIST0); |
|---|
| 2857 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_ADP_HIST0, id); |
|---|
| 2765 | 2858 | |
|---|
| 2766 | 2859 | value = ISP_PACK_2SHORT(arg->hist_scale, arg->hist_gratio); |
|---|
| 2767 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_ADP_HIST1); |
|---|
| 2860 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_ADP_HIST1, id); |
|---|
| 2768 | 2861 | |
|---|
| 2769 | 2862 | value = ISP_PACK_2SHORT(arg->enhance_chroma, arg->enhance_value); |
|---|
| 2770 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_ENHANCE); |
|---|
| 2863 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_ENHANCE, id); |
|---|
| 2771 | 2864 | |
|---|
| 2772 | 2865 | value = (arg->iir_wt_sigma & 0x07FF) << 16 | |
|---|
| 2773 | 2866 | (arg->iir_sigma & 0xFF) << 8 | |
|---|
| 2774 | 2867 | (arg->stab_fnum & 0x1F); |
|---|
| 2775 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_IIR0); |
|---|
| 2868 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_IIR0, id); |
|---|
| 2776 | 2869 | |
|---|
| 2777 | 2870 | value = (arg->iir_pre_wet & 0x0F) << 24 | |
|---|
| 2778 | 2871 | (arg->iir_tmax_sigma & 0x7FF) << 8 | |
|---|
| 2779 | 2872 | (arg->iir_air_sigma & 0xFF); |
|---|
| 2780 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_IIR1); |
|---|
| 2873 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_IIR1, id); |
|---|
| 2781 | 2874 | |
|---|
| 2782 | 2875 | value = (arg->cfg_wt & 0x01FF) << 16 | |
|---|
| 2783 | 2876 | (arg->cfg_air & 0xFF) << 8 | |
|---|
| 2784 | 2877 | (arg->cfg_alpha & 0xFF); |
|---|
| 2785 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_SOFT_CFG0); |
|---|
| 2878 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_SOFT_CFG0, id); |
|---|
| 2786 | 2879 | |
|---|
| 2787 | 2880 | value = ISP_PACK_2SHORT(arg->cfg_tmax, arg->cfg_gratio); |
|---|
| 2788 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_SOFT_CFG1); |
|---|
| 2881 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_SOFT_CFG1, id); |
|---|
| 2789 | 2882 | |
|---|
| 2790 | 2883 | value = (arg->range_sima & 0x01FF) << 16 | |
|---|
| 2791 | 2884 | (arg->space_sigma_pre & 0xFF) << 8 | |
|---|
| 2792 | 2885 | (arg->space_sigma_cur & 0xFF); |
|---|
| 2793 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_BF_SIGMA); |
|---|
| 2886 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_BF_SIGMA, id); |
|---|
| 2794 | 2887 | |
|---|
| 2795 | 2888 | value = ISP_PACK_2SHORT(arg->bf_weight, arg->dc_weitcur); |
|---|
| 2796 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_BF_WET); |
|---|
| 2889 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_BF_WET, id); |
|---|
| 2797 | 2890 | |
|---|
| 2798 | 2891 | for (i = 0; i < ISP32_DHAZ_ENH_CURVE_NUM / 2; i++) { |
|---|
| 2799 | 2892 | value = ISP_PACK_2SHORT(arg->enh_curve[2 * i], arg->enh_curve[2 * i + 1]); |
|---|
| 2800 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_ENH_CURVE0 + 4 * i); |
|---|
| 2893 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_ENH_CURVE0 + 4 * i, id); |
|---|
| 2801 | 2894 | } |
|---|
| 2802 | 2895 | value = ISP_PACK_2SHORT(arg->enh_curve[2 * i], 0); |
|---|
| 2803 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_ENH_CURVE0 + 4 * i); |
|---|
| 2896 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_ENH_CURVE0 + 4 * i, id); |
|---|
| 2804 | 2897 | |
|---|
| 2805 | 2898 | value = ISP_PACK_4BYTE(arg->gaus_h0, arg->gaus_h1, arg->gaus_h2, 0); |
|---|
| 2806 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_GAUS); |
|---|
| 2899 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_GAUS, id); |
|---|
| 2807 | 2900 | |
|---|
| 2808 | 2901 | for (i = 0; i < ISP32_DHAZ_SIGMA_IDX_NUM / 4; i++) { |
|---|
| 2809 | 2902 | value = ISP_PACK_4BYTE(arg->sigma_idx[i * 4], arg->sigma_idx[i * 4 + 1], |
|---|
| 2810 | 2903 | arg->sigma_idx[i * 4 + 2], arg->sigma_idx[i * 4 + 3]); |
|---|
| 2811 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_GAIN_IDX0 + i * 4); |
|---|
| 2904 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_GAIN_IDX0 + i * 4, id); |
|---|
| 2812 | 2905 | } |
|---|
| 2813 | 2906 | value = ISP_PACK_4BYTE(arg->sigma_idx[i * 4], arg->sigma_idx[i * 4 + 1], |
|---|
| 2814 | 2907 | arg->sigma_idx[i * 4 + 2], 0); |
|---|
| 2815 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_GAIN_IDX0 + i * 4); |
|---|
| 2908 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_GAIN_IDX0 + i * 4, id); |
|---|
| 2816 | 2909 | |
|---|
| 2817 | 2910 | for (i = 0; i < ISP32_DHAZ_SIGMA_LUT_NUM / 2; i++) { |
|---|
| 2818 | 2911 | value = ISP_PACK_2SHORT(arg->sigma_lut[i * 2], arg->sigma_lut[i * 2 + 1]); |
|---|
| 2819 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_GAIN_LUT0 + i * 4); |
|---|
| 2912 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_GAIN_LUT0 + i * 4, id); |
|---|
| 2820 | 2913 | } |
|---|
| 2821 | 2914 | value = ISP_PACK_2SHORT(arg->sigma_lut[i * 2], 0); |
|---|
| 2822 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_GAIN_LUT0 + i * 4); |
|---|
| 2915 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_GAIN_LUT0 + i * 4, id); |
|---|
| 2823 | 2916 | |
|---|
| 2824 | 2917 | for (i = 0; i < ISP32_DHAZ_ENH_LUMA_NUM / 3; i++) { |
|---|
| 2825 | 2918 | value = (arg->enh_luma[i * 3 + 2] & 0x3ff) << 20 | |
|---|
| 2826 | 2919 | (arg->enh_luma[i * 3 + 1] & 0x3ff) << 10 | |
|---|
| 2827 | 2920 | (arg->enh_luma[i * 3] & 0x3ff); |
|---|
| 2828 | | - isp3_param_write(params_vdev, value, ISP32_DHAZ_ENH_LUMA0 + i * 4); |
|---|
| 2921 | + isp3_param_write(params_vdev, value, ISP32_DHAZ_ENH_LUMA0 + i * 4, id); |
|---|
| 2829 | 2922 | } |
|---|
| 2830 | 2923 | value = (arg->enh_luma[i * 3 + 1] & 0x3ff) << 10 | |
|---|
| 2831 | 2924 | (arg->enh_luma[i * 3] & 0x3ff); |
|---|
| 2832 | | - isp3_param_write(params_vdev, value, ISP32_DHAZ_ENH_LUMA0 + i * 4); |
|---|
| 2925 | + isp3_param_write(params_vdev, value, ISP32_DHAZ_ENH_LUMA0 + i * 4, id); |
|---|
| 2833 | 2926 | } |
|---|
| 2834 | 2927 | |
|---|
| 2835 | 2928 | static void |
|---|
| 2836 | | -isp_dhaz_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 2929 | +isp_dhaz_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 2837 | 2930 | { |
|---|
| 2838 | 2931 | u32 value; |
|---|
| 2839 | 2932 | bool real_en; |
|---|
| 2840 | 2933 | |
|---|
| 2841 | | - value = isp3_param_read(params_vdev, ISP3X_DHAZ_CTRL); |
|---|
| 2934 | + value = isp3_param_read(params_vdev, ISP3X_DHAZ_CTRL, id); |
|---|
| 2842 | 2935 | real_en = !!(value & ISP3X_DHAZ_ENMUX); |
|---|
| 2843 | 2936 | if ((en && real_en) || (!en && !real_en)) |
|---|
| 2844 | 2937 | return; |
|---|
| .. | .. |
|---|
| 2846 | 2939 | if (en) { |
|---|
| 2847 | 2940 | value |= ISP32_SELF_FORCE_UPD | ISP3X_DHAZ_ENMUX; |
|---|
| 2848 | 2941 | isp3_param_set_bits(params_vdev, ISP3X_ISP_CTRL1, |
|---|
| 2849 | | - ISP3X_DHAZ_FST_FRAME); |
|---|
| 2942 | + ISP3X_DHAZ_FST_FRAME, id); |
|---|
| 2850 | 2943 | } else { |
|---|
| 2851 | 2944 | value &= ~ISP3X_DHAZ_ENMUX; |
|---|
| 2852 | | - isp3_param_clear_bits(params_vdev, ISP3X_GAIN_CTRL, BIT(16)); |
|---|
| 2945 | + isp3_param_clear_bits(params_vdev, ISP3X_GAIN_CTRL, BIT(16), id); |
|---|
| 2853 | 2946 | } |
|---|
| 2854 | | - isp3_param_write(params_vdev, value, ISP3X_DHAZ_CTRL); |
|---|
| 2947 | + isp3_param_write(params_vdev, value, ISP3X_DHAZ_CTRL, id); |
|---|
| 2855 | 2948 | } |
|---|
| 2856 | 2949 | |
|---|
| 2857 | 2950 | static void |
|---|
| 2858 | 2951 | isp_3dlut_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 2859 | | - const struct isp2x_3dlut_cfg *arg) |
|---|
| 2952 | + const struct isp2x_3dlut_cfg *arg, u32 id) |
|---|
| 2860 | 2953 | { |
|---|
| 2861 | 2954 | struct rkisp_device *dev = params_vdev->dev; |
|---|
| 2862 | 2955 | struct rkisp_isp_params_val_v32 *priv_val; |
|---|
| .. | .. |
|---|
| 2864 | 2957 | u32 *data; |
|---|
| 2865 | 2958 | |
|---|
| 2866 | 2959 | priv_val = (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 2867 | | - buf_idx = (priv_val->buf_3dlut_idx++) % ISP32_3DLUT_BUF_NUM; |
|---|
| 2960 | + buf_idx = (priv_val->buf_3dlut_idx[id]++) % ISP32_3DLUT_BUF_NUM; |
|---|
| 2868 | 2961 | |
|---|
| 2869 | | - if (!priv_val->buf_3dlut[buf_idx].vaddr) { |
|---|
| 2962 | + if (!priv_val->buf_3dlut[id][buf_idx].vaddr) { |
|---|
| 2870 | 2963 | dev_err(dev->dev, "no find 3dlut buf\n"); |
|---|
| 2871 | 2964 | return; |
|---|
| 2872 | 2965 | } |
|---|
| 2873 | | - data = (u32 *)priv_val->buf_3dlut[buf_idx].vaddr; |
|---|
| 2966 | + data = (u32 *)priv_val->buf_3dlut[id][buf_idx].vaddr; |
|---|
| 2874 | 2967 | for (i = 0; i < arg->actual_size; i++) |
|---|
| 2875 | 2968 | data[i] = (arg->lut_b[i] & 0x3FF) | |
|---|
| 2876 | 2969 | (arg->lut_g[i] & 0xFFF) << 10 | |
|---|
| 2877 | 2970 | (arg->lut_r[i] & 0x3FF) << 22; |
|---|
| 2878 | | - rkisp_prepare_buffer(params_vdev->dev, &priv_val->buf_3dlut[buf_idx]); |
|---|
| 2879 | | - value = priv_val->buf_3dlut[buf_idx].dma_addr; |
|---|
| 2880 | | - isp3_param_write(params_vdev, value, ISP3X_MI_LUT_3D_RD_BASE); |
|---|
| 2881 | | - isp3_param_write(params_vdev, arg->actual_size, ISP3X_MI_LUT_3D_RD_WSIZE); |
|---|
| 2971 | + rkisp_prepare_buffer(params_vdev->dev, &priv_val->buf_3dlut[id][buf_idx]); |
|---|
| 2972 | + value = priv_val->buf_3dlut[id][buf_idx].dma_addr; |
|---|
| 2973 | + isp3_param_write(params_vdev, value, ISP3X_MI_LUT_3D_RD_BASE, id); |
|---|
| 2974 | + isp3_param_write(params_vdev, arg->actual_size, ISP3X_MI_LUT_3D_RD_WSIZE, id); |
|---|
| 2882 | 2975 | |
|---|
| 2883 | | - value = isp3_param_read(params_vdev, ISP3X_3DLUT_CTRL); |
|---|
| 2976 | + value = isp3_param_read(params_vdev, ISP3X_3DLUT_CTRL, id); |
|---|
| 2884 | 2977 | value &= ISP3X_3DLUT_EN; |
|---|
| 2885 | 2978 | |
|---|
| 2886 | 2979 | if (value) |
|---|
| 2887 | | - isp3_param_set_bits(params_vdev, ISP3X_3DLUT_UPDATE, 0x01); |
|---|
| 2980 | + isp3_param_set_bits(params_vdev, ISP3X_3DLUT_UPDATE, 0x01, id); |
|---|
| 2888 | 2981 | |
|---|
| 2889 | | - isp3_param_write(params_vdev, value, ISP3X_3DLUT_CTRL); |
|---|
| 2982 | + isp3_param_write(params_vdev, value, ISP3X_3DLUT_CTRL, id); |
|---|
| 2890 | 2983 | } |
|---|
| 2891 | 2984 | |
|---|
| 2892 | 2985 | static void |
|---|
| 2893 | | -isp_3dlut_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 2986 | +isp_3dlut_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 2894 | 2987 | { |
|---|
| 2895 | 2988 | u32 value; |
|---|
| 2896 | 2989 | bool en_state; |
|---|
| 2897 | 2990 | struct rkisp_isp_params_val_v32 *priv_val; |
|---|
| 2898 | 2991 | |
|---|
| 2899 | | - value = isp3_param_read(params_vdev, ISP3X_3DLUT_CTRL); |
|---|
| 2992 | + value = isp3_param_read(params_vdev, ISP3X_3DLUT_CTRL, id); |
|---|
| 2900 | 2993 | en_state = (value & ISP3X_3DLUT_EN) ? true : false; |
|---|
| 2901 | 2994 | |
|---|
| 2902 | 2995 | if (en == en_state) |
|---|
| 2903 | 2996 | return; |
|---|
| 2904 | 2997 | |
|---|
| 2905 | 2998 | priv_val = (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 2906 | | - if (en && priv_val->buf_3dlut[0].vaddr) { |
|---|
| 2907 | | - isp3_param_set_bits(params_vdev, ISP3X_3DLUT_CTRL, 0x01); |
|---|
| 2908 | | - isp3_param_set_bits(params_vdev, ISP3X_3DLUT_UPDATE, 0x01); |
|---|
| 2999 | + if (en && priv_val->buf_3dlut[id][0].vaddr) { |
|---|
| 3000 | + isp3_param_set_bits(params_vdev, ISP3X_3DLUT_CTRL, 0x01, id); |
|---|
| 3001 | + isp3_param_set_bits(params_vdev, ISP3X_3DLUT_UPDATE, 0x01, id); |
|---|
| 2909 | 3002 | } else { |
|---|
| 2910 | | - isp3_param_clear_bits(params_vdev, ISP3X_3DLUT_CTRL, 0x01); |
|---|
| 2911 | | - isp3_param_clear_bits(params_vdev, ISP3X_3DLUT_UPDATE, 0x01); |
|---|
| 2912 | | - isp3_param_clear_bits(params_vdev, ISP3X_GAIN_CTRL, BIT(20)); |
|---|
| 3003 | + isp3_param_clear_bits(params_vdev, ISP3X_3DLUT_CTRL, 0x01, id); |
|---|
| 3004 | + isp3_param_clear_bits(params_vdev, ISP3X_3DLUT_UPDATE, 0x01, id); |
|---|
| 3005 | + isp3_param_clear_bits(params_vdev, ISP3X_GAIN_CTRL, BIT(20), id); |
|---|
| 2913 | 3006 | } |
|---|
| 2914 | 3007 | } |
|---|
| 2915 | 3008 | |
|---|
| 2916 | 3009 | static void |
|---|
| 2917 | 3010 | isp_ldch_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 2918 | | - const struct isp32_ldch_cfg *arg) |
|---|
| 3011 | + const struct isp32_ldch_cfg *arg, u32 id) |
|---|
| 2919 | 3012 | { |
|---|
| 2920 | 3013 | struct rkisp_device *dev = params_vdev->dev; |
|---|
| 2921 | 3014 | struct rkisp_isp_params_val_v32 *priv_val; |
|---|
| .. | .. |
|---|
| 2923 | 3016 | int buf_idx, i; |
|---|
| 2924 | 3017 | u32 value; |
|---|
| 2925 | 3018 | |
|---|
| 2926 | | - value = isp3_param_read(params_vdev, ISP3X_LDCH_STS); |
|---|
| 3019 | + value = isp3_param_read(params_vdev, ISP3X_LDCH_STS, id); |
|---|
| 2927 | 3020 | value &= ISP32_MODULE_EN; |
|---|
| 2928 | 3021 | value |= !!arg->map13p3_en << 7 | |
|---|
| 2929 | 3022 | !!arg->force_map_en << 6 | |
|---|
| .. | .. |
|---|
| 2931 | 3024 | !!arg->sample_avr_en << 3 | |
|---|
| 2932 | 3025 | !!arg->zero_interp_en << 2 | |
|---|
| 2933 | 3026 | !!arg->frm_end_dis << 1; |
|---|
| 2934 | | - isp3_param_write(params_vdev, value, ISP3X_LDCH_STS); |
|---|
| 3027 | + isp3_param_write(params_vdev, value, ISP3X_LDCH_STS, id); |
|---|
| 2935 | 3028 | if (arg->bic_mode_en) { |
|---|
| 2936 | 3029 | for (i = 0; i < ISP32_LDCH_BIC_NUM / 4; i++) { |
|---|
| 2937 | 3030 | value = ISP_PACK_4BYTE(arg->bicubic[i * 4], arg->bicubic[i * 4 + 1], |
|---|
| 2938 | 3031 | arg->bicubic[i * 4 + 2], arg->bicubic[i * 4 + 3]); |
|---|
| 2939 | | - isp3_param_write(params_vdev, value, ISP32_LDCH_BIC_TABLE0 + i * 4); |
|---|
| 3032 | + isp3_param_write(params_vdev, value, ISP32_LDCH_BIC_TABLE0 + i * 4, id); |
|---|
| 2940 | 3033 | } |
|---|
| 2941 | 3034 | } |
|---|
| 2942 | 3035 | |
|---|
| 2943 | 3036 | priv_val = (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 2944 | 3037 | for (i = 0; i < ISP32_MESH_BUF_NUM; i++) { |
|---|
| 2945 | | - if (!priv_val->buf_ldch[i].mem_priv) |
|---|
| 3038 | + if (!priv_val->buf_ldch[id][i].mem_priv) |
|---|
| 2946 | 3039 | continue; |
|---|
| 2947 | | - if (arg->buf_fd == priv_val->buf_ldch[i].dma_fd) |
|---|
| 3040 | + if (arg->buf_fd == priv_val->buf_ldch[id][i].dma_fd) |
|---|
| 2948 | 3041 | break; |
|---|
| 2949 | 3042 | } |
|---|
| 2950 | 3043 | if (i == ISP32_MESH_BUF_NUM) { |
|---|
| .. | .. |
|---|
| 2952 | 3045 | return; |
|---|
| 2953 | 3046 | } |
|---|
| 2954 | 3047 | |
|---|
| 2955 | | - if (!priv_val->buf_ldch[i].vaddr) { |
|---|
| 3048 | + if (!priv_val->buf_ldch[id][i].vaddr) { |
|---|
| 2956 | 3049 | dev_err(dev->dev, "no ldch buffer allocated\n"); |
|---|
| 2957 | 3050 | return; |
|---|
| 2958 | 3051 | } |
|---|
| 2959 | 3052 | |
|---|
| 2960 | | - buf_idx = priv_val->buf_ldch_idx; |
|---|
| 2961 | | - head = (struct isp2x_mesh_head *)priv_val->buf_ldch[buf_idx].vaddr; |
|---|
| 3053 | + buf_idx = priv_val->buf_ldch_idx[id]; |
|---|
| 3054 | + head = (struct isp2x_mesh_head *)priv_val->buf_ldch[id][buf_idx].vaddr; |
|---|
| 2962 | 3055 | head->stat = MESH_BUF_INIT; |
|---|
| 2963 | 3056 | |
|---|
| 2964 | 3057 | buf_idx = i; |
|---|
| 2965 | | - head = (struct isp2x_mesh_head *)priv_val->buf_ldch[buf_idx].vaddr; |
|---|
| 3058 | + head = (struct isp2x_mesh_head *)priv_val->buf_ldch[id][buf_idx].vaddr; |
|---|
| 2966 | 3059 | head->stat = MESH_BUF_CHIPINUSE; |
|---|
| 2967 | | - priv_val->buf_ldch_idx = buf_idx; |
|---|
| 2968 | | - rkisp_prepare_buffer(dev, &priv_val->buf_ldch[buf_idx]); |
|---|
| 2969 | | - value = priv_val->buf_ldch[buf_idx].dma_addr + head->data_oft; |
|---|
| 2970 | | - isp3_param_write(params_vdev, value, ISP3X_MI_LUT_LDCH_RD_BASE); |
|---|
| 2971 | | - isp3_param_write(params_vdev, arg->hsize, ISP3X_MI_LUT_LDCH_RD_H_WSIZE); |
|---|
| 2972 | | - isp3_param_write(params_vdev, arg->vsize, ISP3X_MI_LUT_LDCH_RD_V_SIZE); |
|---|
| 3060 | + priv_val->buf_ldch_idx[id] = buf_idx; |
|---|
| 3061 | + rkisp_prepare_buffer(dev, &priv_val->buf_ldch[id][buf_idx]); |
|---|
| 3062 | + value = priv_val->buf_ldch[id][buf_idx].dma_addr + head->data_oft; |
|---|
| 3063 | + isp3_param_write(params_vdev, value, ISP3X_MI_LUT_LDCH_RD_BASE, id); |
|---|
| 3064 | + isp3_param_write(params_vdev, arg->hsize, ISP3X_MI_LUT_LDCH_RD_H_WSIZE, id); |
|---|
| 3065 | + isp3_param_write(params_vdev, arg->vsize, ISP3X_MI_LUT_LDCH_RD_V_SIZE, id); |
|---|
| 2973 | 3066 | } |
|---|
| 2974 | 3067 | |
|---|
| 2975 | 3068 | static void |
|---|
| 2976 | | -isp_ldch_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 3069 | +isp_ldch_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 2977 | 3070 | { |
|---|
| 2978 | 3071 | struct rkisp_device *dev = params_vdev->dev; |
|---|
| 2979 | 3072 | struct rkisp_isp_params_val_v32 *priv_val; |
|---|
| .. | .. |
|---|
| 2981 | 3074 | |
|---|
| 2982 | 3075 | priv_val = (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 2983 | 3076 | if (en) { |
|---|
| 2984 | | - buf_idx = priv_val->buf_ldch_idx; |
|---|
| 2985 | | - if (!priv_val->buf_ldch[buf_idx].vaddr) { |
|---|
| 3077 | + buf_idx = priv_val->buf_ldch_idx[id]; |
|---|
| 3078 | + if (!priv_val->buf_ldch[id][buf_idx].vaddr) { |
|---|
| 2986 | 3079 | dev_err(dev->dev, "no ldch buffer allocated\n"); |
|---|
| 2987 | 3080 | return; |
|---|
| 2988 | 3081 | } |
|---|
| 2989 | | - isp3_param_set_bits(params_vdev, ISP3X_LDCH_STS, 0x01); |
|---|
| 3082 | + isp3_param_set_bits(params_vdev, ISP3X_LDCH_STS, 0x01, id); |
|---|
| 2990 | 3083 | } else { |
|---|
| 2991 | | - isp3_param_clear_bits(params_vdev, ISP3X_LDCH_STS, 0x01); |
|---|
| 3084 | + isp3_param_clear_bits(params_vdev, ISP3X_LDCH_STS, 0x01, id); |
|---|
| 2992 | 3085 | } |
|---|
| 2993 | 3086 | } |
|---|
| 2994 | 3087 | |
|---|
| 2995 | 3088 | static void |
|---|
| 2996 | 3089 | isp_ynr_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 2997 | | - const struct isp32_ynr_cfg *arg) |
|---|
| 3090 | + const struct isp32_ynr_cfg *arg, u32 id) |
|---|
| 2998 | 3091 | { |
|---|
| 2999 | 3092 | u32 i, value; |
|---|
| 3000 | 3093 | |
|---|
| 3001 | | - value = isp3_param_read(params_vdev, ISP3X_YNR_GLOBAL_CTRL); |
|---|
| 3094 | + value = isp3_param_read(params_vdev, ISP3X_YNR_GLOBAL_CTRL, id); |
|---|
| 3002 | 3095 | value &= ISP32_MODULE_EN; |
|---|
| 3003 | 3096 | |
|---|
| 3004 | 3097 | value |= !!arg->rnr_en << 26 | |
|---|
| .. | .. |
|---|
| 3011 | 3104 | !!arg->lgft3x3_bypass << 3 | |
|---|
| 3012 | 3105 | !!arg->lbft5x5_bypass << 2 | |
|---|
| 3013 | 3106 | !!arg->bft3x3_bypass << 1; |
|---|
| 3014 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_GLOBAL_CTRL); |
|---|
| 3107 | + isp3_param_write(params_vdev, value, ISP3X_YNR_GLOBAL_CTRL, id); |
|---|
| 3015 | 3108 | |
|---|
| 3016 | 3109 | value = ISP_PACK_2SHORT(arg->rnr_max_r, arg->local_gainscale); |
|---|
| 3017 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_RNR_MAX_R); |
|---|
| 3110 | + isp3_param_write(params_vdev, value, ISP3X_YNR_RNR_MAX_R, id); |
|---|
| 3018 | 3111 | |
|---|
| 3019 | 3112 | value = ISP_PACK_2SHORT(arg->rnr_center_coorh, arg->rnr_center_coorv); |
|---|
| 3020 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_RNR_CENTER_COOR); |
|---|
| 3113 | + isp3_param_write(params_vdev, value, ISP3X_YNR_RNR_CENTER_COOR, id); |
|---|
| 3021 | 3114 | |
|---|
| 3022 | 3115 | value = ISP_PACK_2SHORT(arg->loclagain_adj_thresh, arg->localgain_adj); |
|---|
| 3023 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_LOCAL_GAIN_CTRL); |
|---|
| 3116 | + isp3_param_write(params_vdev, value, ISP3X_YNR_LOCAL_GAIN_CTRL, id); |
|---|
| 3024 | 3117 | |
|---|
| 3025 | 3118 | value = ISP_PACK_2SHORT(arg->low_bf_inv0, arg->low_bf_inv1); |
|---|
| 3026 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_LOWNR_CTRL0); |
|---|
| 3119 | + isp3_param_write(params_vdev, value, ISP3X_YNR_LOWNR_CTRL0, id); |
|---|
| 3027 | 3120 | |
|---|
| 3028 | 3121 | value = ISP_PACK_2SHORT(arg->low_thred_adj, arg->low_peak_supress); |
|---|
| 3029 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_LOWNR_CTRL1); |
|---|
| 3122 | + isp3_param_write(params_vdev, value, ISP3X_YNR_LOWNR_CTRL1, id); |
|---|
| 3030 | 3123 | |
|---|
| 3031 | 3124 | value = ISP_PACK_2SHORT(arg->low_edge_adj_thresh, arg->low_dist_adj); |
|---|
| 3032 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_LOWNR_CTRL2); |
|---|
| 3125 | + isp3_param_write(params_vdev, value, ISP3X_YNR_LOWNR_CTRL2, id); |
|---|
| 3033 | 3126 | |
|---|
| 3034 | 3127 | value = (arg->low_bi_weight & 0xFF) << 24 | |
|---|
| 3035 | 3128 | (arg->low_weight & 0xFF) << 16 | |
|---|
| 3036 | 3129 | (arg->low_center_weight & 0xFFFF); |
|---|
| 3037 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_LOWNR_CTRL3); |
|---|
| 3130 | + isp3_param_write(params_vdev, value, ISP3X_YNR_LOWNR_CTRL3, id); |
|---|
| 3038 | 3131 | |
|---|
| 3039 | 3132 | value = ISP_PACK_2SHORT(arg->lbf_weight_thres, arg->frame_full_size); |
|---|
| 3040 | 3133 | if (params_vdev->dev->isp_ver == ISP_V32_L) |
|---|
| 3041 | 3134 | value |= (arg->frame_add4line & 0xf) << 12; |
|---|
| 3042 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_LOWNR_CTRL4); |
|---|
| 3135 | + isp3_param_write(params_vdev, value, ISP3X_YNR_LOWNR_CTRL4, id); |
|---|
| 3043 | 3136 | |
|---|
| 3044 | 3137 | value = (arg->low_gauss1_coeff2 & 0xFFFF) << 16 | |
|---|
| 3045 | 3138 | (arg->low_gauss1_coeff1 & 0xFF) << 8 | |
|---|
| 3046 | 3139 | (arg->low_gauss1_coeff0 & 0xFF); |
|---|
| 3047 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_GAUSS1_COEFF); |
|---|
| 3140 | + isp3_param_write(params_vdev, value, ISP3X_YNR_GAUSS1_COEFF, id); |
|---|
| 3048 | 3141 | |
|---|
| 3049 | 3142 | value = (arg->low_gauss2_coeff2 & 0xFFFF) << 16 | |
|---|
| 3050 | 3143 | (arg->low_gauss2_coeff1 & 0xFF) << 8 | |
|---|
| 3051 | 3144 | (arg->low_gauss2_coeff0 & 0xFF); |
|---|
| 3052 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_GAUSS2_COEFF); |
|---|
| 3145 | + isp3_param_write(params_vdev, value, ISP3X_YNR_GAUSS2_COEFF, id); |
|---|
| 3053 | 3146 | |
|---|
| 3054 | 3147 | for (i = 0; i < ISP32_YNR_XY_NUM / 2; i++) { |
|---|
| 3055 | 3148 | value = ISP_PACK_2SHORT(arg->luma_points_x[2 * i], |
|---|
| 3056 | 3149 | arg->luma_points_x[2 * i + 1]); |
|---|
| 3057 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_SGM_DX_0_1 + 4 * i); |
|---|
| 3150 | + isp3_param_write(params_vdev, value, ISP3X_YNR_SGM_DX_0_1 + 4 * i, id); |
|---|
| 3058 | 3151 | } |
|---|
| 3059 | 3152 | value = ISP_PACK_2SHORT(arg->luma_points_x[2 * i], 0); |
|---|
| 3060 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_SGM_DX_0_1 + 4 * i); |
|---|
| 3153 | + isp3_param_write(params_vdev, value, ISP3X_YNR_SGM_DX_0_1 + 4 * i, id); |
|---|
| 3061 | 3154 | |
|---|
| 3062 | 3155 | for (i = 0; i < ISP32_YNR_XY_NUM / 2; i++) { |
|---|
| 3063 | 3156 | value = ISP_PACK_2SHORT(arg->lsgm_y[2 * i], |
|---|
| 3064 | 3157 | arg->lsgm_y[2 * i + 1]); |
|---|
| 3065 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_LSGM_Y_0_1 + 4 * i); |
|---|
| 3158 | + isp3_param_write(params_vdev, value, ISP3X_YNR_LSGM_Y_0_1 + 4 * i, id); |
|---|
| 3066 | 3159 | } |
|---|
| 3067 | 3160 | value = ISP_PACK_2SHORT(arg->lsgm_y[2 * i], 0); |
|---|
| 3068 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_LSGM_Y_0_1 + 4 * i); |
|---|
| 3161 | + isp3_param_write(params_vdev, value, ISP3X_YNR_LSGM_Y_0_1 + 4 * i, id); |
|---|
| 3069 | 3162 | |
|---|
| 3070 | 3163 | for (i = 0; i < ISP32_YNR_XY_NUM / 4; i++) { |
|---|
| 3071 | 3164 | value = ISP_PACK_4BYTE(arg->rnr_strength3[4 * i], |
|---|
| 3072 | 3165 | arg->rnr_strength3[4 * i + 1], |
|---|
| 3073 | 3166 | arg->rnr_strength3[4 * i + 2], |
|---|
| 3074 | 3167 | arg->rnr_strength3[4 * i + 3]); |
|---|
| 3075 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_RNR_STRENGTH03 + 4 * i); |
|---|
| 3168 | + isp3_param_write(params_vdev, value, ISP3X_YNR_RNR_STRENGTH03 + 4 * i, id); |
|---|
| 3076 | 3169 | } |
|---|
| 3077 | 3170 | value = ISP_PACK_4BYTE(arg->rnr_strength3[4 * i], 0, 0, 0); |
|---|
| 3078 | | - isp3_param_write(params_vdev, value, ISP3X_YNR_RNR_STRENGTH03 + 4 * i); |
|---|
| 3171 | + isp3_param_write(params_vdev, value, ISP3X_YNR_RNR_STRENGTH03 + 4 * i, id); |
|---|
| 3079 | 3172 | |
|---|
| 3080 | 3173 | value = (arg->nlm_hi_bf_scale & 0x3ff) << 16 | |
|---|
| 3081 | 3174 | (arg->nlm_hi_gain_alpha & 0x1f) << 11 | |
|---|
| 3082 | 3175 | (arg->nlm_min_sigma & 0x7ff); |
|---|
| 3083 | | - isp3_param_write(params_vdev, value, ISP32_YNR_NLM_SIGMA_GAIN); |
|---|
| 3176 | + isp3_param_write(params_vdev, value, ISP32_YNR_NLM_SIGMA_GAIN, id); |
|---|
| 3084 | 3177 | |
|---|
| 3085 | 3178 | value = (arg->nlm_coe[5] & 0xf) << 20 | (arg->nlm_coe[4] & 0xf) << 16 | |
|---|
| 3086 | 3179 | (arg->nlm_coe[3] & 0xf) << 12 | (arg->nlm_coe[2] & 0xf) << 8 | |
|---|
| 3087 | 3180 | (arg->nlm_coe[1] & 0xf) << 4 | (arg->nlm_coe[0] & 0xf); |
|---|
| 3088 | | - isp3_param_write(params_vdev, value, ISP32_YNR_NLM_COE); |
|---|
| 3181 | + isp3_param_write(params_vdev, value, ISP32_YNR_NLM_COE, id); |
|---|
| 3089 | 3182 | |
|---|
| 3090 | 3183 | value = (arg->nlm_center_weight & 0x3ffff) << 10 | (arg->nlm_weight_offset & 0x3ff); |
|---|
| 3091 | | - isp3_param_write(params_vdev, value, ISP32_YNR_NLM_WEIGHT); |
|---|
| 3184 | + isp3_param_write(params_vdev, value, ISP32_YNR_NLM_WEIGHT, id); |
|---|
| 3092 | 3185 | |
|---|
| 3093 | 3186 | value = arg->nlm_nr_weight & 0x7ff; |
|---|
| 3094 | | - isp3_param_write(params_vdev, value, ISP32_YNR_NLM_NR_WEIGHT); |
|---|
| 3187 | + isp3_param_write(params_vdev, value, ISP32_YNR_NLM_NR_WEIGHT, id); |
|---|
| 3095 | 3188 | } |
|---|
| 3096 | 3189 | |
|---|
| 3097 | 3190 | static void |
|---|
| 3098 | | -isp_ynr_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 3191 | +isp_ynr_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 3099 | 3192 | { |
|---|
| 3100 | 3193 | u32 ynr_ctrl; |
|---|
| 3101 | 3194 | bool real_en; |
|---|
| 3102 | 3195 | |
|---|
| 3103 | | - ynr_ctrl = isp3_param_read_cache(params_vdev, ISP3X_YNR_GLOBAL_CTRL); |
|---|
| 3196 | + ynr_ctrl = isp3_param_read_cache(params_vdev, ISP3X_YNR_GLOBAL_CTRL, id); |
|---|
| 3104 | 3197 | real_en = !!(ynr_ctrl & ISP32_MODULE_EN); |
|---|
| 3105 | 3198 | if ((en && real_en) || (!en && !real_en)) |
|---|
| 3106 | 3199 | return; |
|---|
| .. | .. |
|---|
| 3108 | 3201 | if (en) { |
|---|
| 3109 | 3202 | ynr_ctrl |= ISP32_MODULE_EN; |
|---|
| 3110 | 3203 | isp3_param_set_bits(params_vdev, ISP3X_ISP_CTRL1, |
|---|
| 3111 | | - ISP3X_YNR_FST_FRAME); |
|---|
| 3204 | + ISP3X_YNR_FST_FRAME, id); |
|---|
| 3112 | 3205 | } else { |
|---|
| 3113 | 3206 | ynr_ctrl &= ~ISP32_MODULE_EN; |
|---|
| 3114 | 3207 | } |
|---|
| 3115 | 3208 | |
|---|
| 3116 | | - isp3_param_write(params_vdev, ynr_ctrl, ISP3X_YNR_GLOBAL_CTRL); |
|---|
| 3209 | + isp3_param_write(params_vdev, ynr_ctrl, ISP3X_YNR_GLOBAL_CTRL, id); |
|---|
| 3117 | 3210 | } |
|---|
| 3118 | 3211 | |
|---|
| 3119 | 3212 | static void |
|---|
| 3120 | 3213 | isp_cnr_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 3121 | | - const struct isp32_cnr_cfg *arg) |
|---|
| 3214 | + const struct isp32_cnr_cfg *arg, u32 id) |
|---|
| 3122 | 3215 | { |
|---|
| 3123 | 3216 | u32 i, value, ctrl, gain_ctrl; |
|---|
| 3124 | 3217 | |
|---|
| 3125 | | - gain_ctrl = isp3_param_read(params_vdev, ISP3X_GAIN_CTRL); |
|---|
| 3126 | | - ctrl = isp3_param_read(params_vdev, ISP3X_CNR_CTRL); |
|---|
| 3218 | + gain_ctrl = isp3_param_read(params_vdev, ISP3X_GAIN_CTRL, id); |
|---|
| 3219 | + ctrl = isp3_param_read(params_vdev, ISP3X_CNR_CTRL, id); |
|---|
| 3127 | 3220 | ctrl &= ISP32_MODULE_EN; |
|---|
| 3128 | 3221 | |
|---|
| 3129 | 3222 | ctrl |= !!arg->bf3x3_wgt0_sel << 8 | |
|---|
| .. | .. |
|---|
| 3139 | 3232 | value &= ~ISP3X_CNR_GLOBAL_GAIN_ALPHA_MAX; |
|---|
| 3140 | 3233 | value |= BIT(15); |
|---|
| 3141 | 3234 | } |
|---|
| 3142 | | - isp3_param_write(params_vdev, ctrl, ISP3X_CNR_CTRL); |
|---|
| 3143 | | - isp3_param_write(params_vdev, value, ISP3X_CNR_EXGAIN); |
|---|
| 3235 | + isp3_param_write(params_vdev, ctrl, ISP3X_CNR_CTRL, id); |
|---|
| 3236 | + isp3_param_write(params_vdev, value, ISP3X_CNR_EXGAIN, id); |
|---|
| 3144 | 3237 | |
|---|
| 3145 | 3238 | value = ISP_PACK_2SHORT(arg->thumb_sigma_c, arg->thumb_sigma_y); |
|---|
| 3146 | | - isp3_param_write(params_vdev, value, ISP32_CNR_THUMB1); |
|---|
| 3239 | + isp3_param_write(params_vdev, value, ISP32_CNR_THUMB1, id); |
|---|
| 3147 | 3240 | |
|---|
| 3148 | 3241 | value = arg->thumb_bf_ratio & 0x7ff; |
|---|
| 3149 | | - isp3_param_write(params_vdev, value, ISP32_CNR_THUMB_BF_RATIO); |
|---|
| 3242 | + isp3_param_write(params_vdev, value, ISP32_CNR_THUMB_BF_RATIO, id); |
|---|
| 3150 | 3243 | |
|---|
| 3151 | 3244 | value = ISP_PACK_4BYTE(arg->lbf1x7_weit_d0, arg->lbf1x7_weit_d1, |
|---|
| 3152 | 3245 | arg->lbf1x7_weit_d2, arg->lbf1x7_weit_d3); |
|---|
| 3153 | | - isp3_param_write(params_vdev, value, ISP32_CNR_LBF_WEITD); |
|---|
| 3246 | + isp3_param_write(params_vdev, value, ISP32_CNR_LBF_WEITD, id); |
|---|
| 3154 | 3247 | |
|---|
| 3155 | 3248 | value = (arg->wgt_slope & 0x3ff) << 20 | (arg->exp_shift & 0x3f) << 12 | |
|---|
| 3156 | 3249 | arg->iir_strength << 4 | (arg->iir_uvgain & 0xf); |
|---|
| 3157 | | - isp3_param_write(params_vdev, value, ISP32_CNR_IIR_PARA1); |
|---|
| 3250 | + isp3_param_write(params_vdev, value, ISP32_CNR_IIR_PARA1, id); |
|---|
| 3158 | 3251 | |
|---|
| 3159 | 3252 | value = ISP_PACK_4BYTE(arg->chroma_ghost, arg->iir_uv_clip, 0, 0); |
|---|
| 3160 | | - isp3_param_write(params_vdev, value, ISP32_CNR_IIR_PARA2); |
|---|
| 3253 | + isp3_param_write(params_vdev, value, ISP32_CNR_IIR_PARA2, id); |
|---|
| 3161 | 3254 | |
|---|
| 3162 | 3255 | value = ISP_PACK_4BYTE(arg->gaus_coe[0], arg->gaus_coe[1], |
|---|
| 3163 | 3256 | arg->gaus_coe[2], arg->gaus_coe[3]); |
|---|
| 3164 | | - isp3_param_write(params_vdev, value, ISP32_CNR_GAUS_COE1); |
|---|
| 3257 | + isp3_param_write(params_vdev, value, ISP32_CNR_GAUS_COE1, id); |
|---|
| 3165 | 3258 | |
|---|
| 3166 | 3259 | value = ISP_PACK_4BYTE(arg->gaus_coe[4], arg->gaus_coe[5], 0, 0); |
|---|
| 3167 | | - isp3_param_write(params_vdev, value, ISP32_CNR_GAUS_COE2); |
|---|
| 3260 | + isp3_param_write(params_vdev, value, ISP32_CNR_GAUS_COE2, id); |
|---|
| 3168 | 3261 | |
|---|
| 3169 | 3262 | value = (arg->global_alpha & 0x7ff) << 20 | arg->bf_wgt_clip << 12 | |
|---|
| 3170 | 3263 | (arg->gaus_ratio & 0x7ff); |
|---|
| 3171 | | - isp3_param_write(params_vdev, value, ISP32_CNR_GAUS_RATIO); |
|---|
| 3264 | + isp3_param_write(params_vdev, value, ISP32_CNR_GAUS_RATIO, id); |
|---|
| 3172 | 3265 | |
|---|
| 3173 | 3266 | value = arg->bf_ratio << 24 | (arg->sigma_r & 0x3fff) << 8 | |
|---|
| 3174 | 3267 | (arg->uv_gain & 0x7f); |
|---|
| 3175 | | - isp3_param_write(params_vdev, value, ISP32_CNR_BF_PARA1); |
|---|
| 3268 | + isp3_param_write(params_vdev, value, ISP32_CNR_BF_PARA1, id); |
|---|
| 3176 | 3269 | |
|---|
| 3177 | 3270 | value = (arg->adj_ratio & 0x7fff) << 16 | (arg->adj_offset & 0x1ff); |
|---|
| 3178 | | - isp3_param_write(params_vdev, value, ISP32_CNR_BF_PARA2); |
|---|
| 3271 | + isp3_param_write(params_vdev, value, ISP32_CNR_BF_PARA2, id); |
|---|
| 3179 | 3272 | |
|---|
| 3180 | 3273 | for (i = 0; i < ISP32_CNR_SIGMA_Y_NUM / 4; i++) { |
|---|
| 3181 | 3274 | value = ISP_PACK_4BYTE(arg->sigma_y[i * 4], arg->sigma_y[i * 4 + 1], |
|---|
| 3182 | 3275 | arg->sigma_y[i * 4 + 2], arg->sigma_y[i * 4 + 3]); |
|---|
| 3183 | | - isp3_param_write(params_vdev, value, ISP32_CNR_SIGMA0 + i * 4); |
|---|
| 3276 | + isp3_param_write(params_vdev, value, ISP32_CNR_SIGMA0 + i * 4, id); |
|---|
| 3184 | 3277 | } |
|---|
| 3185 | 3278 | value = arg->sigma_y[i * 4]; |
|---|
| 3186 | | - isp3_param_write(params_vdev, value, ISP32_CNR_SIGMA0 + i * 4); |
|---|
| 3279 | + isp3_param_write(params_vdev, value, ISP32_CNR_SIGMA0 + i * 4, id); |
|---|
| 3187 | 3280 | |
|---|
| 3188 | 3281 | value = (arg->iir_gain_alpha & 0xf) << 8 | arg->iir_global_gain; |
|---|
| 3189 | | - isp3_param_write(params_vdev, value, ISP32_CNR_IIR_GLOBAL_GAIN); |
|---|
| 3282 | + isp3_param_write(params_vdev, value, ISP32_CNR_IIR_GLOBAL_GAIN, id); |
|---|
| 3190 | 3283 | } |
|---|
| 3191 | 3284 | |
|---|
| 3192 | 3285 | static void |
|---|
| 3193 | | -isp_cnr_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 3286 | +isp_cnr_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 3194 | 3287 | { |
|---|
| 3195 | 3288 | u32 cnr_ctrl; |
|---|
| 3196 | 3289 | bool real_en; |
|---|
| 3197 | 3290 | |
|---|
| 3198 | | - cnr_ctrl = isp3_param_read_cache(params_vdev, ISP3X_CNR_CTRL); |
|---|
| 3291 | + cnr_ctrl = isp3_param_read_cache(params_vdev, ISP3X_CNR_CTRL, id); |
|---|
| 3199 | 3292 | real_en = !!(cnr_ctrl & ISP32_MODULE_EN); |
|---|
| 3200 | 3293 | if ((en && real_en) || (!en && !real_en)) |
|---|
| 3201 | 3294 | return; |
|---|
| .. | .. |
|---|
| 3203 | 3296 | if (en) { |
|---|
| 3204 | 3297 | cnr_ctrl |= ISP32_MODULE_EN; |
|---|
| 3205 | 3298 | isp3_param_set_bits(params_vdev, ISP3X_ISP_CTRL1, |
|---|
| 3206 | | - ISP3X_CNR_FST_FRAME); |
|---|
| 3299 | + ISP3X_CNR_FST_FRAME, id); |
|---|
| 3207 | 3300 | } else { |
|---|
| 3208 | 3301 | cnr_ctrl &= ~ISP32_MODULE_EN; |
|---|
| 3209 | 3302 | } |
|---|
| 3210 | 3303 | |
|---|
| 3211 | | - isp3_param_write(params_vdev, cnr_ctrl, ISP3X_CNR_CTRL); |
|---|
| 3304 | + isp3_param_write(params_vdev, cnr_ctrl, ISP3X_CNR_CTRL, id); |
|---|
| 3212 | 3305 | } |
|---|
| 3213 | 3306 | |
|---|
| 3214 | 3307 | static void |
|---|
| 3215 | 3308 | isp_sharp_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 3216 | | - const struct isp32_sharp_cfg *arg) |
|---|
| 3309 | + const struct isp32_sharp_cfg *arg, u32 id) |
|---|
| 3217 | 3310 | { |
|---|
| 3218 | 3311 | u32 i, value; |
|---|
| 3219 | 3312 | |
|---|
| 3220 | | - value = isp3_param_read(params_vdev, ISP3X_SHARP_EN); |
|---|
| 3313 | + value = isp3_param_read(params_vdev, ISP3X_SHARP_EN, id); |
|---|
| 3221 | 3314 | value &= ISP32_MODULE_EN; |
|---|
| 3222 | 3315 | |
|---|
| 3223 | 3316 | value |= !!arg->bypass << 1 | |
|---|
| .. | .. |
|---|
| 3229 | 3322 | else |
|---|
| 3230 | 3323 | value |= !!arg->clip_hf_mode << 6 | |
|---|
| 3231 | 3324 | !!arg->add_mode << 7; |
|---|
| 3232 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_EN); |
|---|
| 3325 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_EN, id); |
|---|
| 3233 | 3326 | |
|---|
| 3234 | 3327 | value = ISP_PACK_4BYTE(arg->pbf_ratio, arg->gaus_ratio, |
|---|
| 3235 | 3328 | arg->bf_ratio, arg->sharp_ratio); |
|---|
| 3236 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_RATIO); |
|---|
| 3329 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_RATIO, id); |
|---|
| 3237 | 3330 | |
|---|
| 3238 | 3331 | value = (arg->luma_dx[6] & 0x0F) << 24 | |
|---|
| 3239 | 3332 | (arg->luma_dx[5] & 0x0F) << 20 | |
|---|
| .. | .. |
|---|
| 3242 | 3335 | (arg->luma_dx[2] & 0x0F) << 8 | |
|---|
| 3243 | 3336 | (arg->luma_dx[1] & 0x0F) << 4 | |
|---|
| 3244 | 3337 | (arg->luma_dx[0] & 0x0F); |
|---|
| 3245 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_LUMA_DX); |
|---|
| 3338 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_LUMA_DX, id); |
|---|
| 3246 | 3339 | |
|---|
| 3247 | 3340 | value = (arg->pbf_sigma_inv[2] & 0x3FF) << 20 | |
|---|
| 3248 | 3341 | (arg->pbf_sigma_inv[1] & 0x3FF) << 10 | |
|---|
| 3249 | 3342 | (arg->pbf_sigma_inv[0] & 0x3FF); |
|---|
| 3250 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_PBF_SIGMA_INV_0); |
|---|
| 3343 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_PBF_SIGMA_INV_0, id); |
|---|
| 3251 | 3344 | |
|---|
| 3252 | 3345 | value = (arg->pbf_sigma_inv[5] & 0x3FF) << 20 | |
|---|
| 3253 | 3346 | (arg->pbf_sigma_inv[4] & 0x3FF) << 10 | |
|---|
| 3254 | 3347 | (arg->pbf_sigma_inv[3] & 0x3FF); |
|---|
| 3255 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_PBF_SIGMA_INV_1); |
|---|
| 3348 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_PBF_SIGMA_INV_1, id); |
|---|
| 3256 | 3349 | |
|---|
| 3257 | 3350 | value = (arg->pbf_sigma_inv[7] & 0x3FF) << 10 | |
|---|
| 3258 | 3351 | (arg->pbf_sigma_inv[6] & 0x3FF); |
|---|
| 3259 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_PBF_SIGMA_INV_2); |
|---|
| 3352 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_PBF_SIGMA_INV_2, id); |
|---|
| 3260 | 3353 | |
|---|
| 3261 | 3354 | value = (arg->bf_sigma_inv[2] & 0x3FF) << 20 | |
|---|
| 3262 | 3355 | (arg->bf_sigma_inv[1] & 0x3FF) << 10 | |
|---|
| 3263 | 3356 | (arg->bf_sigma_inv[0] & 0x3FF); |
|---|
| 3264 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_BF_SIGMA_INV_0); |
|---|
| 3357 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_BF_SIGMA_INV_0, id); |
|---|
| 3265 | 3358 | |
|---|
| 3266 | 3359 | value = (arg->bf_sigma_inv[5] & 0x3FF) << 20 | |
|---|
| 3267 | 3360 | (arg->bf_sigma_inv[4] & 0x3FF) << 10 | |
|---|
| 3268 | 3361 | (arg->bf_sigma_inv[3] & 0x3FF); |
|---|
| 3269 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_BF_SIGMA_INV_1); |
|---|
| 3362 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_BF_SIGMA_INV_1, id); |
|---|
| 3270 | 3363 | |
|---|
| 3271 | 3364 | value = (arg->bf_sigma_inv[7] & 0x3FF) << 10 | |
|---|
| 3272 | 3365 | (arg->bf_sigma_inv[6] & 0x3FF); |
|---|
| 3273 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_BF_SIGMA_INV_2); |
|---|
| 3366 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_BF_SIGMA_INV_2, id); |
|---|
| 3274 | 3367 | |
|---|
| 3275 | 3368 | value = (arg->bf_sigma_shift & 0x0F) << 4 | |
|---|
| 3276 | 3369 | (arg->pbf_sigma_shift & 0x0F); |
|---|
| 3277 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_SIGMA_SHIFT); |
|---|
| 3370 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_SIGMA_SHIFT, id); |
|---|
| 3278 | 3371 | |
|---|
| 3279 | 3372 | value = (arg->clip_hf[2] & 0x3FF) << 20 | |
|---|
| 3280 | 3373 | (arg->clip_hf[1] & 0x3FF) << 10 | |
|---|
| 3281 | 3374 | (arg->clip_hf[0] & 0x3FF); |
|---|
| 3282 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_CLIP_HF_0); |
|---|
| 3375 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_CLIP_HF_0, id); |
|---|
| 3283 | 3376 | |
|---|
| 3284 | 3377 | value = (arg->clip_hf[5] & 0x3FF) << 20 | |
|---|
| 3285 | 3378 | (arg->clip_hf[4] & 0x3FF) << 10 | |
|---|
| 3286 | 3379 | (arg->clip_hf[3] & 0x3FF); |
|---|
| 3287 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_CLIP_HF_1); |
|---|
| 3380 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_CLIP_HF_1, id); |
|---|
| 3288 | 3381 | |
|---|
| 3289 | 3382 | value = (arg->clip_hf[7] & 0x3FF) << 10 | |
|---|
| 3290 | 3383 | (arg->clip_hf[6] & 0x3FF); |
|---|
| 3291 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_CLIP_HF_2); |
|---|
| 3384 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_CLIP_HF_2, id); |
|---|
| 3292 | 3385 | |
|---|
| 3293 | 3386 | value = ISP_PACK_4BYTE(arg->pbf_coef0, arg->pbf_coef1, arg->pbf_coef2, 0); |
|---|
| 3294 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_PBF_COEF); |
|---|
| 3387 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_PBF_COEF, id); |
|---|
| 3295 | 3388 | |
|---|
| 3296 | 3389 | value = ISP_PACK_4BYTE(arg->bf_coef0, arg->bf_coef1, arg->bf_coef2, 0); |
|---|
| 3297 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_BF_COEF); |
|---|
| 3390 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_BF_COEF, id); |
|---|
| 3298 | 3391 | |
|---|
| 3299 | 3392 | value = ISP_PACK_4BYTE(arg->gaus_coef[0], arg->gaus_coef[1], arg->gaus_coef[2], 0); |
|---|
| 3300 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_GAUS_COEF0); |
|---|
| 3393 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_GAUS_COEF0, id); |
|---|
| 3301 | 3394 | |
|---|
| 3302 | 3395 | value = ISP_PACK_4BYTE(arg->gaus_coef[3], arg->gaus_coef[4], arg->gaus_coef[5], 0); |
|---|
| 3303 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_GAUS_COEF1); |
|---|
| 3396 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_GAUS_COEF1, id); |
|---|
| 3304 | 3397 | |
|---|
| 3305 | 3398 | value = arg->local_gainscale << 24 | (arg->global_gain_alpha & 0xf) << 16 | |
|---|
| 3306 | 3399 | (arg->global_gain & 0x3ff); |
|---|
| 3307 | | - isp3_param_write(params_vdev, value, ISP32_SHARP_GAIN); |
|---|
| 3400 | + isp3_param_write(params_vdev, value, ISP32_SHARP_GAIN, id); |
|---|
| 3308 | 3401 | |
|---|
| 3309 | 3402 | for (i = 0; i < ISP32_SHARP_GAIN_ADJ_NUM / 2; i++) { |
|---|
| 3310 | 3403 | value = ISP_PACK_2SHORT(arg->gain_adj[i * 2], arg->gain_adj[i * 2 + 1]); |
|---|
| 3311 | | - isp3_param_write(params_vdev, value, ISP32_SHARP_GAIN_ADJUST0 + i * 4); |
|---|
| 3404 | + isp3_param_write(params_vdev, value, ISP32_SHARP_GAIN_ADJUST0 + i * 4, id); |
|---|
| 3312 | 3405 | } |
|---|
| 3313 | 3406 | |
|---|
| 3314 | 3407 | value = ISP_PACK_2SHORT(arg->center_wid, arg->center_het); |
|---|
| 3315 | | - isp3_param_write(params_vdev, value, ISP32_SHARP_CENTER); |
|---|
| 3408 | + isp3_param_write(params_vdev, value, ISP32_SHARP_CENTER, id); |
|---|
| 3316 | 3409 | |
|---|
| 3317 | 3410 | for (i = 0; i < ISP32_SHARP_STRENGTH_NUM / 4; i++) { |
|---|
| 3318 | 3411 | value = ISP_PACK_4BYTE(arg->strength[i * 4], arg->strength[i * 4 + 1], |
|---|
| 3319 | 3412 | arg->strength[i * 4 + 2], arg->strength[i * 4 + 3]); |
|---|
| 3320 | | - isp3_param_write(params_vdev, value, ISP32_SHARP_GAIN_DIS_STRENGTH0 + i * 4); |
|---|
| 3413 | + isp3_param_write(params_vdev, value, ISP32_SHARP_GAIN_DIS_STRENGTH0 + i * 4, id); |
|---|
| 3321 | 3414 | } |
|---|
| 3322 | 3415 | value = ISP_PACK_4BYTE(arg->strength[i * 4], arg->strength[i * 4 + 1], 0, 0); |
|---|
| 3323 | | - isp3_param_write(params_vdev, value, ISP32_SHARP_GAIN_DIS_STRENGTH0 + i * 4); |
|---|
| 3416 | + isp3_param_write(params_vdev, value, ISP32_SHARP_GAIN_DIS_STRENGTH0 + i * 4, id); |
|---|
| 3324 | 3417 | |
|---|
| 3325 | 3418 | if (params_vdev->dev->isp_ver == ISP_V32) { |
|---|
| 3326 | 3419 | value = (arg->noise_strength & 0x3fff) << 16 | (arg->enhance_bit & 0xf) << 12 | |
|---|
| 3327 | 3420 | (arg->noise_sigma & 0x3ff); |
|---|
| 3328 | | - isp3_param_write(params_vdev, value, ISP32_SHARP_TEXTURE); |
|---|
| 3421 | + isp3_param_write(params_vdev, value, ISP32_SHARP_TEXTURE, id); |
|---|
| 3329 | 3422 | } else { |
|---|
| 3330 | 3423 | value = (arg->ehf_th[2] & 0x3FF) << 20 | |
|---|
| 3331 | 3424 | (arg->ehf_th[1] & 0x3FF) << 10 | |
|---|
| 3332 | 3425 | (arg->ehf_th[0] & 0x3FF); |
|---|
| 3333 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_EHF_TH_0); |
|---|
| 3426 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_EHF_TH_0, id); |
|---|
| 3334 | 3427 | value = (arg->ehf_th[5] & 0x3FF) << 20 | |
|---|
| 3335 | 3428 | (arg->ehf_th[4] & 0x3FF) << 10 | |
|---|
| 3336 | 3429 | (arg->ehf_th[3] & 0x3FF); |
|---|
| 3337 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_EHF_TH_1); |
|---|
| 3430 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_EHF_TH_1, id); |
|---|
| 3338 | 3431 | value = (arg->ehf_th[7] & 0x3FF) << 10 | |
|---|
| 3339 | 3432 | (arg->ehf_th[6] & 0x3FF); |
|---|
| 3340 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_EHF_TH_2); |
|---|
| 3433 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_EHF_TH_2, id); |
|---|
| 3341 | 3434 | |
|---|
| 3342 | 3435 | value = (arg->clip_neg[2] & 0x3FF) << 20 | |
|---|
| 3343 | 3436 | (arg->clip_neg[1] & 0x3FF) << 10 | |
|---|
| 3344 | 3437 | (arg->clip_neg[0] & 0x3FF); |
|---|
| 3345 | | - isp3_param_write(params_vdev, value, ISP32L_SHARP_CLIP_NEG_0); |
|---|
| 3438 | + isp3_param_write(params_vdev, value, ISP32L_SHARP_CLIP_NEG_0, id); |
|---|
| 3346 | 3439 | value = (arg->clip_neg[5] & 0x3FF) << 20 | |
|---|
| 3347 | 3440 | (arg->clip_neg[4] & 0x3FF) << 10 | |
|---|
| 3348 | 3441 | (arg->clip_neg[3] & 0x3FF); |
|---|
| 3349 | | - isp3_param_write(params_vdev, value, ISP32L_SHARP_CLIP_NEG_1); |
|---|
| 3442 | + isp3_param_write(params_vdev, value, ISP32L_SHARP_CLIP_NEG_1, id); |
|---|
| 3350 | 3443 | value = (arg->clip_neg[7] & 0x3FF) << 10 | |
|---|
| 3351 | 3444 | (arg->clip_neg[6] & 0x3FF); |
|---|
| 3352 | | - isp3_param_write(params_vdev, value, ISP32L_SHARP_CLIP_NEG_2); |
|---|
| 3445 | + isp3_param_write(params_vdev, value, ISP32L_SHARP_CLIP_NEG_2, id); |
|---|
| 3353 | 3446 | } |
|---|
| 3354 | 3447 | } |
|---|
| 3355 | 3448 | |
|---|
| 3356 | 3449 | static void |
|---|
| 3357 | | -isp_sharp_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 3450 | +isp_sharp_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 3358 | 3451 | { |
|---|
| 3359 | 3452 | u32 value; |
|---|
| 3360 | 3453 | |
|---|
| 3361 | | - value = isp3_param_read_cache(params_vdev, ISP3X_SHARP_EN); |
|---|
| 3454 | + value = isp3_param_read_cache(params_vdev, ISP3X_SHARP_EN, id); |
|---|
| 3455 | + if ((en && (value & ISP32_MODULE_EN)) || |
|---|
| 3456 | + (!en && !(value & ISP32_MODULE_EN))) |
|---|
| 3457 | + return; |
|---|
| 3458 | + |
|---|
| 3362 | 3459 | value &= ~ISP32_MODULE_EN; |
|---|
| 3363 | | - |
|---|
| 3364 | | - if (en) |
|---|
| 3460 | + if (en) { |
|---|
| 3461 | + isp3_param_set_bits(params_vdev, |
|---|
| 3462 | + ISP3X_ISP_CTRL1, ISP32_SHP_FST_FRAME, id); |
|---|
| 3365 | 3463 | value |= ISP32_MODULE_EN; |
|---|
| 3366 | | - |
|---|
| 3367 | | - isp3_param_write(params_vdev, value, ISP3X_SHARP_EN); |
|---|
| 3464 | + } |
|---|
| 3465 | + isp3_param_write(params_vdev, value, ISP3X_SHARP_EN, id); |
|---|
| 3368 | 3466 | } |
|---|
| 3369 | 3467 | |
|---|
| 3370 | 3468 | static void |
|---|
| 3371 | 3469 | isp_baynr_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 3372 | | - const struct isp32_baynr_cfg *arg) |
|---|
| 3470 | + const struct isp32_baynr_cfg *arg, u32 id) |
|---|
| 3373 | 3471 | { |
|---|
| 3374 | 3472 | u32 i, value; |
|---|
| 3375 | 3473 | |
|---|
| 3376 | | - value = isp3_param_read(params_vdev, ISP3X_BAYNR_CTRL); |
|---|
| 3474 | + value = isp3_param_read(params_vdev, ISP3X_BAYNR_CTRL, id); |
|---|
| 3377 | 3475 | value &= ISP32_MODULE_EN; |
|---|
| 3378 | 3476 | |
|---|
| 3379 | 3477 | value |= !!arg->bay3d_gain_en << 16 | |
|---|
| 3380 | 3478 | (arg->lg2_mode & 0x3) << 12 | |
|---|
| 3381 | 3479 | !!arg->gauss_en << 8 | |
|---|
| 3382 | 3480 | !!arg->log_bypass << 4; |
|---|
| 3383 | | - isp3_param_write(params_vdev, value, ISP3X_BAYNR_CTRL); |
|---|
| 3481 | + isp3_param_write(params_vdev, value, ISP3X_BAYNR_CTRL, id); |
|---|
| 3384 | 3482 | |
|---|
| 3385 | 3483 | value = ISP_PACK_2SHORT(arg->dgain0, arg->dgain1); |
|---|
| 3386 | | - isp3_param_write(params_vdev, value, ISP3X_BAYNR_DGAIN0); |
|---|
| 3484 | + isp3_param_write(params_vdev, value, ISP3X_BAYNR_DGAIN0, id); |
|---|
| 3387 | 3485 | |
|---|
| 3388 | | - isp3_param_write(params_vdev, arg->dgain2, ISP3X_BAYNR_DGAIN1); |
|---|
| 3389 | | - isp3_param_write(params_vdev, arg->pix_diff, ISP3X_BAYNR_PIXDIFF); |
|---|
| 3486 | + isp3_param_write(params_vdev, arg->dgain2, ISP3X_BAYNR_DGAIN1, id); |
|---|
| 3487 | + isp3_param_write(params_vdev, arg->pix_diff, ISP3X_BAYNR_PIXDIFF, id); |
|---|
| 3390 | 3488 | |
|---|
| 3391 | 3489 | value = ISP_PACK_2SHORT(arg->softthld, arg->diff_thld); |
|---|
| 3392 | | - isp3_param_write(params_vdev, value, ISP3X_BAYNR_THLD); |
|---|
| 3490 | + isp3_param_write(params_vdev, value, ISP3X_BAYNR_THLD, id); |
|---|
| 3393 | 3491 | |
|---|
| 3394 | 3492 | value = ISP_PACK_2SHORT(arg->reg_w1, arg->bltflt_streng); |
|---|
| 3395 | | - isp3_param_write(params_vdev, value, ISP3X_BAYNR_W1_STRENG); |
|---|
| 3493 | + isp3_param_write(params_vdev, value, ISP3X_BAYNR_W1_STRENG, id); |
|---|
| 3396 | 3494 | |
|---|
| 3397 | 3495 | for (i = 0; i < ISP32_BAYNR_XY_NUM / 2; i++) { |
|---|
| 3398 | 3496 | value = ISP_PACK_2SHORT(arg->sigma_x[2 * i], arg->sigma_x[2 * i + 1]); |
|---|
| 3399 | | - isp3_param_write(params_vdev, value, ISP3X_BAYNR_SIGMAX01 + 4 * i); |
|---|
| 3497 | + isp3_param_write(params_vdev, value, ISP3X_BAYNR_SIGMAX01 + 4 * i, id); |
|---|
| 3400 | 3498 | } |
|---|
| 3401 | 3499 | |
|---|
| 3402 | 3500 | for (i = 0; i < ISP32_BAYNR_XY_NUM / 2; i++) { |
|---|
| 3403 | 3501 | value = ISP_PACK_2SHORT(arg->sigma_y[2 * i], arg->sigma_y[2 * i + 1]); |
|---|
| 3404 | | - isp3_param_write(params_vdev, value, ISP3X_BAYNR_SIGMAY01 + 4 * i); |
|---|
| 3502 | + isp3_param_write(params_vdev, value, ISP3X_BAYNR_SIGMAY01 + 4 * i, id); |
|---|
| 3405 | 3503 | } |
|---|
| 3406 | 3504 | |
|---|
| 3407 | 3505 | value = (arg->weit_d2 & 0x3FF) << 20 | |
|---|
| 3408 | 3506 | (arg->weit_d1 & 0x3FF) << 10 | |
|---|
| 3409 | 3507 | (arg->weit_d0 & 0x3FF); |
|---|
| 3410 | | - isp3_param_write(params_vdev, value, ISP3X_BAYNR_WRIT_D); |
|---|
| 3508 | + isp3_param_write(params_vdev, value, ISP3X_BAYNR_WRIT_D, id); |
|---|
| 3411 | 3509 | |
|---|
| 3412 | 3510 | value = ISP_PACK_2SHORT(arg->lg2_off, arg->lg2_lgoff); |
|---|
| 3413 | | - isp3_param_write(params_vdev, value, ISP3X_BAYNR_LG_OFF); |
|---|
| 3511 | + isp3_param_write(params_vdev, value, ISP3X_BAYNR_LG_OFF, id); |
|---|
| 3414 | 3512 | |
|---|
| 3415 | 3513 | value = arg->dat_max & 0xfffff; |
|---|
| 3416 | | - isp3_param_write(params_vdev, value, ISP3X_BAYNR_DAT_MAX); |
|---|
| 3514 | + isp3_param_write(params_vdev, value, ISP3X_BAYNR_DAT_MAX, id); |
|---|
| 3417 | 3515 | |
|---|
| 3418 | 3516 | value = ISP_PACK_2SHORT(arg->rgain_off, arg->bgain_off); |
|---|
| 3419 | | - isp3_param_write(params_vdev, value, ISP32_BAYNR_SIGOFF); |
|---|
| 3517 | + isp3_param_write(params_vdev, value, ISP32_BAYNR_SIGOFF, id); |
|---|
| 3420 | 3518 | |
|---|
| 3421 | 3519 | for (i = 0; i < ISP32_BAYNR_GAIN_NUM / 4; i++) { |
|---|
| 3422 | 3520 | value = ISP_PACK_4BYTE(arg->gain_x[i * 4], arg->gain_x[i * 4 + 1], |
|---|
| 3423 | 3521 | arg->gain_x[i * 4 + 2], arg->gain_x[i * 4 + 3]); |
|---|
| 3424 | | - isp3_param_write(params_vdev, value, ISP32_BAYNR_GAINX03 + i * 4); |
|---|
| 3522 | + isp3_param_write(params_vdev, value, ISP32_BAYNR_GAINX03 + i * 4, id); |
|---|
| 3425 | 3523 | } |
|---|
| 3426 | 3524 | |
|---|
| 3427 | 3525 | for (i = 0; i < ISP32_BAYNR_GAIN_NUM / 2; i++) { |
|---|
| 3428 | 3526 | value = ISP_PACK_2SHORT(arg->gain_y[i * 2], arg->gain_y[i * 2 + 1]); |
|---|
| 3429 | | - isp3_param_write(params_vdev, value, ISP32_BAYNR_GAINY01 + i * 4); |
|---|
| 3527 | + isp3_param_write(params_vdev, value, ISP32_BAYNR_GAINY01 + i * 4, id); |
|---|
| 3430 | 3528 | } |
|---|
| 3431 | 3529 | } |
|---|
| 3432 | 3530 | |
|---|
| 3433 | 3531 | static void |
|---|
| 3434 | | -isp_baynr_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 3532 | +isp_baynr_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 3435 | 3533 | { |
|---|
| 3436 | 3534 | u32 value; |
|---|
| 3437 | 3535 | |
|---|
| 3438 | | - value = isp3_param_read_cache(params_vdev, ISP3X_BAYNR_CTRL); |
|---|
| 3536 | + value = isp3_param_read_cache(params_vdev, ISP3X_BAYNR_CTRL, id); |
|---|
| 3439 | 3537 | value &= ~ISP32_MODULE_EN; |
|---|
| 3440 | 3538 | |
|---|
| 3441 | 3539 | if (en) |
|---|
| 3442 | 3540 | value |= ISP32_MODULE_EN; |
|---|
| 3443 | 3541 | |
|---|
| 3444 | | - isp3_param_write(params_vdev, value, ISP3X_BAYNR_CTRL); |
|---|
| 3542 | + isp3_param_write(params_vdev, value, ISP3X_BAYNR_CTRL, id); |
|---|
| 3445 | 3543 | } |
|---|
| 3446 | 3544 | |
|---|
| 3447 | 3545 | static void |
|---|
| 3448 | 3546 | isp_bay3d_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 3449 | | - const struct isp32_bay3d_cfg *arg) |
|---|
| 3547 | + const struct isp32_bay3d_cfg *arg, u32 id) |
|---|
| 3450 | 3548 | { |
|---|
| 3451 | 3549 | struct rkisp_isp_params_val_v32 *priv_val; |
|---|
| 3452 | 3550 | u32 i, value; |
|---|
| 3453 | 3551 | |
|---|
| 3454 | 3552 | priv_val = (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 3455 | | - value = isp3_param_read(params_vdev, ISP3X_BAY3D_CTRL); |
|---|
| 3553 | + value = isp3_param_read(params_vdev, ISP3X_BAY3D_CTRL, id); |
|---|
| 3456 | 3554 | value &= (ISP32_MODULE_EN | ISP32_BAY3D_BWSAVING(1)); |
|---|
| 3457 | 3555 | |
|---|
| 3458 | 3556 | value |= !!arg->loswitch_protect << 12 | |
|---|
| .. | .. |
|---|
| 3478 | 3576 | "bwsaving to %d no support change for bay3d en\n", |
|---|
| 3479 | 3577 | arg->bwsaving_en); |
|---|
| 3480 | 3578 | } |
|---|
| 3481 | | - isp3_param_write(params_vdev, value, ISP3X_BAY3D_CTRL); |
|---|
| 3579 | + isp3_param_write(params_vdev, value, ISP3X_BAY3D_CTRL, id); |
|---|
| 3482 | 3580 | |
|---|
| 3483 | 3581 | value = !!arg->wgtmix_opt_en << 12 | |
|---|
| 3484 | 3582 | !!arg->curds_high_en << 8 | |
|---|
| .. | .. |
|---|
| 3500 | 3598 | value &= ~(BIT(3) | BIT(4)); |
|---|
| 3501 | 3599 | else if (!(value & (BIT(3) | BIT(4)))) |
|---|
| 3502 | 3600 | value |= BIT(3); |
|---|
| 3503 | | - isp3_param_write(params_vdev, value, ISP32_BAY3D_CTRL1); |
|---|
| 3601 | + isp3_param_write(params_vdev, value, ISP32_BAY3D_CTRL1, id); |
|---|
| 3504 | 3602 | |
|---|
| 3505 | 3603 | value = ISP_PACK_2SHORT(arg->softwgt, arg->hidif_th); |
|---|
| 3506 | | - isp3_param_write(params_vdev, value, ISP3X_BAY3D_KALRATIO); |
|---|
| 3604 | + isp3_param_write(params_vdev, value, ISP3X_BAY3D_KALRATIO, id); |
|---|
| 3507 | 3605 | |
|---|
| 3508 | | - isp3_param_write(params_vdev, arg->glbpk2, ISP3X_BAY3D_GLBPK2); |
|---|
| 3606 | + isp3_param_write(params_vdev, arg->glbpk2, ISP3X_BAY3D_GLBPK2, id); |
|---|
| 3509 | 3607 | |
|---|
| 3510 | 3608 | value = ISP_PACK_2SHORT(arg->wgtlmt, arg->wgtratio); |
|---|
| 3511 | | - isp3_param_write(params_vdev, value, ISP3X_BAY3D_WGTLMT); |
|---|
| 3609 | + isp3_param_write(params_vdev, value, ISP3X_BAY3D_WGTLMT, id); |
|---|
| 3512 | 3610 | |
|---|
| 3513 | 3611 | for (i = 0; i < ISP32_BAY3D_XY_NUM / 2; i++) { |
|---|
| 3514 | 3612 | value = ISP_PACK_2SHORT(arg->sig0_x[2 * i], |
|---|
| 3515 | 3613 | arg->sig0_x[2 * i + 1]); |
|---|
| 3516 | | - isp3_param_write(params_vdev, value, ISP3X_BAY3D_SIG0_X0 + 4 * i); |
|---|
| 3614 | + isp3_param_write(params_vdev, value, ISP3X_BAY3D_SIG0_X0 + 4 * i, id); |
|---|
| 3517 | 3615 | |
|---|
| 3518 | 3616 | value = ISP_PACK_2SHORT(arg->sig1_x[2 * i], |
|---|
| 3519 | 3617 | arg->sig1_x[2 * i + 1]); |
|---|
| 3520 | | - isp3_param_write(params_vdev, value, ISP3X_BAY3D_SIG1_X0 + 4 * i); |
|---|
| 3618 | + isp3_param_write(params_vdev, value, ISP3X_BAY3D_SIG1_X0 + 4 * i, id); |
|---|
| 3521 | 3619 | } |
|---|
| 3522 | 3620 | |
|---|
| 3523 | 3621 | for (i = 0; i < ISP32_BAY3D_XY_NUM / 2; i++) { |
|---|
| 3524 | 3622 | value = ISP_PACK_2SHORT(arg->sig0_y[2 * i], |
|---|
| 3525 | 3623 | arg->sig0_y[2 * i + 1]); |
|---|
| 3526 | | - isp3_param_write(params_vdev, value, ISP3X_BAY3D_SIG0_Y0 + 4 * i); |
|---|
| 3624 | + isp3_param_write(params_vdev, value, ISP3X_BAY3D_SIG0_Y0 + 4 * i, id); |
|---|
| 3527 | 3625 | |
|---|
| 3528 | 3626 | value = ISP_PACK_2SHORT(arg->sig1_y[2 * i], |
|---|
| 3529 | 3627 | arg->sig1_y[2 * i + 1]); |
|---|
| 3530 | | - isp3_param_write(params_vdev, value, ISP3X_BAY3D_SIG1_Y0 + 4 * i); |
|---|
| 3628 | + isp3_param_write(params_vdev, value, ISP3X_BAY3D_SIG1_Y0 + 4 * i, id); |
|---|
| 3531 | 3629 | |
|---|
| 3532 | 3630 | value = ISP_PACK_2SHORT(arg->sig2_y[2 * i], |
|---|
| 3533 | 3631 | arg->sig2_y[2 * i + 1]); |
|---|
| 3534 | | - isp3_param_write(params_vdev, value, ISP3X_BAY3D_SIG2_Y0 + 4 * i); |
|---|
| 3632 | + isp3_param_write(params_vdev, value, ISP3X_BAY3D_SIG2_Y0 + 4 * i, id); |
|---|
| 3535 | 3633 | } |
|---|
| 3536 | 3634 | |
|---|
| 3537 | 3635 | if (params_vdev->dev->isp_ver == ISP_V32_L) { |
|---|
| 3538 | 3636 | value = ISP_PACK_2SHORT(0, arg->wgtmin); |
|---|
| 3539 | | - isp3_param_write(params_vdev, value, ISP3X_BAY3D_LODIF_STAT1); |
|---|
| 3637 | + isp3_param_write(params_vdev, value, ISP3X_BAY3D_LODIF_STAT1, id); |
|---|
| 3540 | 3638 | } |
|---|
| 3541 | 3639 | |
|---|
| 3542 | 3640 | value = ISP_PACK_2SHORT(arg->hisigrat0, arg->hisigrat1); |
|---|
| 3543 | | - isp3_param_write(params_vdev, value, ISP32_BAY3D_HISIGRAT); |
|---|
| 3641 | + isp3_param_write(params_vdev, value, ISP32_BAY3D_HISIGRAT, id); |
|---|
| 3544 | 3642 | |
|---|
| 3545 | 3643 | value = ISP_PACK_2SHORT(arg->hisigoff0, arg->hisigoff1); |
|---|
| 3546 | | - isp3_param_write(params_vdev, value, ISP32_BAY3D_HISIGOFF); |
|---|
| 3644 | + isp3_param_write(params_vdev, value, ISP32_BAY3D_HISIGOFF, id); |
|---|
| 3547 | 3645 | |
|---|
| 3548 | 3646 | value = ISP_PACK_2SHORT(arg->losigoff, arg->losigrat); |
|---|
| 3549 | | - isp3_param_write(params_vdev, value, ISP32_BAY3D_LOSIG); |
|---|
| 3647 | + isp3_param_write(params_vdev, value, ISP32_BAY3D_LOSIG, id); |
|---|
| 3550 | 3648 | |
|---|
| 3551 | 3649 | value = ISP_PACK_2SHORT(arg->rgain_off, arg->bgain_off); |
|---|
| 3552 | | - isp3_param_write(params_vdev, value, ISP32_BAY3D_SIGPK); |
|---|
| 3650 | + isp3_param_write(params_vdev, value, ISP32_BAY3D_SIGPK, id); |
|---|
| 3553 | 3651 | |
|---|
| 3554 | 3652 | value = ISP_PACK_4BYTE(arg->siggaus0, arg->siggaus1, arg->siggaus2, 0); |
|---|
| 3555 | 3653 | if (params_vdev->dev->isp_ver == ISP_V32) |
|---|
| 3556 | 3654 | value |= (arg->siggaus3 << 24); |
|---|
| 3557 | | - isp3_param_write(params_vdev, value, ISP32_BAY3D_SIGGAUS); |
|---|
| 3655 | + isp3_param_write(params_vdev, value, ISP32_BAY3D_SIGGAUS, id); |
|---|
| 3558 | 3656 | } |
|---|
| 3559 | 3657 | |
|---|
| 3560 | 3658 | static void |
|---|
| 3561 | | -isp_bay3d_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 3659 | +isp_bay3d_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 3562 | 3660 | { |
|---|
| 3563 | 3661 | struct rkisp_device *ispdev = params_vdev->dev; |
|---|
| 3564 | 3662 | struct rkisp_isp_params_val_v32 *priv_val; |
|---|
| 3565 | 3663 | u32 value, bay3d_ctrl; |
|---|
| 3566 | 3664 | |
|---|
| 3567 | 3665 | priv_val = (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 3568 | | - bay3d_ctrl = isp3_param_read_cache(params_vdev, ISP3X_BAY3D_CTRL); |
|---|
| 3666 | + bay3d_ctrl = isp3_param_read_cache(params_vdev, ISP3X_BAY3D_CTRL, id); |
|---|
| 3569 | 3667 | if ((en && (bay3d_ctrl & ISP32_MODULE_EN)) || |
|---|
| 3570 | 3668 | (!en && !(bay3d_ctrl & ISP32_MODULE_EN))) |
|---|
| 3571 | 3669 | return; |
|---|
| .. | .. |
|---|
| 3576 | 3674 | return; |
|---|
| 3577 | 3675 | } |
|---|
| 3578 | 3676 | |
|---|
| 3579 | | - value = priv_val->buf_3dnr_iir.size; |
|---|
| 3580 | | - isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_IIR_WR_SIZE); |
|---|
| 3581 | | - value = priv_val->buf_3dnr_iir.dma_addr; |
|---|
| 3582 | | - isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_IIR_WR_BASE); |
|---|
| 3583 | | - isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_IIR_RD_BASE); |
|---|
| 3677 | + value = priv_val->bay3d_iir_size; |
|---|
| 3678 | + isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_IIR_WR_SIZE, id); |
|---|
| 3679 | + value = priv_val->buf_3dnr_iir.dma_addr + value * id; |
|---|
| 3680 | + isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_IIR_WR_BASE, id); |
|---|
| 3681 | + isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_IIR_RD_BASE, id); |
|---|
| 3584 | 3682 | |
|---|
| 3585 | | - value = priv_val->buf_3dnr_ds.size; |
|---|
| 3586 | | - isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_DS_WR_SIZE); |
|---|
| 3587 | | - value = priv_val->buf_3dnr_ds.dma_addr; |
|---|
| 3588 | | - isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_DS_WR_BASE); |
|---|
| 3589 | | - isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_DS_RD_BASE); |
|---|
| 3683 | + value = priv_val->bay3d_ds_size; |
|---|
| 3684 | + isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_DS_WR_SIZE, id); |
|---|
| 3685 | + value = priv_val->buf_3dnr_ds.dma_addr + value * id; |
|---|
| 3686 | + isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_DS_WR_BASE, id); |
|---|
| 3687 | + isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_DS_RD_BASE, id); |
|---|
| 3590 | 3688 | |
|---|
| 3591 | 3689 | value = priv_val->is_sram ? |
|---|
| 3592 | 3690 | ispdev->hw_dev->sram.dma_addr : priv_val->buf_3dnr_cur.dma_addr; |
|---|
| 3593 | | - isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_CUR_WR_BASE); |
|---|
| 3594 | | - isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_CUR_RD_BASE); |
|---|
| 3691 | + isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_CUR_WR_BASE, id); |
|---|
| 3692 | + isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_CUR_RD_BASE, id); |
|---|
| 3595 | 3693 | value = priv_val->bay3d_cur_size; |
|---|
| 3596 | | - isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_CUR_WR_SIZE); |
|---|
| 3597 | | - isp3_param_write(params_vdev, value, ISP32_MI_BAY3D_CUR_RD_SIZE); |
|---|
| 3694 | + isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_CUR_WR_SIZE, id); |
|---|
| 3695 | + isp3_param_write(params_vdev, value, ISP32_MI_BAY3D_CUR_RD_SIZE, id); |
|---|
| 3598 | 3696 | value = priv_val->bay3d_cur_wsize; |
|---|
| 3599 | | - isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_CUR_WR_LENGTH); |
|---|
| 3600 | | - isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_CUR_RD_LENGTH); |
|---|
| 3697 | + isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_CUR_WR_LENGTH, id); |
|---|
| 3698 | + isp3_param_write(params_vdev, value, ISP3X_MI_BAY3D_CUR_RD_LENGTH, id); |
|---|
| 3601 | 3699 | value = priv_val->bay3d_cur_wrap_line << 16 | |
|---|
| 3602 | 3700 | (ispdev->isp_ver == ISP_V32 ? 28 : 20); |
|---|
| 3603 | | - isp3_param_write(params_vdev, value, ISP3X_BAY3D_MI_ST); |
|---|
| 3701 | + isp3_param_write(params_vdev, value, ISP3X_BAY3D_MI_ST, id); |
|---|
| 3604 | 3702 | |
|---|
| 3605 | 3703 | /* mibuf_size for fifo_cur_full, set to max: (3072 - 2) / 2, 2 align */ |
|---|
| 3606 | 3704 | if (ispdev->isp_ver == ISP_V32) { |
|---|
| 3607 | 3705 | value = 0x5fe << 16; |
|---|
| 3608 | | - isp3_param_set_bits(params_vdev, ISP3X_BAY3D_IN_IRQ_LINECNT, value); |
|---|
| 3706 | + isp3_param_set_bits(params_vdev, ISP3X_BAY3D_IN_IRQ_LINECNT, value, id); |
|---|
| 3609 | 3707 | } |
|---|
| 3610 | 3708 | |
|---|
| 3611 | | - value = isp3_param_read_cache(params_vdev, ISP32_BAY3D_CTRL1); |
|---|
| 3709 | + value = isp3_param_read_cache(params_vdev, ISP32_BAY3D_CTRL1, id); |
|---|
| 3612 | 3710 | if (priv_val->is_lo8x8) { |
|---|
| 3613 | 3711 | if (value & (BIT(3) | BIT(4))) { |
|---|
| 3614 | 3712 | value &= ~(BIT(3) | BIT(4)); |
|---|
| 3615 | | - isp3_param_write(params_vdev, value, ISP32_BAY3D_CTRL1); |
|---|
| 3713 | + isp3_param_write(params_vdev, value, ISP32_BAY3D_CTRL1, id); |
|---|
| 3616 | 3714 | } |
|---|
| 3617 | 3715 | } else if (!(value & (BIT(3) | BIT(4)))) { |
|---|
| 3618 | 3716 | value |= BIT(3); |
|---|
| 3619 | | - isp3_param_write(params_vdev, value, ISP32_BAY3D_CTRL1); |
|---|
| 3717 | + isp3_param_write(params_vdev, value, ISP32_BAY3D_CTRL1, id); |
|---|
| 3620 | 3718 | } |
|---|
| 3621 | 3719 | bay3d_ctrl |= ISP32_MODULE_EN; |
|---|
| 3622 | | - isp3_param_write(params_vdev, bay3d_ctrl, ISP3X_BAY3D_CTRL); |
|---|
| 3720 | + isp3_param_write(params_vdev, bay3d_ctrl, ISP3X_BAY3D_CTRL, id); |
|---|
| 3623 | 3721 | |
|---|
| 3624 | 3722 | value = ISP3X_BAY3D_IIR_WR_AUTO_UPD | ISP3X_BAY3D_CUR_WR_AUTO_UPD | |
|---|
| 3625 | 3723 | ISP3X_BAY3D_DS_WR_AUTO_UPD | ISP3X_BAY3D_IIRSELF_UPD | |
|---|
| 3626 | 3724 | ISP3X_BAY3D_CURSELF_UPD | ISP3X_BAY3D_DSSELF_UPD | |
|---|
| 3627 | 3725 | ISP3X_BAY3D_RDSELF_UPD; |
|---|
| 3628 | | - isp3_param_set_bits(params_vdev, MI_WR_CTRL2, value); |
|---|
| 3726 | + isp3_param_set_bits(params_vdev, MI_WR_CTRL2, value, id); |
|---|
| 3629 | 3727 | |
|---|
| 3630 | | - isp3_param_set_bits(params_vdev, ISP3X_ISP_CTRL1, ISP3X_RAW3D_FST_FRAME); |
|---|
| 3728 | + isp3_param_set_bits(params_vdev, ISP3X_ISP_CTRL1, ISP3X_RAW3D_FST_FRAME, id); |
|---|
| 3631 | 3729 | } else { |
|---|
| 3632 | 3730 | bay3d_ctrl &= ~ISP32_MODULE_EN; |
|---|
| 3633 | | - isp3_param_write(params_vdev, bay3d_ctrl, ISP3X_BAY3D_CTRL); |
|---|
| 3634 | | - isp3_param_clear_bits(params_vdev, ISP3X_GAIN_CTRL, BIT(4)); |
|---|
| 3731 | + isp3_param_write(params_vdev, bay3d_ctrl, ISP3X_BAY3D_CTRL, id); |
|---|
| 3732 | + isp3_param_clear_bits(params_vdev, ISP3X_GAIN_CTRL, BIT(4), id); |
|---|
| 3635 | 3733 | } |
|---|
| 3636 | 3734 | } |
|---|
| 3637 | 3735 | |
|---|
| 3638 | 3736 | static void |
|---|
| 3639 | 3737 | isp_gain_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 3640 | | - const struct isp3x_gain_cfg *arg) |
|---|
| 3738 | + const struct isp3x_gain_cfg *arg, u32 id) |
|---|
| 3641 | 3739 | { |
|---|
| 3642 | 3740 | u32 val; |
|---|
| 3643 | 3741 | |
|---|
| 3644 | 3742 | val = arg->g0 & 0x3ffff; |
|---|
| 3645 | | - isp3_param_write(params_vdev, val, ISP3X_GAIN_G0); |
|---|
| 3743 | + isp3_param_write(params_vdev, val, ISP3X_GAIN_G0, id); |
|---|
| 3646 | 3744 | val = ISP_PACK_2SHORT(arg->g1, arg->g2); |
|---|
| 3647 | | - isp3_param_write(params_vdev, val, ISP3X_GAIN_G1_G2); |
|---|
| 3745 | + isp3_param_write(params_vdev, val, ISP3X_GAIN_G1_G2, id); |
|---|
| 3648 | 3746 | } |
|---|
| 3649 | 3747 | |
|---|
| 3650 | 3748 | static void |
|---|
| 3651 | | -isp_gain_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 3749 | +isp_gain_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 3652 | 3750 | { |
|---|
| 3653 | 3751 | struct rkisp_isp_params_val_v32 *priv_val = |
|---|
| 3654 | 3752 | (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 3655 | 3753 | u32 val = 0; |
|---|
| 3656 | 3754 | |
|---|
| 3657 | | - val = isp3_param_read_cache(params_vdev, ISP3X_GAIN_CTRL); |
|---|
| 3755 | + val = isp3_param_read_cache(params_vdev, ISP3X_GAIN_CTRL, id); |
|---|
| 3658 | 3756 | if (en) { |
|---|
| 3659 | 3757 | if (params_vdev->dev->isp_ver == ISP_V32) { |
|---|
| 3660 | 3758 | val |= priv_val->lut3d_en << 20 | |
|---|
| .. | .. |
|---|
| 3662 | 3760 | priv_val->drc_en << 12 | |
|---|
| 3663 | 3761 | priv_val->lsc_en << 8 | |
|---|
| 3664 | 3762 | priv_val->bay3d_en << 4; |
|---|
| 3665 | | - if (isp3_param_read(params_vdev, ISP3X_HDRMGE_CTRL) & BIT(0)) |
|---|
| 3763 | + if (isp3_param_read(params_vdev, ISP3X_HDRMGE_CTRL, id) & BIT(0)) |
|---|
| 3666 | 3764 | val |= BIT(1); |
|---|
| 3667 | 3765 | if (val) |
|---|
| 3668 | 3766 | val |= ISP32_MODULE_EN; |
|---|
| .. | .. |
|---|
| 3670 | 3768 | val |= ISP32_MODULE_EN; |
|---|
| 3671 | 3769 | } |
|---|
| 3672 | 3770 | } |
|---|
| 3673 | | - isp3_param_write(params_vdev, val, ISP3X_GAIN_CTRL); |
|---|
| 3771 | + isp3_param_write(params_vdev, val, ISP3X_GAIN_CTRL, id); |
|---|
| 3674 | 3772 | } |
|---|
| 3675 | 3773 | |
|---|
| 3676 | 3774 | static void |
|---|
| 3677 | 3775 | isp_cac_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 3678 | | - const struct isp32_cac_cfg *arg) |
|---|
| 3776 | + const struct isp32_cac_cfg *arg, u32 id) |
|---|
| 3679 | 3777 | { |
|---|
| 3680 | 3778 | struct rkisp_device *dev = params_vdev->dev; |
|---|
| 3681 | 3779 | struct rkisp_isp_params_val_v32 *priv_val; |
|---|
| .. | .. |
|---|
| 3684 | 3782 | |
|---|
| 3685 | 3783 | priv_val = (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 3686 | 3784 | |
|---|
| 3687 | | - ctrl = isp3_param_read(params_vdev, ISP3X_CAC_CTRL); |
|---|
| 3785 | + ctrl = isp3_param_read(params_vdev, ISP3X_CAC_CTRL, id); |
|---|
| 3688 | 3786 | ctrl &= ISP3X_CAC_EN; |
|---|
| 3689 | 3787 | ctrl |= !!arg->bypass_en << 1 | !!arg->center_en << 3 | |
|---|
| 3690 | 3788 | (arg->clip_g_mode & 0x3) << 5 | !!arg->edge_detect_en << 7 | |
|---|
| .. | .. |
|---|
| 3692 | 3790 | |
|---|
| 3693 | 3791 | val = (arg->psf_sft_bit & 0xff) | |
|---|
| 3694 | 3792 | (arg->cfg_num & 0x7ff) << 8; |
|---|
| 3695 | | - isp3_param_write(params_vdev, val, ISP3X_CAC_PSF_PARA); |
|---|
| 3793 | + isp3_param_write(params_vdev, val, ISP3X_CAC_PSF_PARA, id); |
|---|
| 3696 | 3794 | |
|---|
| 3697 | 3795 | val = ISP_PACK_2SHORT(arg->center_width, arg->center_height); |
|---|
| 3698 | | - isp3_param_write(params_vdev, val, ISP3X_CAC_STRENGTH_CENTER); |
|---|
| 3796 | + isp3_param_write(params_vdev, val, ISP3X_CAC_STRENGTH_CENTER, id); |
|---|
| 3699 | 3797 | |
|---|
| 3700 | 3798 | for (i = 0; i < ISP32_CAC_STRENGTH_NUM / 2; i++) { |
|---|
| 3701 | 3799 | val = ISP_PACK_2SHORT(arg->strength[2 * i], arg->strength[2 * i + 1]); |
|---|
| 3702 | | - isp3_param_write(params_vdev, val, ISP3X_CAC_STRENGTH0 + i * 4); |
|---|
| 3800 | + isp3_param_write(params_vdev, val, ISP3X_CAC_STRENGTH0 + i * 4, id); |
|---|
| 3703 | 3801 | } |
|---|
| 3704 | 3802 | |
|---|
| 3705 | 3803 | val = (arg->flat_thed_r & 0x1f) << 8 | (arg->flat_thed_b & 0x1f); |
|---|
| 3706 | | - isp3_param_write(params_vdev, val, ISP32_CAC_FLAT_THED); |
|---|
| 3804 | + isp3_param_write(params_vdev, val, ISP32_CAC_FLAT_THED, id); |
|---|
| 3707 | 3805 | |
|---|
| 3708 | 3806 | val = ISP_PACK_2SHORT(arg->offset_b, arg->offset_r); |
|---|
| 3709 | | - isp3_param_write(params_vdev, val, ISP32_CAC_OFFSET); |
|---|
| 3807 | + isp3_param_write(params_vdev, val, ISP32_CAC_OFFSET, id); |
|---|
| 3710 | 3808 | |
|---|
| 3711 | 3809 | val = arg->expo_thed_b & 0x1fffff; |
|---|
| 3712 | | - isp3_param_write(params_vdev, val, ISP32_CAC_EXPO_THED_B); |
|---|
| 3810 | + isp3_param_write(params_vdev, val, ISP32_CAC_EXPO_THED_B, id); |
|---|
| 3713 | 3811 | |
|---|
| 3714 | 3812 | val = arg->expo_thed_r & 0x1fffff; |
|---|
| 3715 | | - isp3_param_write(params_vdev, val, ISP32_CAC_EXPO_THED_R); |
|---|
| 3813 | + isp3_param_write(params_vdev, val, ISP32_CAC_EXPO_THED_R, id); |
|---|
| 3716 | 3814 | |
|---|
| 3717 | 3815 | val = arg->expo_adj_b & 0xfffff; |
|---|
| 3718 | | - isp3_param_write(params_vdev, val, ISP32_CAC_EXPO_ADJ_B); |
|---|
| 3816 | + isp3_param_write(params_vdev, val, ISP32_CAC_EXPO_ADJ_B, id); |
|---|
| 3719 | 3817 | |
|---|
| 3720 | 3818 | val = arg->expo_adj_r & 0xfffff; |
|---|
| 3721 | | - isp3_param_write(params_vdev, val, ISP32_CAC_EXPO_ADJ_R); |
|---|
| 3819 | + isp3_param_write(params_vdev, val, ISP32_CAC_EXPO_ADJ_R, id); |
|---|
| 3722 | 3820 | |
|---|
| 3723 | 3821 | for (i = 0; i < ISP32_MESH_BUF_NUM; i++) { |
|---|
| 3724 | | - if (!priv_val->buf_cac[i].mem_priv) |
|---|
| 3822 | + if (!priv_val->buf_cac[id][i].mem_priv) |
|---|
| 3725 | 3823 | continue; |
|---|
| 3726 | | - if (arg->buf_fd == priv_val->buf_cac[i].dma_fd) |
|---|
| 3824 | + if (arg->buf_fd == priv_val->buf_cac[id][i].dma_fd) |
|---|
| 3727 | 3825 | break; |
|---|
| 3728 | 3826 | } |
|---|
| 3729 | 3827 | |
|---|
| .. | .. |
|---|
| 3732 | 3830 | return; |
|---|
| 3733 | 3831 | } |
|---|
| 3734 | 3832 | |
|---|
| 3735 | | - if (!priv_val->buf_cac[i].vaddr) { |
|---|
| 3833 | + if (!priv_val->buf_cac[id][i].vaddr) { |
|---|
| 3736 | 3834 | dev_err(dev->dev, "no cac buffer allocated\n"); |
|---|
| 3737 | 3835 | return; |
|---|
| 3738 | 3836 | } |
|---|
| 3739 | 3837 | |
|---|
| 3740 | | - val = priv_val->buf_cac_idx; |
|---|
| 3741 | | - head = (struct isp2x_mesh_head *)priv_val->buf_cac[val].vaddr; |
|---|
| 3838 | + val = priv_val->buf_cac_idx[id]; |
|---|
| 3839 | + head = (struct isp2x_mesh_head *)priv_val->buf_cac[id][val].vaddr; |
|---|
| 3742 | 3840 | head->stat = MESH_BUF_INIT; |
|---|
| 3743 | 3841 | |
|---|
| 3744 | | - head = (struct isp2x_mesh_head *)priv_val->buf_cac[i].vaddr; |
|---|
| 3842 | + head = (struct isp2x_mesh_head *)priv_val->buf_cac[id][i].vaddr; |
|---|
| 3745 | 3843 | head->stat = MESH_BUF_CHIPINUSE; |
|---|
| 3746 | | - priv_val->buf_cac_idx = i; |
|---|
| 3747 | | - rkisp_prepare_buffer(dev, &priv_val->buf_cac[i]); |
|---|
| 3748 | | - val = priv_val->buf_cac[i].dma_addr + head->data_oft; |
|---|
| 3749 | | - isp3_param_write(params_vdev, val, ISP3X_MI_LUT_CAC_RD_BASE); |
|---|
| 3750 | | - isp3_param_write(params_vdev, arg->hsize, ISP3X_MI_LUT_CAC_RD_H_WSIZE); |
|---|
| 3751 | | - isp3_param_write(params_vdev, arg->vsize, ISP3X_MI_LUT_CAC_RD_V_SIZE); |
|---|
| 3844 | + priv_val->buf_cac_idx[id] = i; |
|---|
| 3845 | + rkisp_prepare_buffer(dev, &priv_val->buf_cac[id][i]); |
|---|
| 3846 | + val = priv_val->buf_cac[id][i].dma_addr + head->data_oft; |
|---|
| 3847 | + isp3_param_write(params_vdev, val, ISP3X_MI_LUT_CAC_RD_BASE, id); |
|---|
| 3848 | + isp3_param_write(params_vdev, arg->hsize, ISP3X_MI_LUT_CAC_RD_H_WSIZE, id); |
|---|
| 3849 | + isp3_param_write(params_vdev, arg->vsize, ISP3X_MI_LUT_CAC_RD_V_SIZE, id); |
|---|
| 3752 | 3850 | if (ctrl & ISP3X_CAC_EN) |
|---|
| 3753 | 3851 | ctrl |= ISP3X_CAC_LUT_EN | ISP32_SELF_FORCE_UPD | ISP3X_CAC_LUT_MODE(3); |
|---|
| 3754 | | - isp3_param_write(params_vdev, ctrl, ISP3X_CAC_CTRL); |
|---|
| 3852 | + isp3_param_write(params_vdev, ctrl, ISP3X_CAC_CTRL, id); |
|---|
| 3755 | 3853 | } |
|---|
| 3756 | 3854 | |
|---|
| 3757 | 3855 | static void |
|---|
| 3758 | | -isp_cac_enable(struct rkisp_isp_params_vdev *params_vdev, bool en) |
|---|
| 3856 | +isp_cac_enable(struct rkisp_isp_params_vdev *params_vdev, bool en, u32 id) |
|---|
| 3759 | 3857 | { |
|---|
| 3858 | + struct rkisp_device *dev = params_vdev->dev; |
|---|
| 3859 | + struct rkisp_isp_params_val_v32 *priv_val; |
|---|
| 3760 | 3860 | u32 val; |
|---|
| 3761 | 3861 | |
|---|
| 3762 | | - val = isp3_param_read(params_vdev, ISP3X_CAC_CTRL); |
|---|
| 3862 | + priv_val = (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 3863 | + val = priv_val->buf_cac_idx[id]; |
|---|
| 3864 | + if (en && !priv_val->buf_cac[id][val].vaddr) { |
|---|
| 3865 | + dev_err(dev->dev, "no cac buffer allocated\n"); |
|---|
| 3866 | + return; |
|---|
| 3867 | + } |
|---|
| 3868 | + |
|---|
| 3869 | + val = isp3_param_read(params_vdev, ISP3X_CAC_CTRL, id); |
|---|
| 3763 | 3870 | val &= ~(ISP3X_CAC_EN | ISP3X_CAC_LUT_EN | ISP32_SELF_FORCE_UPD); |
|---|
| 3764 | 3871 | if (en) |
|---|
| 3765 | 3872 | val |= ISP3X_CAC_EN | ISP3X_CAC_LUT_EN | |
|---|
| 3766 | 3873 | ISP32_SELF_FORCE_UPD | ISP3X_CAC_LUT_MODE(3); |
|---|
| 3767 | | - isp3_param_write(params_vdev, val, ISP3X_CAC_CTRL); |
|---|
| 3874 | + isp3_param_write(params_vdev, val, ISP3X_CAC_CTRL, id); |
|---|
| 3768 | 3875 | } |
|---|
| 3769 | 3876 | |
|---|
| 3770 | 3877 | static void |
|---|
| 3771 | 3878 | isp_csm_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 3772 | | - const struct isp21_csm_cfg *arg) |
|---|
| 3879 | + const struct isp21_csm_cfg *arg, u32 id) |
|---|
| 3773 | 3880 | { |
|---|
| 3774 | 3881 | u32 i, val; |
|---|
| 3775 | 3882 | |
|---|
| .. | .. |
|---|
| 3780 | 3887 | (arg->csm_coeff[i] & 0x1ff); |
|---|
| 3781 | 3888 | else |
|---|
| 3782 | 3889 | val = arg->csm_coeff[i] & 0x1ff; |
|---|
| 3783 | | - isp3_param_write(params_vdev, val, ISP3X_ISP_CC_COEFF_0 + i * 4); |
|---|
| 3890 | + isp3_param_write(params_vdev, val, ISP3X_ISP_CC_COEFF_0 + i * 4, id); |
|---|
| 3784 | 3891 | } |
|---|
| 3785 | 3892 | |
|---|
| 3786 | | - val = isp3_param_read_cache(params_vdev, ISP3X_ISP_CTRL0); |
|---|
| 3893 | + val = isp3_param_read_cache(params_vdev, ISP3X_ISP_CTRL0, id); |
|---|
| 3787 | 3894 | val |= CIF_ISP_CTRL_ISP_CSM_Y_FULL_ENA | CIF_ISP_CTRL_ISP_CSM_C_FULL_ENA; |
|---|
| 3788 | | - isp3_param_write(params_vdev, val, ISP3X_ISP_CTRL0); |
|---|
| 3895 | + isp3_param_write(params_vdev, val, ISP3X_ISP_CTRL0, id); |
|---|
| 3789 | 3896 | } |
|---|
| 3790 | 3897 | |
|---|
| 3791 | 3898 | static void |
|---|
| 3792 | 3899 | isp_cgc_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 3793 | | - const struct isp21_cgc_cfg *arg) |
|---|
| 3900 | + const struct isp21_cgc_cfg *arg, u32 id) |
|---|
| 3794 | 3901 | { |
|---|
| 3795 | | - u32 val = isp3_param_read_cache(params_vdev, ISP3X_ISP_CTRL0); |
|---|
| 3902 | + u32 val = isp3_param_read_cache(params_vdev, ISP3X_ISP_CTRL0, id); |
|---|
| 3796 | 3903 | u32 eff_ctrl, cproc_ctrl; |
|---|
| 3797 | 3904 | |
|---|
| 3798 | 3905 | params_vdev->quantization = V4L2_QUANTIZATION_FULL_RANGE; |
|---|
| .. | .. |
|---|
| 3803 | 3910 | } |
|---|
| 3804 | 3911 | if (arg->ratio_en) |
|---|
| 3805 | 3912 | val |= ISP3X_SW_CGC_RATIO_EN; |
|---|
| 3806 | | - isp3_param_write(params_vdev, val, ISP3X_ISP_CTRL0); |
|---|
| 3913 | + isp3_param_write(params_vdev, val, ISP3X_ISP_CTRL0, id); |
|---|
| 3807 | 3914 | |
|---|
| 3808 | | - cproc_ctrl = isp3_param_read(params_vdev, ISP3X_CPROC_CTRL); |
|---|
| 3915 | + cproc_ctrl = isp3_param_read(params_vdev, ISP3X_CPROC_CTRL, id); |
|---|
| 3809 | 3916 | if (cproc_ctrl & CIF_C_PROC_CTR_ENABLE) { |
|---|
| 3810 | 3917 | val = CIF_C_PROC_YOUT_FULL | CIF_C_PROC_YIN_FULL | CIF_C_PROC_COUT_FULL; |
|---|
| 3811 | 3918 | if (arg->yuv_limit) |
|---|
| 3812 | 3919 | cproc_ctrl &= ~val; |
|---|
| 3813 | 3920 | else |
|---|
| 3814 | 3921 | cproc_ctrl |= val; |
|---|
| 3815 | | - isp3_param_write(params_vdev, cproc_ctrl, ISP3X_CPROC_CTRL); |
|---|
| 3922 | + isp3_param_write(params_vdev, cproc_ctrl, ISP3X_CPROC_CTRL, id); |
|---|
| 3816 | 3923 | } |
|---|
| 3817 | 3924 | |
|---|
| 3818 | | - eff_ctrl = isp3_param_read(params_vdev, ISP3X_IMG_EFF_CTRL); |
|---|
| 3925 | + eff_ctrl = isp3_param_read(params_vdev, ISP3X_IMG_EFF_CTRL, id); |
|---|
| 3819 | 3926 | if (eff_ctrl & CIF_IMG_EFF_CTRL_ENABLE) { |
|---|
| 3820 | 3927 | if (arg->yuv_limit) |
|---|
| 3821 | 3928 | eff_ctrl &= ~CIF_IMG_EFF_CTRL_YCBCR_FULL; |
|---|
| 3822 | 3929 | else |
|---|
| 3823 | 3930 | eff_ctrl |= CIF_IMG_EFF_CTRL_YCBCR_FULL; |
|---|
| 3824 | | - isp3_param_write(params_vdev, eff_ctrl, ISP3X_IMG_EFF_CTRL); |
|---|
| 3931 | + isp3_param_write(params_vdev, eff_ctrl, ISP3X_IMG_EFF_CTRL, id); |
|---|
| 3825 | 3932 | } |
|---|
| 3826 | 3933 | } |
|---|
| 3827 | 3934 | |
|---|
| 3828 | 3935 | static void |
|---|
| 3829 | 3936 | isp_vsm_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 3830 | | - const struct isp32_vsm_cfg *arg) |
|---|
| 3937 | + const struct isp32_vsm_cfg *arg, u32 id) |
|---|
| 3831 | 3938 | { |
|---|
| 3832 | 3939 | struct rkisp_device *ispdev = params_vdev->dev; |
|---|
| 3833 | 3940 | struct v4l2_rect *out_crop = &ispdev->isp_sdev.out_crop; |
|---|
| .. | .. |
|---|
| 3836 | 3943 | u32 val, h, v; |
|---|
| 3837 | 3944 | |
|---|
| 3838 | 3945 | val = arg->h_offs; |
|---|
| 3839 | | - isp3_param_write(params_vdev, val, ISP32_VSM_H_OFFS); |
|---|
| 3946 | + isp3_param_write(params_vdev, val, ISP32_VSM_H_OFFS, id); |
|---|
| 3840 | 3947 | val = arg->v_offs; |
|---|
| 3841 | | - isp3_param_write(params_vdev, val, ISP32_VSM_V_OFFS); |
|---|
| 3948 | + isp3_param_write(params_vdev, val, ISP32_VSM_V_OFFS, id); |
|---|
| 3842 | 3949 | |
|---|
| 3843 | 3950 | h = arg->h_size; |
|---|
| 3844 | 3951 | if (h > width - arg->h_offs) |
|---|
| 3845 | 3952 | h = width - arg->h_offs; |
|---|
| 3846 | 3953 | h &= ~1; |
|---|
| 3847 | | - isp3_param_write(params_vdev, h, ISP32_VSM_H_SIZE); |
|---|
| 3954 | + isp3_param_write(params_vdev, h, ISP32_VSM_H_SIZE, id); |
|---|
| 3848 | 3955 | |
|---|
| 3849 | 3956 | v = arg->v_size; |
|---|
| 3850 | 3957 | if (v > height - arg->v_offs) |
|---|
| 3851 | 3958 | v = height - arg->v_offs; |
|---|
| 3852 | 3959 | v &= ~1; |
|---|
| 3853 | | - isp3_param_write(params_vdev, v, ISP32_VSM_V_SIZE); |
|---|
| 3960 | + isp3_param_write(params_vdev, v, ISP32_VSM_V_SIZE, id); |
|---|
| 3854 | 3961 | |
|---|
| 3855 | 3962 | val = arg->h_segments; |
|---|
| 3856 | 3963 | if (val > (h - 48) / 16) |
|---|
| 3857 | 3964 | val = (h - 48) / 16; |
|---|
| 3858 | | - isp3_param_write(params_vdev, val, ISP32_VSM_H_SEGMENTS); |
|---|
| 3965 | + isp3_param_write(params_vdev, val, ISP32_VSM_H_SEGMENTS, id); |
|---|
| 3859 | 3966 | |
|---|
| 3860 | 3967 | val = arg->v_segments; |
|---|
| 3861 | 3968 | if (val > (v - 48) / 16) |
|---|
| 3862 | 3969 | val = (v - 48) / 16; |
|---|
| 3863 | | - isp3_param_write(params_vdev, val, ISP32_VSM_V_SEGMENTS); |
|---|
| 3970 | + isp3_param_write(params_vdev, val, ISP32_VSM_V_SEGMENTS, id); |
|---|
| 3864 | 3971 | } |
|---|
| 3865 | 3972 | |
|---|
| 3866 | 3973 | static void |
|---|
| 3867 | 3974 | isp_vsm_enable(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 3868 | | - bool en) |
|---|
| 3975 | + bool en, u32 id) |
|---|
| 3869 | 3976 | { |
|---|
| 3870 | | - isp3_param_write(params_vdev, en, ISP32_VSM_MODE); |
|---|
| 3977 | + isp3_param_write(params_vdev, en, ISP32_VSM_MODE, id); |
|---|
| 3871 | 3978 | } |
|---|
| 3872 | 3979 | |
|---|
| 3873 | 3980 | struct rkisp_isp_params_ops_v32 isp_params_ops_v32 = { |
|---|
| .. | .. |
|---|
| 3946 | 4053 | static __maybe_unused |
|---|
| 3947 | 4054 | void __isp_isr_other_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 3948 | 4055 | const struct isp32_isp_params_cfg *new_params, |
|---|
| 3949 | | - enum rkisp_params_type type) |
|---|
| 4056 | + enum rkisp_params_type type, u32 id) |
|---|
| 3950 | 4057 | { |
|---|
| 3951 | 4058 | struct rkisp_isp_params_ops_v32 *ops = |
|---|
| 3952 | 4059 | (struct rkisp_isp_params_ops_v32 *)params_vdev->priv_ops; |
|---|
| .. | .. |
|---|
| 3958 | 4065 | |
|---|
| 3959 | 4066 | if (type == RKISP_PARAMS_SHD) { |
|---|
| 3960 | 4067 | if ((module_cfg_update & ISP32_MODULE_HDRMGE)) |
|---|
| 3961 | | - ops->hdrmge_config(params_vdev, &new_params->others.hdrmge_cfg, type); |
|---|
| 4068 | + ops->hdrmge_config(params_vdev, &new_params->others.hdrmge_cfg, type, id); |
|---|
| 3962 | 4069 | |
|---|
| 3963 | 4070 | if ((module_cfg_update & ISP32_MODULE_DRC)) |
|---|
| 3964 | | - ops->hdrdrc_config(params_vdev, &new_params->others.drc_cfg, type); |
|---|
| 4071 | + ops->hdrdrc_config(params_vdev, &new_params->others.drc_cfg, type, id); |
|---|
| 3965 | 4072 | return; |
|---|
| 3966 | 4073 | } |
|---|
| 3967 | 4074 | |
|---|
| 3968 | 4075 | v4l2_dbg(4, rkisp_debug, ¶ms_vdev->dev->v4l2_dev, |
|---|
| 3969 | | - "%s seq:%d module_cfg_update:0x%llx\n", |
|---|
| 3970 | | - __func__, new_params->frame_id, module_cfg_update); |
|---|
| 4076 | + "%s id:%d seq:%d module_cfg_update:0x%llx\n", |
|---|
| 4077 | + __func__, id, new_params->frame_id, module_cfg_update); |
|---|
| 3971 | 4078 | |
|---|
| 3972 | 4079 | if (module_cfg_update & ISP32_MODULE_LSC) |
|---|
| 3973 | | - ops->lsc_config(params_vdev, &new_params->others.lsc_cfg); |
|---|
| 4080 | + ops->lsc_config(params_vdev, &new_params->others.lsc_cfg, id); |
|---|
| 3974 | 4081 | |
|---|
| 3975 | 4082 | if (module_cfg_update & ISP32_MODULE_DPCC) |
|---|
| 3976 | | - ops->dpcc_config(params_vdev, &new_params->others.dpcc_cfg); |
|---|
| 4083 | + ops->dpcc_config(params_vdev, &new_params->others.dpcc_cfg, id); |
|---|
| 3977 | 4084 | |
|---|
| 3978 | 4085 | if (module_cfg_update & ISP32_MODULE_BLS) |
|---|
| 3979 | | - ops->bls_config(params_vdev, &new_params->others.bls_cfg); |
|---|
| 4086 | + ops->bls_config(params_vdev, &new_params->others.bls_cfg, id); |
|---|
| 3980 | 4087 | |
|---|
| 3981 | 4088 | if (module_cfg_update & ISP32_MODULE_SDG) |
|---|
| 3982 | | - ops->sdg_config(params_vdev, &new_params->others.sdg_cfg); |
|---|
| 4089 | + ops->sdg_config(params_vdev, &new_params->others.sdg_cfg, id); |
|---|
| 3983 | 4090 | |
|---|
| 3984 | 4091 | if (module_cfg_update & ISP32_MODULE_AWB_GAIN) |
|---|
| 3985 | | - ops->awbgain_config(params_vdev, &new_params->others.awb_gain_cfg); |
|---|
| 4092 | + ops->awbgain_config(params_vdev, &new_params->others.awb_gain_cfg, id); |
|---|
| 3986 | 4093 | |
|---|
| 3987 | 4094 | if (module_cfg_update & ISP32_MODULE_DEBAYER) |
|---|
| 3988 | | - ops->debayer_config(params_vdev, &new_params->others.debayer_cfg); |
|---|
| 4095 | + ops->debayer_config(params_vdev, &new_params->others.debayer_cfg, id); |
|---|
| 3989 | 4096 | |
|---|
| 3990 | 4097 | if (module_cfg_update & ISP32_MODULE_CCM) |
|---|
| 3991 | | - ops->ccm_config(params_vdev, &new_params->others.ccm_cfg); |
|---|
| 4098 | + ops->ccm_config(params_vdev, &new_params->others.ccm_cfg, id); |
|---|
| 3992 | 4099 | |
|---|
| 3993 | 4100 | if (module_cfg_update & ISP32_MODULE_GOC) |
|---|
| 3994 | | - ops->goc_config(params_vdev, &new_params->others.gammaout_cfg); |
|---|
| 4101 | + ops->goc_config(params_vdev, &new_params->others.gammaout_cfg, id); |
|---|
| 3995 | 4102 | |
|---|
| 3996 | 4103 | /* range csm->cgc->cproc->ie */ |
|---|
| 3997 | 4104 | if (module_cfg_update & ISP3X_MODULE_CSM) |
|---|
| 3998 | | - ops->csm_config(params_vdev, &new_params->others.csm_cfg); |
|---|
| 4105 | + ops->csm_config(params_vdev, &new_params->others.csm_cfg, id); |
|---|
| 3999 | 4106 | |
|---|
| 4000 | 4107 | if (module_cfg_update & ISP3X_MODULE_CGC) |
|---|
| 4001 | | - ops->cgc_config(params_vdev, &new_params->others.cgc_cfg); |
|---|
| 4108 | + ops->cgc_config(params_vdev, &new_params->others.cgc_cfg, id); |
|---|
| 4002 | 4109 | |
|---|
| 4003 | 4110 | if (module_cfg_update & ISP32_MODULE_CPROC) |
|---|
| 4004 | | - ops->cproc_config(params_vdev, &new_params->others.cproc_cfg); |
|---|
| 4111 | + ops->cproc_config(params_vdev, &new_params->others.cproc_cfg, id); |
|---|
| 4005 | 4112 | |
|---|
| 4006 | 4113 | if (module_cfg_update & ISP32_MODULE_IE) |
|---|
| 4007 | | - ops->ie_config(params_vdev, &new_params->others.ie_cfg); |
|---|
| 4114 | + ops->ie_config(params_vdev, &new_params->others.ie_cfg, id); |
|---|
| 4008 | 4115 | |
|---|
| 4009 | 4116 | if (module_cfg_update & ISP32_MODULE_HDRMGE) |
|---|
| 4010 | | - ops->hdrmge_config(params_vdev, &new_params->others.hdrmge_cfg, type); |
|---|
| 4117 | + ops->hdrmge_config(params_vdev, &new_params->others.hdrmge_cfg, type, id); |
|---|
| 4011 | 4118 | |
|---|
| 4012 | 4119 | if (module_cfg_update & ISP32_MODULE_DRC) |
|---|
| 4013 | | - ops->hdrdrc_config(params_vdev, &new_params->others.drc_cfg, type); |
|---|
| 4120 | + ops->hdrdrc_config(params_vdev, &new_params->others.drc_cfg, type, id); |
|---|
| 4014 | 4121 | |
|---|
| 4015 | 4122 | if (module_cfg_update & ISP32_MODULE_GIC) |
|---|
| 4016 | | - ops->gic_config(params_vdev, &new_params->others.gic_cfg); |
|---|
| 4123 | + ops->gic_config(params_vdev, &new_params->others.gic_cfg, id); |
|---|
| 4017 | 4124 | |
|---|
| 4018 | 4125 | if (module_cfg_update & ISP32_MODULE_DHAZ) |
|---|
| 4019 | | - ops->dhaz_config(params_vdev, &new_params->others.dhaz_cfg); |
|---|
| 4126 | + ops->dhaz_config(params_vdev, &new_params->others.dhaz_cfg, id); |
|---|
| 4020 | 4127 | |
|---|
| 4021 | 4128 | if (module_cfg_update & ISP32_MODULE_3DLUT) |
|---|
| 4022 | | - ops->isp3dlut_config(params_vdev, &new_params->others.isp3dlut_cfg); |
|---|
| 4129 | + ops->isp3dlut_config(params_vdev, &new_params->others.isp3dlut_cfg, id); |
|---|
| 4023 | 4130 | |
|---|
| 4024 | 4131 | if (module_cfg_update & ISP32_MODULE_LDCH) |
|---|
| 4025 | | - ops->ldch_config(params_vdev, &new_params->others.ldch_cfg); |
|---|
| 4132 | + ops->ldch_config(params_vdev, &new_params->others.ldch_cfg, id); |
|---|
| 4026 | 4133 | |
|---|
| 4027 | 4134 | if (module_cfg_update & ISP32_MODULE_YNR) |
|---|
| 4028 | | - ops->ynr_config(params_vdev, &new_params->others.ynr_cfg); |
|---|
| 4135 | + ops->ynr_config(params_vdev, &new_params->others.ynr_cfg, id); |
|---|
| 4029 | 4136 | |
|---|
| 4030 | 4137 | if (module_cfg_update & ISP32_MODULE_CNR) |
|---|
| 4031 | | - ops->cnr_config(params_vdev, &new_params->others.cnr_cfg); |
|---|
| 4138 | + ops->cnr_config(params_vdev, &new_params->others.cnr_cfg, id); |
|---|
| 4032 | 4139 | |
|---|
| 4033 | 4140 | if (module_cfg_update & ISP32_MODULE_SHARP) |
|---|
| 4034 | | - ops->sharp_config(params_vdev, &new_params->others.sharp_cfg); |
|---|
| 4141 | + ops->sharp_config(params_vdev, &new_params->others.sharp_cfg, id); |
|---|
| 4035 | 4142 | |
|---|
| 4036 | 4143 | if (module_cfg_update & ISP32_MODULE_BAYNR) |
|---|
| 4037 | | - ops->baynr_config(params_vdev, &new_params->others.baynr_cfg); |
|---|
| 4144 | + ops->baynr_config(params_vdev, &new_params->others.baynr_cfg, id); |
|---|
| 4038 | 4145 | |
|---|
| 4039 | 4146 | if (module_cfg_update & ISP32_MODULE_BAY3D) |
|---|
| 4040 | | - ops->bay3d_config(params_vdev, &new_params->others.bay3d_cfg); |
|---|
| 4147 | + ops->bay3d_config(params_vdev, &new_params->others.bay3d_cfg, id); |
|---|
| 4041 | 4148 | |
|---|
| 4042 | 4149 | if (module_cfg_update & ISP32_MODULE_CAC) |
|---|
| 4043 | | - ops->cac_config(params_vdev, &new_params->others.cac_cfg); |
|---|
| 4150 | + ops->cac_config(params_vdev, &new_params->others.cac_cfg, id); |
|---|
| 4044 | 4151 | |
|---|
| 4045 | 4152 | if (module_cfg_update & ISP32_MODULE_GAIN) |
|---|
| 4046 | | - ops->gain_config(params_vdev, &new_params->others.gain_cfg); |
|---|
| 4153 | + ops->gain_config(params_vdev, &new_params->others.gain_cfg, id); |
|---|
| 4047 | 4154 | |
|---|
| 4048 | 4155 | if (module_cfg_update & ISP32_MODULE_VSM) |
|---|
| 4049 | | - ops->vsm_config(params_vdev, &new_params->others.vsm_cfg); |
|---|
| 4156 | + ops->vsm_config(params_vdev, &new_params->others.vsm_cfg, id); |
|---|
| 4050 | 4157 | } |
|---|
| 4051 | 4158 | |
|---|
| 4052 | 4159 | static __maybe_unused |
|---|
| 4053 | 4160 | void __isp_isr_other_en(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 4054 | 4161 | const struct isp32_isp_params_cfg *new_params, |
|---|
| 4055 | | - enum rkisp_params_type type) |
|---|
| 4162 | + enum rkisp_params_type type, u32 id) |
|---|
| 4056 | 4163 | { |
|---|
| 4057 | 4164 | struct rkisp_isp_params_ops_v32 *ops = |
|---|
| 4058 | 4165 | (struct rkisp_isp_params_ops_v32 *)params_vdev->priv_ops; |
|---|
| .. | .. |
|---|
| 4070 | 4177 | return; |
|---|
| 4071 | 4178 | |
|---|
| 4072 | 4179 | v4l2_dbg(4, rkisp_debug, ¶ms_vdev->dev->v4l2_dev, |
|---|
| 4073 | | - "%s seq:%d module_en_update:0x%llx module_ens:0x%llx\n", |
|---|
| 4074 | | - __func__, new_params->frame_id, module_en_update, module_ens); |
|---|
| 4180 | + "%s id:%d seq:%d module_en_update:0x%llx module_ens:0x%llx\n", |
|---|
| 4181 | + __func__, id, new_params->frame_id, module_en_update, module_ens); |
|---|
| 4075 | 4182 | |
|---|
| 4076 | 4183 | if (module_en_update & ISP32_MODULE_DPCC) |
|---|
| 4077 | | - ops->dpcc_enable(params_vdev, !!(module_ens & ISP32_MODULE_DPCC)); |
|---|
| 4184 | + ops->dpcc_enable(params_vdev, !!(module_ens & ISP32_MODULE_DPCC), id); |
|---|
| 4078 | 4185 | |
|---|
| 4079 | 4186 | if (module_en_update & ISP32_MODULE_BLS) |
|---|
| 4080 | | - ops->bls_enable(params_vdev, !!(module_ens & ISP32_MODULE_BLS)); |
|---|
| 4187 | + ops->bls_enable(params_vdev, !!(module_ens & ISP32_MODULE_BLS), id); |
|---|
| 4081 | 4188 | |
|---|
| 4082 | 4189 | if (module_en_update & ISP32_MODULE_SDG) |
|---|
| 4083 | | - ops->sdg_enable(params_vdev, !!(module_ens & ISP32_MODULE_SDG)); |
|---|
| 4190 | + ops->sdg_enable(params_vdev, !!(module_ens & ISP32_MODULE_SDG), id); |
|---|
| 4084 | 4191 | |
|---|
| 4085 | 4192 | if (module_en_update & ISP32_MODULE_LSC) { |
|---|
| 4086 | | - ops->lsc_enable(params_vdev, !!(module_ens & ISP32_MODULE_LSC)); |
|---|
| 4193 | + ops->lsc_enable(params_vdev, !!(module_ens & ISP32_MODULE_LSC), id); |
|---|
| 4087 | 4194 | priv_val->lsc_en = !!(module_ens & ISP32_MODULE_LSC); |
|---|
| 4088 | 4195 | } |
|---|
| 4089 | 4196 | |
|---|
| 4090 | 4197 | if (module_en_update & ISP32_MODULE_AWB_GAIN) |
|---|
| 4091 | | - ops->awbgain_enable(params_vdev, !!(module_ens & ISP32_MODULE_AWB_GAIN)); |
|---|
| 4198 | + ops->awbgain_enable(params_vdev, !!(module_ens & ISP32_MODULE_AWB_GAIN), id); |
|---|
| 4092 | 4199 | |
|---|
| 4093 | 4200 | if (module_en_update & ISP32_MODULE_DEBAYER) |
|---|
| 4094 | | - ops->debayer_enable(params_vdev, !!(module_ens & ISP32_MODULE_DEBAYER)); |
|---|
| 4201 | + ops->debayer_enable(params_vdev, !!(module_ens & ISP32_MODULE_DEBAYER), id); |
|---|
| 4095 | 4202 | |
|---|
| 4096 | 4203 | if (module_en_update & ISP32_MODULE_CCM) |
|---|
| 4097 | | - ops->ccm_enable(params_vdev, !!(module_ens & ISP32_MODULE_CCM)); |
|---|
| 4204 | + ops->ccm_enable(params_vdev, !!(module_ens & ISP32_MODULE_CCM), id); |
|---|
| 4098 | 4205 | |
|---|
| 4099 | 4206 | if (module_en_update & ISP32_MODULE_GOC) |
|---|
| 4100 | | - ops->goc_enable(params_vdev, !!(module_ens & ISP32_MODULE_GOC)); |
|---|
| 4207 | + ops->goc_enable(params_vdev, !!(module_ens & ISP32_MODULE_GOC), id); |
|---|
| 4101 | 4208 | |
|---|
| 4102 | 4209 | if (module_en_update & ISP32_MODULE_CPROC) |
|---|
| 4103 | | - ops->cproc_enable(params_vdev, !!(module_ens & ISP32_MODULE_CPROC)); |
|---|
| 4210 | + ops->cproc_enable(params_vdev, !!(module_ens & ISP32_MODULE_CPROC), id); |
|---|
| 4104 | 4211 | |
|---|
| 4105 | 4212 | if (module_en_update & ISP32_MODULE_IE) |
|---|
| 4106 | | - ops->ie_enable(params_vdev, !!(module_ens & ISP32_MODULE_IE)); |
|---|
| 4213 | + ops->ie_enable(params_vdev, !!(module_ens & ISP32_MODULE_IE), id); |
|---|
| 4107 | 4214 | |
|---|
| 4108 | 4215 | if (module_en_update & ISP32_MODULE_HDRMGE) { |
|---|
| 4109 | | - ops->hdrmge_enable(params_vdev, !!(module_ens & ISP32_MODULE_HDRMGE)); |
|---|
| 4216 | + ops->hdrmge_enable(params_vdev, !!(module_ens & ISP32_MODULE_HDRMGE), id); |
|---|
| 4110 | 4217 | priv_val->mge_en = !!(module_ens & ISP32_MODULE_HDRMGE); |
|---|
| 4111 | 4218 | } |
|---|
| 4112 | 4219 | |
|---|
| 4113 | 4220 | if (module_en_update & ISP32_MODULE_DRC) { |
|---|
| 4114 | | - ops->hdrdrc_enable(params_vdev, !!(module_ens & ISP32_MODULE_DRC)); |
|---|
| 4221 | + ops->hdrdrc_enable(params_vdev, !!(module_ens & ISP32_MODULE_DRC), id); |
|---|
| 4115 | 4222 | priv_val->drc_en = !!(module_ens & ISP32_MODULE_DRC); |
|---|
| 4116 | 4223 | } |
|---|
| 4117 | 4224 | |
|---|
| 4118 | 4225 | if (module_en_update & ISP32_MODULE_GIC) |
|---|
| 4119 | | - ops->gic_enable(params_vdev, !!(module_ens & ISP32_MODULE_GIC)); |
|---|
| 4226 | + ops->gic_enable(params_vdev, !!(module_ens & ISP32_MODULE_GIC), id); |
|---|
| 4120 | 4227 | |
|---|
| 4121 | 4228 | if (module_en_update & ISP32_MODULE_DHAZ) { |
|---|
| 4122 | | - ops->dhaz_enable(params_vdev, !!(module_ens & ISP32_MODULE_DHAZ)); |
|---|
| 4229 | + ops->dhaz_enable(params_vdev, !!(module_ens & ISP32_MODULE_DHAZ), id); |
|---|
| 4123 | 4230 | priv_val->dhaz_en = !!(module_ens & ISP32_MODULE_DHAZ); |
|---|
| 4124 | 4231 | } |
|---|
| 4125 | 4232 | |
|---|
| 4126 | 4233 | if (module_en_update & ISP32_MODULE_3DLUT) { |
|---|
| 4127 | | - ops->isp3dlut_enable(params_vdev, !!(module_ens & ISP32_MODULE_3DLUT)); |
|---|
| 4234 | + ops->isp3dlut_enable(params_vdev, !!(module_ens & ISP32_MODULE_3DLUT), id); |
|---|
| 4128 | 4235 | priv_val->lut3d_en = !!(module_ens & ISP32_MODULE_3DLUT); |
|---|
| 4129 | 4236 | } |
|---|
| 4130 | 4237 | |
|---|
| 4131 | 4238 | if (module_en_update & ISP32_MODULE_LDCH) |
|---|
| 4132 | | - ops->ldch_enable(params_vdev, !!(module_ens & ISP32_MODULE_LDCH)); |
|---|
| 4239 | + ops->ldch_enable(params_vdev, !!(module_ens & ISP32_MODULE_LDCH), id); |
|---|
| 4133 | 4240 | |
|---|
| 4134 | 4241 | if (module_en_update & ISP32_MODULE_YNR) |
|---|
| 4135 | | - ops->ynr_enable(params_vdev, !!(module_ens & ISP32_MODULE_YNR)); |
|---|
| 4242 | + ops->ynr_enable(params_vdev, !!(module_ens & ISP32_MODULE_YNR), id); |
|---|
| 4136 | 4243 | |
|---|
| 4137 | 4244 | if (module_en_update & ISP32_MODULE_CNR) |
|---|
| 4138 | | - ops->cnr_enable(params_vdev, !!(module_ens & ISP32_MODULE_CNR)); |
|---|
| 4245 | + ops->cnr_enable(params_vdev, !!(module_ens & ISP32_MODULE_CNR), id); |
|---|
| 4139 | 4246 | |
|---|
| 4140 | 4247 | if (module_en_update & ISP32_MODULE_SHARP) |
|---|
| 4141 | | - ops->sharp_enable(params_vdev, !!(module_ens & ISP32_MODULE_SHARP)); |
|---|
| 4248 | + ops->sharp_enable(params_vdev, !!(module_ens & ISP32_MODULE_SHARP), id); |
|---|
| 4142 | 4249 | |
|---|
| 4143 | 4250 | if (module_en_update & ISP32_MODULE_BAYNR) |
|---|
| 4144 | | - ops->baynr_enable(params_vdev, !!(module_ens & ISP32_MODULE_BAYNR)); |
|---|
| 4251 | + ops->baynr_enable(params_vdev, !!(module_ens & ISP32_MODULE_BAYNR), id); |
|---|
| 4145 | 4252 | |
|---|
| 4146 | 4253 | if (module_en_update & ISP32_MODULE_BAY3D) { |
|---|
| 4147 | | - ops->bay3d_enable(params_vdev, !!(module_ens & ISP32_MODULE_BAY3D)); |
|---|
| 4254 | + ops->bay3d_enable(params_vdev, !!(module_ens & ISP32_MODULE_BAY3D), id); |
|---|
| 4148 | 4255 | priv_val->bay3d_en = !!(module_ens & ISP32_MODULE_BAY3D); |
|---|
| 4149 | 4256 | } |
|---|
| 4150 | 4257 | |
|---|
| 4151 | 4258 | if (module_en_update & ISP32_MODULE_CAC) |
|---|
| 4152 | | - ops->cac_enable(params_vdev, !!(module_ens & ISP32_MODULE_CAC)); |
|---|
| 4259 | + ops->cac_enable(params_vdev, !!(module_ens & ISP32_MODULE_CAC), id); |
|---|
| 4153 | 4260 | |
|---|
| 4154 | 4261 | if (module_en_update & ISP32_MODULE_GAIN || |
|---|
| 4155 | 4262 | ((priv_val->buf_info_owner == RKISP_INFO2DRR_OWNER_GAIN) && |
|---|
| 4156 | | - !(isp3_param_read(params_vdev, ISP3X_GAIN_CTRL) & ISP3X_GAIN_2DDR_EN))) |
|---|
| 4157 | | - ops->gain_enable(params_vdev, !!(module_ens & ISP32_MODULE_GAIN)); |
|---|
| 4263 | + !(isp3_param_read(params_vdev, ISP3X_GAIN_CTRL, id) & ISP3X_GAIN_2DDR_EN))) |
|---|
| 4264 | + ops->gain_enable(params_vdev, !!(module_ens & ISP32_MODULE_GAIN), id); |
|---|
| 4158 | 4265 | |
|---|
| 4159 | 4266 | if (module_en_update & ISP32_MODULE_VSM) |
|---|
| 4160 | | - ops->vsm_enable(params_vdev, !!(module_ens & ISP32_MODULE_VSM)); |
|---|
| 4267 | + ops->vsm_enable(params_vdev, !!(module_ens & ISP32_MODULE_VSM), id); |
|---|
| 4161 | 4268 | |
|---|
| 4162 | 4269 | /* gain disable, using global gain for cnr */ |
|---|
| 4163 | | - gain_ctrl = isp3_param_read_cache(params_vdev, ISP3X_GAIN_CTRL); |
|---|
| 4164 | | - cnr_ctrl = isp3_param_read_cache(params_vdev, ISP3X_CNR_CTRL); |
|---|
| 4270 | + gain_ctrl = isp3_param_read_cache(params_vdev, ISP3X_GAIN_CTRL, id); |
|---|
| 4271 | + cnr_ctrl = isp3_param_read_cache(params_vdev, ISP3X_CNR_CTRL, id); |
|---|
| 4165 | 4272 | if (!(gain_ctrl & ISP32_MODULE_EN) && cnr_ctrl & ISP32_MODULE_EN) { |
|---|
| 4166 | 4273 | cnr_ctrl |= BIT(1); |
|---|
| 4167 | | - isp3_param_write(params_vdev, cnr_ctrl, ISP3X_CNR_CTRL); |
|---|
| 4168 | | - val = isp3_param_read(params_vdev, ISP3X_CNR_EXGAIN) & 0x3ff; |
|---|
| 4169 | | - isp3_param_write(params_vdev, val | 0x8000, ISP3X_CNR_EXGAIN); |
|---|
| 4274 | + isp3_param_write(params_vdev, cnr_ctrl, ISP3X_CNR_CTRL, id); |
|---|
| 4275 | + val = isp3_param_read(params_vdev, ISP3X_CNR_EXGAIN, id) & 0x3ff; |
|---|
| 4276 | + isp3_param_write(params_vdev, val | 0x8000, ISP3X_CNR_EXGAIN, id); |
|---|
| 4170 | 4277 | } |
|---|
| 4171 | 4278 | } |
|---|
| 4172 | 4279 | |
|---|
| 4173 | 4280 | static __maybe_unused |
|---|
| 4174 | 4281 | void __isp_isr_meas_config(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 4175 | 4282 | struct isp32_isp_params_cfg *new_params, |
|---|
| 4176 | | - enum rkisp_params_type type) |
|---|
| 4283 | + enum rkisp_params_type type, u32 id) |
|---|
| 4177 | 4284 | { |
|---|
| 4178 | 4285 | struct rkisp_isp_params_ops_v32 *ops = |
|---|
| 4179 | 4286 | (struct rkisp_isp_params_ops_v32 *)params_vdev->priv_ops; |
|---|
| 4180 | | - struct rkisp_isp_params_val_v32 *priv_val = |
|---|
| 4181 | | - (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 4182 | 4287 | u64 module_cfg_update = new_params->module_cfg_update; |
|---|
| 4183 | 4288 | |
|---|
| 4184 | 4289 | params_vdev->cur_frame_id = new_params->frame_id; |
|---|
| .. | .. |
|---|
| 4190 | 4295 | return; |
|---|
| 4191 | 4296 | |
|---|
| 4192 | 4297 | v4l2_dbg(4, rkisp_debug, ¶ms_vdev->dev->v4l2_dev, |
|---|
| 4193 | | - "%s seq:%d module_cfg_update:0x%llx\n", |
|---|
| 4194 | | - __func__, new_params->frame_id, module_cfg_update); |
|---|
| 4298 | + "%s id:%d seq:%d module_cfg_update:0x%llx\n", |
|---|
| 4299 | + __func__, id, new_params->frame_id, module_cfg_update); |
|---|
| 4195 | 4300 | |
|---|
| 4196 | 4301 | if ((module_cfg_update & ISP32_MODULE_RAWAF)) |
|---|
| 4197 | | - ops->rawaf_config(params_vdev, &new_params->meas.rawaf); |
|---|
| 4302 | + ops->rawaf_config(params_vdev, &new_params->meas.rawaf, id); |
|---|
| 4198 | 4303 | |
|---|
| 4199 | 4304 | if ((module_cfg_update & ISP32_MODULE_RAWAE0) && |
|---|
| 4200 | 4305 | !(params_vdev->afaemode_en && params_vdev->dev->isp_ver == ISP_V32_L)) |
|---|
| 4201 | | - ops->rawae0_config(params_vdev, &new_params->meas.rawae0); |
|---|
| 4306 | + ops->rawae0_config(params_vdev, &new_params->meas.rawae0, id); |
|---|
| 4202 | 4307 | |
|---|
| 4203 | 4308 | if ((module_cfg_update & ISP32_MODULE_RAWAE1)) |
|---|
| 4204 | | - ops->rawae1_config(params_vdev, &new_params->meas.rawae1); |
|---|
| 4309 | + ops->rawae1_config(params_vdev, &new_params->meas.rawae1, id); |
|---|
| 4205 | 4310 | |
|---|
| 4206 | 4311 | if ((module_cfg_update & ISP32_MODULE_RAWAE2)) |
|---|
| 4207 | | - ops->rawae2_config(params_vdev, &new_params->meas.rawae2); |
|---|
| 4312 | + ops->rawae2_config(params_vdev, &new_params->meas.rawae2, id); |
|---|
| 4208 | 4313 | |
|---|
| 4209 | 4314 | if ((module_cfg_update & ISP32_MODULE_RAWAE3) && |
|---|
| 4210 | 4315 | !(params_vdev->afaemode_en && params_vdev->dev->isp_ver == ISP_V32)) |
|---|
| 4211 | | - ops->rawae3_config(params_vdev, &new_params->meas.rawae3); |
|---|
| 4316 | + ops->rawae3_config(params_vdev, &new_params->meas.rawae3, id); |
|---|
| 4212 | 4317 | |
|---|
| 4213 | 4318 | if ((module_cfg_update & ISP32_MODULE_RAWHIST0)) |
|---|
| 4214 | | - ops->rawhst0_config(params_vdev, &new_params->meas.rawhist0); |
|---|
| 4319 | + ops->rawhst0_config(params_vdev, &new_params->meas.rawhist0, id); |
|---|
| 4215 | 4320 | |
|---|
| 4216 | 4321 | if ((module_cfg_update & ISP32_MODULE_RAWHIST1)) |
|---|
| 4217 | | - ops->rawhst1_config(params_vdev, &new_params->meas.rawhist1); |
|---|
| 4322 | + ops->rawhst1_config(params_vdev, &new_params->meas.rawhist1, id); |
|---|
| 4218 | 4323 | |
|---|
| 4219 | 4324 | if ((module_cfg_update & ISP32_MODULE_RAWHIST2)) |
|---|
| 4220 | | - ops->rawhst2_config(params_vdev, &new_params->meas.rawhist2); |
|---|
| 4325 | + ops->rawhst2_config(params_vdev, &new_params->meas.rawhist2, id); |
|---|
| 4221 | 4326 | |
|---|
| 4222 | 4327 | if ((module_cfg_update & ISP32_MODULE_RAWHIST3)) |
|---|
| 4223 | | - ops->rawhst3_config(params_vdev, &new_params->meas.rawhist3); |
|---|
| 4328 | + ops->rawhst3_config(params_vdev, &new_params->meas.rawhist3, id); |
|---|
| 4224 | 4329 | |
|---|
| 4225 | | - if ((module_cfg_update & ISP32_MODULE_RAWAWB) || |
|---|
| 4226 | | - ((priv_val->buf_info_owner == RKISP_INFO2DRR_OWNER_AWB) && |
|---|
| 4227 | | - !(isp3_param_read(params_vdev, ISP3X_RAWAWB_CTRL) & ISP32_RAWAWB_2DDR_PATH_EN))) |
|---|
| 4228 | | - ops->rawawb_config(params_vdev, &new_params->meas.rawawb); |
|---|
| 4330 | + if ((module_cfg_update & ISP32_MODULE_RAWAWB)) |
|---|
| 4331 | + ops->rawawb_config(params_vdev, &new_params->meas.rawawb, id); |
|---|
| 4229 | 4332 | } |
|---|
| 4230 | 4333 | |
|---|
| 4231 | 4334 | static __maybe_unused |
|---|
| 4232 | 4335 | void __isp_isr_meas_en(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 4233 | 4336 | struct isp32_isp_params_cfg *new_params, |
|---|
| 4234 | | - enum rkisp_params_type type) |
|---|
| 4337 | + enum rkisp_params_type type, u32 id) |
|---|
| 4235 | 4338 | { |
|---|
| 4236 | 4339 | struct rkisp_isp_params_ops_v32 *ops = |
|---|
| 4237 | 4340 | (struct rkisp_isp_params_ops_v32 *)params_vdev->priv_ops; |
|---|
| .. | .. |
|---|
| 4245 | 4348 | return; |
|---|
| 4246 | 4349 | |
|---|
| 4247 | 4350 | v4l2_dbg(4, rkisp_debug, ¶ms_vdev->dev->v4l2_dev, |
|---|
| 4248 | | - "%s seq:%d module_en_update:0x%llx module_ens:0x%llx\n", |
|---|
| 4249 | | - __func__, new_params->frame_id, module_en_update, module_ens); |
|---|
| 4351 | + "%s id:%d seq:%d module_en_update:0x%llx module_ens:0x%llx\n", |
|---|
| 4352 | + __func__, id, new_params->frame_id, module_en_update, module_ens); |
|---|
| 4250 | 4353 | |
|---|
| 4251 | 4354 | if (module_en_update & ISP32_MODULE_RAWAF) |
|---|
| 4252 | | - ops->rawaf_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWAF)); |
|---|
| 4355 | + ops->rawaf_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWAF), id); |
|---|
| 4253 | 4356 | |
|---|
| 4254 | 4357 | if ((module_en_update & ISP32_MODULE_RAWAE0) && |
|---|
| 4255 | 4358 | !(params_vdev->afaemode_en && params_vdev->dev->isp_ver == ISP_V32_L)) |
|---|
| 4256 | | - ops->rawae0_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWAE0)); |
|---|
| 4359 | + ops->rawae0_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWAE0), id); |
|---|
| 4257 | 4360 | |
|---|
| 4258 | 4361 | if (module_en_update & ISP32_MODULE_RAWAE1) |
|---|
| 4259 | | - ops->rawae1_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWAE1)); |
|---|
| 4362 | + ops->rawae1_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWAE1), id); |
|---|
| 4260 | 4363 | |
|---|
| 4261 | 4364 | if (module_en_update & ISP32_MODULE_RAWAE2) |
|---|
| 4262 | | - ops->rawae2_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWAE2)); |
|---|
| 4365 | + ops->rawae2_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWAE2), id); |
|---|
| 4263 | 4366 | |
|---|
| 4264 | 4367 | if ((module_en_update & ISP32_MODULE_RAWAE3) && |
|---|
| 4265 | 4368 | !(params_vdev->afaemode_en && params_vdev->dev->isp_ver == ISP_V32)) |
|---|
| 4266 | | - ops->rawae3_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWAE3)); |
|---|
| 4369 | + ops->rawae3_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWAE3), id); |
|---|
| 4267 | 4370 | |
|---|
| 4268 | 4371 | if (module_en_update & ISP32_MODULE_RAWHIST0) |
|---|
| 4269 | | - ops->rawhst0_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWHIST0)); |
|---|
| 4372 | + ops->rawhst0_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWHIST0), id); |
|---|
| 4270 | 4373 | |
|---|
| 4271 | 4374 | if (module_en_update & ISP32_MODULE_RAWHIST1) |
|---|
| 4272 | | - ops->rawhst1_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWHIST1)); |
|---|
| 4375 | + ops->rawhst1_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWHIST1), id); |
|---|
| 4273 | 4376 | |
|---|
| 4274 | 4377 | if (module_en_update & ISP32_MODULE_RAWHIST2) |
|---|
| 4275 | | - ops->rawhst2_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWHIST2)); |
|---|
| 4378 | + ops->rawhst2_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWHIST2), id); |
|---|
| 4276 | 4379 | |
|---|
| 4277 | 4380 | if (module_en_update & ISP32_MODULE_RAWHIST3) |
|---|
| 4278 | | - ops->rawhst3_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWHIST3)); |
|---|
| 4381 | + ops->rawhst3_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWHIST3), id); |
|---|
| 4279 | 4382 | |
|---|
| 4280 | 4383 | if (module_en_update & ISP32_MODULE_RAWAWB) |
|---|
| 4281 | | - ops->rawawb_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWAWB)); |
|---|
| 4282 | | -} |
|---|
| 4283 | | - |
|---|
| 4284 | | -static __maybe_unused |
|---|
| 4285 | | -void __isp_config_hdrshd(struct rkisp_isp_params_vdev *params_vdev) |
|---|
| 4286 | | -{ |
|---|
| 4287 | | - struct rkisp_isp_params_ops_v32 *ops = |
|---|
| 4288 | | - (struct rkisp_isp_params_ops_v32 *)params_vdev->priv_ops; |
|---|
| 4289 | | - struct rkisp_isp_params_val_v32 *priv_val = |
|---|
| 4290 | | - (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 4291 | | - |
|---|
| 4292 | | - ops->hdrmge_config(params_vdev, &priv_val->last_hdrmge, RKISP_PARAMS_SHD); |
|---|
| 4293 | | - ops->hdrdrc_config(params_vdev, &priv_val->last_hdrdrc, RKISP_PARAMS_SHD); |
|---|
| 4384 | + ops->rawawb_enable(params_vdev, !!(module_ens & ISP32_MODULE_RAWAWB), id); |
|---|
| 4294 | 4385 | } |
|---|
| 4295 | 4386 | |
|---|
| 4296 | 4387 | static |
|---|
| 4297 | 4388 | void rkisp_params_cfgsram_v32(struct rkisp_isp_params_vdev *params_vdev) |
|---|
| 4298 | 4389 | { |
|---|
| 4299 | | - struct isp32_isp_params_cfg *params = params_vdev->isp32_params; |
|---|
| 4390 | + u32 id = params_vdev->dev->unite_index; |
|---|
| 4391 | + struct isp32_isp_params_cfg *params = params_vdev->isp32_params + id; |
|---|
| 4300 | 4392 | |
|---|
| 4301 | | - isp_lsc_matrix_cfg_sram(params_vdev, ¶ms->others.lsc_cfg, true); |
|---|
| 4302 | | - isp_rawhstbig_cfg_sram(params_vdev, ¶ms->meas.rawhist1, 1, true); |
|---|
| 4303 | | - isp_rawhstbig_cfg_sram(params_vdev, ¶ms->meas.rawhist2, 2, true); |
|---|
| 4304 | | - isp_rawhstbig_cfg_sram(params_vdev, ¶ms->meas.rawhist3, 0, true); |
|---|
| 4305 | | - isp_rawawb_cfg_sram(params_vdev, ¶ms->meas.rawawb, true); |
|---|
| 4393 | + isp_lsc_matrix_cfg_sram(params_vdev, ¶ms->others.lsc_cfg, true, id); |
|---|
| 4394 | + isp_rawhstbig_cfg_sram(params_vdev, ¶ms->meas.rawhist1, 1, true, id); |
|---|
| 4395 | + isp_rawhstbig_cfg_sram(params_vdev, ¶ms->meas.rawhist2, 2, true, id); |
|---|
| 4396 | + isp_rawhstbig_cfg_sram(params_vdev, ¶ms->meas.rawhist3, 0, true, id); |
|---|
| 4397 | + isp_rawawb_cfg_sram(params_vdev, ¶ms->meas.rawawb, true, id); |
|---|
| 4306 | 4398 | } |
|---|
| 4307 | 4399 | |
|---|
| 4308 | 4400 | static int |
|---|
| .. | .. |
|---|
| 4313 | 4405 | struct rkisp_isp_subdev *isp_sdev = &dev->isp_sdev; |
|---|
| 4314 | 4406 | struct rkisp_isp_params_val_v32 *priv_val; |
|---|
| 4315 | 4407 | u64 module_en_update, module_ens; |
|---|
| 4316 | | - int ret, i; |
|---|
| 4408 | + int ret, i, id; |
|---|
| 4317 | 4409 | |
|---|
| 4318 | 4410 | priv_val = (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 4319 | 4411 | module_en_update = new_params->module_en_update; |
|---|
| 4320 | 4412 | module_ens = new_params->module_ens; |
|---|
| 4321 | 4413 | |
|---|
| 4322 | | - priv_val->buf_3dlut_idx = 0; |
|---|
| 4323 | | - for (i = 0; i < ISP32_3DLUT_BUF_NUM; i++) { |
|---|
| 4324 | | - if (priv_val->buf_3dlut[i].mem_priv) |
|---|
| 4325 | | - continue; |
|---|
| 4326 | | - priv_val->buf_3dlut[i].is_need_vaddr = true; |
|---|
| 4327 | | - priv_val->buf_3dlut[i].size = ISP32_3DLUT_BUF_SIZE; |
|---|
| 4328 | | - ret = rkisp_alloc_buffer(dev, &priv_val->buf_3dlut[i]); |
|---|
| 4329 | | - if (ret) { |
|---|
| 4330 | | - dev_err(dev->dev, "alloc 3dlut buf fail:%d\n", ret); |
|---|
| 4331 | | - goto err_3dlut; |
|---|
| 4414 | + for (id = 0; id <= !!dev->hw_dev->unite; id++) { |
|---|
| 4415 | + priv_val->buf_3dlut_idx[id] = 0; |
|---|
| 4416 | + for (i = 0; i < ISP32_3DLUT_BUF_NUM; i++) { |
|---|
| 4417 | + if (priv_val->buf_3dlut[id][i].mem_priv) |
|---|
| 4418 | + continue; |
|---|
| 4419 | + priv_val->buf_3dlut[id][i].is_need_vaddr = true; |
|---|
| 4420 | + priv_val->buf_3dlut[id][i].size = ISP32_3DLUT_BUF_SIZE; |
|---|
| 4421 | + ret = rkisp_alloc_buffer(dev, &priv_val->buf_3dlut[id][i]); |
|---|
| 4422 | + if (ret) { |
|---|
| 4423 | + dev_err(dev->dev, "alloc 3dlut buf fail:%d\n", ret); |
|---|
| 4424 | + goto err_3dlut; |
|---|
| 4425 | + } |
|---|
| 4332 | 4426 | } |
|---|
| 4333 | 4427 | } |
|---|
| 4334 | 4428 | |
|---|
| .. | .. |
|---|
| 4343 | 4437 | u32 h = ALIGN(isp_sdev->in_crop.height, 16); |
|---|
| 4344 | 4438 | u32 val, wrap_line, wsize, div; |
|---|
| 4345 | 4439 | bool is_alloc; |
|---|
| 4440 | + |
|---|
| 4441 | + if (dev->hw_dev->unite) |
|---|
| 4442 | + w = ALIGN(isp_sdev->in_crop.width / 2 + RKMOUDLE_UNITE_EXTEND_PIXEL, 16); |
|---|
| 4346 | 4443 | |
|---|
| 4347 | 4444 | priv_val->is_lo8x8 = (!new_params->others.bay3d_cfg.lo4x8_en && |
|---|
| 4348 | 4445 | !new_params->others.bay3d_cfg.lo4x4_en); |
|---|
| .. | .. |
|---|
| 4361 | 4458 | wsize *= 2; |
|---|
| 4362 | 4459 | div = is_bwopt_dis ? 1 : 2; |
|---|
| 4363 | 4460 | val = ALIGN(wsize * h / div, 16); |
|---|
| 4461 | + priv_val->bay3d_iir_size = val; |
|---|
| 4462 | + if (dev->hw_dev->unite) |
|---|
| 4463 | + val *= 2; |
|---|
| 4364 | 4464 | is_alloc = true; |
|---|
| 4365 | 4465 | if (priv_val->buf_3dnr_iir.mem_priv) { |
|---|
| 4366 | 4466 | if (val > priv_val->buf_3dnr_iir.size) |
|---|
| .. | .. |
|---|
| 4381 | 4481 | val = w * h / div; |
|---|
| 4382 | 4482 | /* pixel to Byte and align */ |
|---|
| 4383 | 4483 | val = ALIGN(val * 2, 16); |
|---|
| 4484 | + priv_val->bay3d_ds_size = val; |
|---|
| 4485 | + if (dev->hw_dev->unite) |
|---|
| 4486 | + val *= 2; |
|---|
| 4384 | 4487 | is_alloc = true; |
|---|
| 4385 | 4488 | if (priv_val->buf_3dnr_ds.mem_priv) { |
|---|
| 4386 | 4489 | if (val > priv_val->buf_3dnr_ds.size) |
|---|
| .. | .. |
|---|
| 4413 | 4516 | val = ALIGN(wsize * wrap_line / div, 16); |
|---|
| 4414 | 4517 | is_alloc = true; |
|---|
| 4415 | 4518 | if (priv_val->buf_3dnr_cur.mem_priv) { |
|---|
| 4416 | | - if (val > priv_val->buf_3dnr_cur.size || |
|---|
| 4417 | | - val < dev->hw_dev->sram.size) |
|---|
| 4519 | + if (val > priv_val->buf_3dnr_cur.size || val < dev->hw_dev->sram.size) |
|---|
| 4418 | 4520 | rkisp_free_buffer(dev, &priv_val->buf_3dnr_cur); |
|---|
| 4419 | 4521 | else |
|---|
| 4420 | 4522 | is_alloc = false; |
|---|
| .. | .. |
|---|
| 4440 | 4542 | if (dev->isp_ver == ISP_V32_L) { |
|---|
| 4441 | 4543 | if (dev->hw_dev->is_frm_buf && !priv_val->buf_frm.mem_priv) { |
|---|
| 4442 | 4544 | priv_val->buf_frm.size = ISP32_LITE_FRM_BUF_SIZE; |
|---|
| 4545 | + if (dev->hw_dev->unite) |
|---|
| 4546 | + priv_val->buf_frm.size *= 2; |
|---|
| 4443 | 4547 | ret = rkisp_alloc_buffer(dev, &priv_val->buf_frm); |
|---|
| 4444 | 4548 | if (ret) { |
|---|
| 4445 | 4549 | dev_err(dev->dev, "alloc frm buf fail:%d\n", ret); |
|---|
| .. | .. |
|---|
| 4469 | 4573 | rkisp_free_buffer(dev, &priv_val->buf_3dnr_iir); |
|---|
| 4470 | 4574 | rkisp_free_buffer(dev, &priv_val->buf_3dnr_ds); |
|---|
| 4471 | 4575 | err_3dnr: |
|---|
| 4576 | + id = dev->hw_dev->unite ? 1 : 0; |
|---|
| 4472 | 4577 | i = ISP32_3DLUT_BUF_NUM; |
|---|
| 4473 | 4578 | err_3dlut: |
|---|
| 4474 | | - for (i -= 1; i >= 0; i--) |
|---|
| 4475 | | - rkisp_free_buffer(dev, &priv_val->buf_3dlut[i]); |
|---|
| 4579 | + for (; id >= 0; id--) { |
|---|
| 4580 | + for (i -= 1; i >= 0; i--) |
|---|
| 4581 | + rkisp_free_buffer(dev, &priv_val->buf_3dlut[id][i]); |
|---|
| 4582 | + i = ISP32_3DLUT_BUF_NUM; |
|---|
| 4583 | + } |
|---|
| 4476 | 4584 | return ret; |
|---|
| 4477 | 4585 | } |
|---|
| 4478 | 4586 | |
|---|
| .. | .. |
|---|
| 4664 | 4772 | if (ispdev->isp_ver == ISP_V32_L) |
|---|
| 4665 | 4773 | return rkisp_params_check_bigmode_v32_lite(params_vdev); |
|---|
| 4666 | 4774 | |
|---|
| 4775 | + if (hw->unite == ISP_UNITE_ONE) |
|---|
| 4776 | + hw->is_multi_overflow = true; |
|---|
| 4667 | 4777 | multi_overflow: |
|---|
| 4668 | 4778 | if (hw->is_multi_overflow) { |
|---|
| 4669 | 4779 | ispdev->multi_index = 0; |
|---|
| .. | .. |
|---|
| 4831 | 4941 | rkisp_params_first_cfg_v32(struct rkisp_isp_params_vdev *params_vdev) |
|---|
| 4832 | 4942 | { |
|---|
| 4833 | 4943 | struct rkisp_device *dev = params_vdev->dev; |
|---|
| 4944 | + struct rkisp_hw_dev *hw = dev->hw_dev; |
|---|
| 4834 | 4945 | struct rkisp_isp_params_val_v32 *priv_val = |
|---|
| 4835 | 4946 | (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 4836 | 4947 | |
|---|
| .. | .. |
|---|
| 4847 | 4958 | priv_val->lsc_en = 0; |
|---|
| 4848 | 4959 | priv_val->mge_en = 0; |
|---|
| 4849 | 4960 | priv_val->lut3d_en = 0; |
|---|
| 4961 | + if (hw->unite) { |
|---|
| 4962 | + if (dev->is_bigmode) |
|---|
| 4963 | + rkisp_next_set_bits(dev, ISP3X_ISP_CTRL1, 0, |
|---|
| 4964 | + ISP3X_BIGMODE_MANUAL | ISP3X_BIGMODE_FORCE_EN, false); |
|---|
| 4965 | + __isp_isr_meas_config(params_vdev, params_vdev->isp32_params + 1, RKISP_PARAMS_ALL, 1); |
|---|
| 4966 | + __isp_isr_other_config(params_vdev, params_vdev->isp32_params + 1, RKISP_PARAMS_ALL, 1); |
|---|
| 4967 | + __isp_isr_other_en(params_vdev, params_vdev->isp32_params + 1, RKISP_PARAMS_ALL, 1); |
|---|
| 4968 | + __isp_isr_meas_en(params_vdev, params_vdev->isp32_params + 1, RKISP_PARAMS_ALL, 1); |
|---|
| 4969 | + } |
|---|
| 4850 | 4970 | if (dev->is_bigmode) |
|---|
| 4851 | | - rkisp_set_bits(params_vdev->dev, ISP3X_ISP_CTRL1, 0, |
|---|
| 4971 | + rkisp_set_bits(dev, ISP3X_ISP_CTRL1, 0, |
|---|
| 4852 | 4972 | ISP3X_BIGMODE_MANUAL | ISP3X_BIGMODE_FORCE_EN, false); |
|---|
| 4853 | 4973 | |
|---|
| 4854 | | - __isp_isr_meas_config(params_vdev, params_vdev->isp32_params, RKISP_PARAMS_ALL); |
|---|
| 4855 | | - __isp_isr_other_config(params_vdev, params_vdev->isp32_params, RKISP_PARAMS_ALL); |
|---|
| 4856 | | - __isp_isr_other_en(params_vdev, params_vdev->isp32_params, RKISP_PARAMS_ALL); |
|---|
| 4857 | | - __isp_isr_meas_en(params_vdev, params_vdev->isp32_params, RKISP_PARAMS_ALL); |
|---|
| 4974 | + __isp_isr_meas_config(params_vdev, params_vdev->isp32_params, RKISP_PARAMS_ALL, 0); |
|---|
| 4975 | + __isp_isr_other_config(params_vdev, params_vdev->isp32_params, RKISP_PARAMS_ALL, 0); |
|---|
| 4976 | + __isp_isr_other_en(params_vdev, params_vdev->isp32_params, RKISP_PARAMS_ALL, 0); |
|---|
| 4977 | + __isp_isr_meas_en(params_vdev, params_vdev->isp32_params, RKISP_PARAMS_ALL, 0); |
|---|
| 4858 | 4978 | |
|---|
| 4859 | | - priv_val->cur_hdrmge = params_vdev->isp32_params->others.hdrmge_cfg; |
|---|
| 4860 | | - priv_val->cur_hdrdrc = params_vdev->isp32_params->others.drc_cfg; |
|---|
| 4861 | | - priv_val->last_hdrmge = priv_val->cur_hdrmge; |
|---|
| 4862 | | - priv_val->last_hdrdrc = priv_val->cur_hdrdrc; |
|---|
| 4863 | 4979 | spin_unlock(¶ms_vdev->config_lock); |
|---|
| 4864 | 4980 | |
|---|
| 4865 | 4981 | if (dev->hw_dev->is_frm_buf && priv_val->buf_frm.mem_priv) { |
|---|
| 4866 | | - isp3_param_write(params_vdev, priv_val->buf_frm.size, ISP32L_FRM_BUF_WR_SIZE); |
|---|
| 4867 | | - isp3_param_write(params_vdev, priv_val->buf_frm.dma_addr, ISP32L_FRM_BUF_WR_BASE); |
|---|
| 4868 | | - isp3_param_write(params_vdev, priv_val->buf_frm.dma_addr, ISP32L_FRM_BUF_RD_BASE); |
|---|
| 4982 | + u32 size = priv_val->buf_frm.size; |
|---|
| 4983 | + u32 addr = priv_val->buf_frm.dma_addr; |
|---|
| 4984 | + |
|---|
| 4985 | + if (hw->unite) { |
|---|
| 4986 | + size /= 2; |
|---|
| 4987 | + isp3_param_write(params_vdev, size, ISP32L_FRM_BUF_WR_SIZE, 1); |
|---|
| 4988 | + isp3_param_write(params_vdev, addr + size, ISP32L_FRM_BUF_WR_BASE, 1); |
|---|
| 4989 | + isp3_param_write(params_vdev, addr + size, ISP32L_FRM_BUF_RD_BASE, 1); |
|---|
| 4990 | + } |
|---|
| 4991 | + isp3_param_write(params_vdev, size, ISP32L_FRM_BUF_WR_SIZE, 0); |
|---|
| 4992 | + isp3_param_write(params_vdev, addr, ISP32L_FRM_BUF_WR_BASE, 0); |
|---|
| 4993 | + isp3_param_write(params_vdev, addr, ISP32L_FRM_BUF_RD_BASE, 0); |
|---|
| 4869 | 4994 | } |
|---|
| 4870 | 4995 | if (dev->hw_dev->is_single && (dev->isp_state & ISP_START)) |
|---|
| 4871 | 4996 | rkisp_set_bits(dev, ISP3X_ISP_CTRL0, 0, CIF_ISP_CTRL_ISP_CFG_UPD, true); |
|---|
| .. | .. |
|---|
| 4879 | 5004 | |
|---|
| 4880 | 5005 | static void rkisp_clear_first_param_v32(struct rkisp_isp_params_vdev *params_vdev) |
|---|
| 4881 | 5006 | { |
|---|
| 4882 | | - memset(params_vdev->isp32_params, 0, sizeof(struct isp32_isp_params_cfg)); |
|---|
| 5007 | + u32 size = sizeof(struct isp32_isp_params_cfg); |
|---|
| 5008 | + |
|---|
| 5009 | + if (params_vdev->dev->hw_dev->unite) |
|---|
| 5010 | + size *= 2; |
|---|
| 5011 | + memset(params_vdev->isp32_params, 0, size); |
|---|
| 4883 | 5012 | } |
|---|
| 4884 | 5013 | |
|---|
| 4885 | 5014 | static void rkisp_deinit_mesh_buf(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 4886 | | - u64 module_id) |
|---|
| 5015 | + u64 module_id, u32 id) |
|---|
| 4887 | 5016 | { |
|---|
| 4888 | 5017 | struct rkisp_isp_params_val_v32 *priv_val; |
|---|
| 4889 | 5018 | struct rkisp_dummy_buffer *buf; |
|---|
| .. | .. |
|---|
| 4895 | 5024 | |
|---|
| 4896 | 5025 | switch (module_id) { |
|---|
| 4897 | 5026 | case ISP32_MODULE_CAC: |
|---|
| 4898 | | - buf = priv_val->buf_cac; |
|---|
| 5027 | + buf = priv_val->buf_cac[id]; |
|---|
| 4899 | 5028 | break; |
|---|
| 4900 | 5029 | case ISP32_MODULE_LDCH: |
|---|
| 4901 | 5030 | default: |
|---|
| 4902 | | - buf = priv_val->buf_ldch; |
|---|
| 5031 | + buf = priv_val->buf_ldch[id]; |
|---|
| 4903 | 5032 | break; |
|---|
| 4904 | 5033 | } |
|---|
| 4905 | 5034 | |
|---|
| .. | .. |
|---|
| 4919 | 5048 | u32 mesh_h = meshsize->meas_height; |
|---|
| 4920 | 5049 | u32 mesh_size, buf_size; |
|---|
| 4921 | 5050 | int i, ret, buf_cnt = meshsize->buf_cnt; |
|---|
| 5051 | + int id = meshsize->unite_isp_id; |
|---|
| 4922 | 5052 | bool is_alloc; |
|---|
| 4923 | 5053 | |
|---|
| 4924 | 5054 | priv_val = params_vdev->priv_val; |
|---|
| .. | .. |
|---|
| 4929 | 5059 | |
|---|
| 4930 | 5060 | switch (meshsize->module_id) { |
|---|
| 4931 | 5061 | case ISP32_MODULE_CAC: |
|---|
| 4932 | | - priv_val->buf_cac_idx = 0; |
|---|
| 4933 | | - buf = priv_val->buf_cac; |
|---|
| 5062 | + priv_val->buf_cac_idx[id] = 0; |
|---|
| 5063 | + buf = priv_val->buf_cac[id]; |
|---|
| 4934 | 5064 | mesh_w = (mesh_w + 62) / 64 * 9; |
|---|
| 4935 | 5065 | mesh_h = (mesh_h + 62) / 64 * 2; |
|---|
| 4936 | 5066 | mesh_size = mesh_w * 4 * mesh_h; |
|---|
| 4937 | 5067 | break; |
|---|
| 4938 | 5068 | case ISP32_MODULE_LDCH: |
|---|
| 4939 | 5069 | default: |
|---|
| 4940 | | - priv_val->buf_ldch_idx = 0; |
|---|
| 4941 | | - buf = priv_val->buf_ldch; |
|---|
| 5070 | + priv_val->buf_ldch_idx[id] = 0; |
|---|
| 5071 | + buf = priv_val->buf_ldch[id]; |
|---|
| 4942 | 5072 | mesh_w = ((mesh_w + 15) / 16 + 2) / 2; |
|---|
| 4943 | 5073 | mesh_h = (mesh_h + 7) / 8 + 1; |
|---|
| 4944 | 5074 | mesh_size = mesh_w * 4 * mesh_h; |
|---|
| .. | .. |
|---|
| 4979 | 5109 | |
|---|
| 4980 | 5110 | return 0; |
|---|
| 4981 | 5111 | err: |
|---|
| 4982 | | - rkisp_deinit_mesh_buf(params_vdev, meshsize->module_id); |
|---|
| 5112 | + rkisp_deinit_mesh_buf(params_vdev, meshsize->module_id, id); |
|---|
| 4983 | 5113 | return -ENOMEM; |
|---|
| 4984 | 5114 | } |
|---|
| 4985 | 5115 | |
|---|
| .. | .. |
|---|
| 4987 | 5117 | rkisp_get_param_size_v32(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 4988 | 5118 | unsigned int sizes[]) |
|---|
| 4989 | 5119 | { |
|---|
| 4990 | | - sizes[0] = sizeof(struct isp32_isp_params_cfg); |
|---|
| 5120 | + u32 mult = params_vdev->dev->hw_dev->unite ? 2 : 1; |
|---|
| 5121 | + |
|---|
| 5122 | + sizes[0] = sizeof(struct isp32_isp_params_cfg) * mult; |
|---|
| 4991 | 5123 | } |
|---|
| 4992 | 5124 | |
|---|
| 4993 | 5125 | static void |
|---|
| .. | .. |
|---|
| 4997 | 5129 | struct rkisp_isp_params_val_v32 *priv_val; |
|---|
| 4998 | 5130 | struct rkisp_meshbuf_info *meshbuf = meshbuf_inf; |
|---|
| 4999 | 5131 | struct rkisp_dummy_buffer *buf; |
|---|
| 5000 | | - int i; |
|---|
| 5132 | + int i, id = meshbuf->unite_isp_id; |
|---|
| 5001 | 5133 | |
|---|
| 5002 | 5134 | priv_val = params_vdev->priv_val; |
|---|
| 5003 | 5135 | switch (meshbuf->module_id) { |
|---|
| 5004 | 5136 | case ISP32_MODULE_CAC: |
|---|
| 5005 | | - priv_val->buf_cac_idx = 0; |
|---|
| 5006 | | - buf = priv_val->buf_cac; |
|---|
| 5137 | + priv_val->buf_cac_idx[id] = 0; |
|---|
| 5138 | + buf = priv_val->buf_cac[id]; |
|---|
| 5007 | 5139 | break; |
|---|
| 5008 | 5140 | case ISP32_MODULE_LDCH: |
|---|
| 5009 | 5141 | default: |
|---|
| 5010 | | - priv_val->buf_ldch_idx = 0; |
|---|
| 5011 | | - buf = priv_val->buf_ldch; |
|---|
| 5142 | + priv_val->buf_ldch_idx[id] = 0; |
|---|
| 5143 | + buf = priv_val->buf_ldch[id]; |
|---|
| 5012 | 5144 | break; |
|---|
| 5013 | 5145 | } |
|---|
| 5014 | 5146 | |
|---|
| .. | .. |
|---|
| 5030 | 5162 | { |
|---|
| 5031 | 5163 | struct rkisp_meshbuf_size *meshsize = size; |
|---|
| 5032 | 5164 | |
|---|
| 5165 | + if (!params_vdev->dev->hw_dev->unite) |
|---|
| 5166 | + meshsize->unite_isp_id = 0; |
|---|
| 5033 | 5167 | return rkisp_init_mesh_buf(params_vdev, meshsize); |
|---|
| 5034 | 5168 | } |
|---|
| 5035 | 5169 | |
|---|
| .. | .. |
|---|
| 5037 | 5171 | rkisp_params_free_meshbuf_v32(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 5038 | 5172 | u64 module_id) |
|---|
| 5039 | 5173 | { |
|---|
| 5040 | | - rkisp_deinit_mesh_buf(params_vdev, module_id); |
|---|
| 5174 | + int id; |
|---|
| 5175 | + |
|---|
| 5176 | + for (id = 0; id <= !!params_vdev->dev->hw_dev->unite; id++) |
|---|
| 5177 | + rkisp_deinit_mesh_buf(params_vdev, module_id, id); |
|---|
| 5041 | 5178 | } |
|---|
| 5042 | 5179 | |
|---|
| 5043 | 5180 | static int |
|---|
| .. | .. |
|---|
| 5134 | 5271 | cfg->buf_fd[i] = buf->dma_fd; |
|---|
| 5135 | 5272 | } |
|---|
| 5136 | 5273 | buf = &priv_val->buf_info[0]; |
|---|
| 5137 | | - isp3_param_write(params_vdev, buf->dma_addr, ISP3X_MI_GAIN_WR_BASE); |
|---|
| 5138 | | - isp3_param_write(params_vdev, buf->size, ISP3X_MI_GAIN_WR_SIZE); |
|---|
| 5139 | | - isp3_param_write(params_vdev, wsize, ISP3X_MI_GAIN_WR_LENGTH); |
|---|
| 5274 | + isp3_param_write(params_vdev, buf->dma_addr, ISP3X_MI_GAIN_WR_BASE, 0); |
|---|
| 5275 | + isp3_param_write(params_vdev, buf->size, ISP3X_MI_GAIN_WR_SIZE, 0); |
|---|
| 5276 | + isp3_param_write(params_vdev, wsize, ISP3X_MI_GAIN_WR_LENGTH, 0); |
|---|
| 5140 | 5277 | if (dev->hw_dev->is_single) |
|---|
| 5141 | 5278 | rkisp_write(dev, ISP3X_MI_WR_CTRL2, ISP3X_GAINSELF_UPD, true); |
|---|
| 5142 | 5279 | rkisp_set_reg_cache_bits(dev, reg, mask, ctrl); |
|---|
| .. | .. |
|---|
| 5164 | 5301 | { |
|---|
| 5165 | 5302 | struct rkisp_device *ispdev = params_vdev->dev; |
|---|
| 5166 | 5303 | struct rkisp_isp_params_val_v32 *priv_val; |
|---|
| 5167 | | - int i; |
|---|
| 5304 | + int i, id; |
|---|
| 5168 | 5305 | |
|---|
| 5169 | 5306 | priv_val = (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 5170 | 5307 | rkisp_free_buffer(ispdev, &priv_val->buf_frm); |
|---|
| .. | .. |
|---|
| 5173 | 5310 | rkisp_free_buffer(ispdev, &priv_val->buf_3dnr_ds); |
|---|
| 5174 | 5311 | for (i = 0; i < ISP32_LSC_LUT_BUF_NUM; i++) |
|---|
| 5175 | 5312 | rkisp_free_buffer(ispdev, &priv_val->buf_lsclut[i]); |
|---|
| 5176 | | - for (i = 0; i < ISP32_3DLUT_BUF_NUM; i++) |
|---|
| 5177 | | - rkisp_free_buffer(ispdev, &priv_val->buf_3dlut[i]); |
|---|
| 5178 | 5313 | for (i = 0; i < RKISP_STATS_DDR_BUF_NUM; i++) |
|---|
| 5179 | 5314 | rkisp_free_buffer(ispdev, &ispdev->stats_vdev.stats_buf[i]); |
|---|
| 5315 | + for (id = 0; id <= !!ispdev->hw_dev->unite; id++) { |
|---|
| 5316 | + for (i = 0; i < ISP32_3DLUT_BUF_NUM; i++) |
|---|
| 5317 | + rkisp_free_buffer(ispdev, &priv_val->buf_3dlut[id][i]); |
|---|
| 5318 | + } |
|---|
| 5180 | 5319 | priv_val->buf_info_owner = 0; |
|---|
| 5181 | 5320 | priv_val->buf_info_cnt = 0; |
|---|
| 5182 | 5321 | priv_val->buf_info_idx = -1; |
|---|
| .. | .. |
|---|
| 5187 | 5326 | static void |
|---|
| 5188 | 5327 | rkisp_params_fop_release_v32(struct rkisp_isp_params_vdev *params_vdev) |
|---|
| 5189 | 5328 | { |
|---|
| 5190 | | - rkisp_deinit_mesh_buf(params_vdev, ISP32_MODULE_LDCH); |
|---|
| 5191 | | - rkisp_deinit_mesh_buf(params_vdev, ISP32_MODULE_CAC); |
|---|
| 5329 | + int id; |
|---|
| 5330 | + |
|---|
| 5331 | + for (id = 0; id <= !!params_vdev->dev->hw_dev->unite; id++) { |
|---|
| 5332 | + rkisp_deinit_mesh_buf(params_vdev, ISP32_MODULE_LDCH, id); |
|---|
| 5333 | + rkisp_deinit_mesh_buf(params_vdev, ISP32_MODULE_CAC, id); |
|---|
| 5334 | + } |
|---|
| 5192 | 5335 | } |
|---|
| 5193 | 5336 | |
|---|
| 5194 | 5337 | /* Not called when the camera active, thus not isr protection. */ |
|---|
| .. | .. |
|---|
| 5198 | 5341 | params_vdev->isp32_params->module_ens = 0; |
|---|
| 5199 | 5342 | params_vdev->isp32_params->module_en_update = 0x7ffffffffff; |
|---|
| 5200 | 5343 | |
|---|
| 5201 | | - __isp_isr_other_en(params_vdev, params_vdev->isp32_params, RKISP_PARAMS_ALL); |
|---|
| 5202 | | - __isp_isr_meas_en(params_vdev, params_vdev->isp32_params, RKISP_PARAMS_ALL); |
|---|
| 5344 | + __isp_isr_other_en(params_vdev, params_vdev->isp32_params, RKISP_PARAMS_ALL, 0); |
|---|
| 5345 | + __isp_isr_meas_en(params_vdev, params_vdev->isp32_params, RKISP_PARAMS_ALL, 0); |
|---|
| 5346 | + if (params_vdev->dev->hw_dev->unite) { |
|---|
| 5347 | + __isp_isr_other_en(params_vdev, params_vdev->isp32_params, RKISP_PARAMS_ALL, 1); |
|---|
| 5348 | + __isp_isr_meas_en(params_vdev, params_vdev->isp32_params, RKISP_PARAMS_ALL, 1); |
|---|
| 5349 | + } |
|---|
| 5203 | 5350 | } |
|---|
| 5204 | 5351 | |
|---|
| 5205 | 5352 | static void |
|---|
| 5206 | 5353 | module_data_abandon(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 5207 | | - struct isp32_isp_params_cfg *params) |
|---|
| 5354 | + struct isp32_isp_params_cfg *params, u32 id) |
|---|
| 5208 | 5355 | { |
|---|
| 5209 | 5356 | struct rkisp_isp_params_val_v32 *priv_val; |
|---|
| 5210 | 5357 | struct isp2x_mesh_head *mesh_head; |
|---|
| .. | .. |
|---|
| 5215 | 5362 | const struct isp32_ldch_cfg *arg = ¶ms->others.ldch_cfg; |
|---|
| 5216 | 5363 | |
|---|
| 5217 | 5364 | for (i = 0; i < ISP32_MESH_BUF_NUM; i++) { |
|---|
| 5218 | | - if (priv_val->buf_ldch[i].vaddr && |
|---|
| 5219 | | - arg->buf_fd == priv_val->buf_ldch[i].dma_fd) { |
|---|
| 5220 | | - mesh_head = (struct isp2x_mesh_head *)priv_val->buf_ldch[i].vaddr; |
|---|
| 5365 | + if (priv_val->buf_ldch[id][i].vaddr && |
|---|
| 5366 | + arg->buf_fd == priv_val->buf_ldch[id][i].dma_fd) { |
|---|
| 5367 | + mesh_head = (struct isp2x_mesh_head *)priv_val->buf_ldch[id][i].vaddr; |
|---|
| 5221 | 5368 | mesh_head->stat = MESH_BUF_CHIPINUSE; |
|---|
| 5222 | 5369 | break; |
|---|
| 5223 | 5370 | } |
|---|
| .. | .. |
|---|
| 5228 | 5375 | const struct isp32_cac_cfg *arg = ¶ms->others.cac_cfg; |
|---|
| 5229 | 5376 | |
|---|
| 5230 | 5377 | for (i = 0; i < ISP32_MESH_BUF_NUM; i++) { |
|---|
| 5231 | | - if (priv_val->buf_cac[i].vaddr && |
|---|
| 5232 | | - arg->buf_fd == priv_val->buf_cac[i].dma_fd) { |
|---|
| 5233 | | - mesh_head = (struct isp2x_mesh_head *)priv_val->buf_cac[i].vaddr; |
|---|
| 5378 | + if (priv_val->buf_cac[id][i].vaddr && |
|---|
| 5379 | + arg->buf_fd == priv_val->buf_cac[id][i].dma_fd) { |
|---|
| 5380 | + mesh_head = (struct isp2x_mesh_head *)priv_val->buf_cac[id][i].vaddr; |
|---|
| 5234 | 5381 | mesh_head->stat = MESH_BUF_CHIPINUSE; |
|---|
| 5235 | 5382 | break; |
|---|
| 5236 | 5383 | } |
|---|
| .. | .. |
|---|
| 5242 | 5389 | rkisp_params_cfg_v32(struct rkisp_isp_params_vdev *params_vdev, |
|---|
| 5243 | 5390 | u32 frame_id, enum rkisp_params_type type) |
|---|
| 5244 | 5391 | { |
|---|
| 5392 | + struct rkisp_hw_dev *hw = params_vdev->dev->hw_dev; |
|---|
| 5245 | 5393 | struct isp32_isp_params_cfg *new_params = NULL; |
|---|
| 5246 | 5394 | struct rkisp_buffer *cur_buf = params_vdev->cur_buf; |
|---|
| 5247 | | - struct rkisp_device *dev = params_vdev->dev; |
|---|
| 5248 | | - struct rkisp_hw_dev *hw_dev = dev->hw_dev; |
|---|
| 5249 | 5395 | |
|---|
| 5250 | 5396 | spin_lock(¶ms_vdev->config_lock); |
|---|
| 5251 | 5397 | if (!params_vdev->streamon) |
|---|
| .. | .. |
|---|
| 5264 | 5410 | else if (new_params->module_en_update || |
|---|
| 5265 | 5411 | (new_params->module_cfg_update & ISP32_MODULE_FORCE)) { |
|---|
| 5266 | 5412 | /* update en immediately */ |
|---|
| 5267 | | - __isp_isr_meas_config(params_vdev, new_params, type); |
|---|
| 5268 | | - __isp_isr_other_config(params_vdev, new_params, type); |
|---|
| 5269 | | - __isp_isr_other_en(params_vdev, new_params, type); |
|---|
| 5270 | | - __isp_isr_meas_en(params_vdev, new_params, type); |
|---|
| 5413 | + __isp_isr_meas_config(params_vdev, new_params, RKISP_PARAMS_ALL, 0); |
|---|
| 5414 | + __isp_isr_other_config(params_vdev, new_params, RKISP_PARAMS_ALL, 0); |
|---|
| 5415 | + __isp_isr_other_en(params_vdev, new_params, RKISP_PARAMS_ALL, 0); |
|---|
| 5416 | + __isp_isr_meas_en(params_vdev, new_params, RKISP_PARAMS_ALL, 0); |
|---|
| 5271 | 5417 | new_params->module_cfg_update = 0; |
|---|
| 5418 | + if (hw->unite) { |
|---|
| 5419 | + struct isp32_isp_params_cfg *params = new_params + 1; |
|---|
| 5420 | + |
|---|
| 5421 | + __isp_isr_meas_config(params_vdev, params, RKISP_PARAMS_ALL, 1); |
|---|
| 5422 | + __isp_isr_other_config(params_vdev, params, RKISP_PARAMS_ALL, 1); |
|---|
| 5423 | + __isp_isr_other_en(params_vdev, params, RKISP_PARAMS_ALL, 1); |
|---|
| 5424 | + __isp_isr_meas_en(params_vdev, params, RKISP_PARAMS_ALL, 1); |
|---|
| 5425 | + params->module_cfg_update = 0; |
|---|
| 5426 | + } |
|---|
| 5272 | 5427 | } |
|---|
| 5273 | 5428 | if (new_params->module_cfg_update & |
|---|
| 5274 | 5429 | (ISP32_MODULE_LDCH | ISP32_MODULE_CAC)) { |
|---|
| 5275 | | - module_data_abandon(params_vdev, new_params); |
|---|
| 5430 | + module_data_abandon(params_vdev, new_params, 0); |
|---|
| 5431 | + if (hw->unite) |
|---|
| 5432 | + module_data_abandon(params_vdev, new_params, 1); |
|---|
| 5433 | + |
|---|
| 5276 | 5434 | } |
|---|
| 5277 | 5435 | vb2_buffer_done(&cur_buf->vb.vb2_buf, VB2_BUF_STATE_DONE); |
|---|
| 5278 | 5436 | cur_buf = NULL; |
|---|
| .. | .. |
|---|
| 5289 | 5447 | goto unlock; |
|---|
| 5290 | 5448 | |
|---|
| 5291 | 5449 | new_params = (struct isp32_isp_params_cfg *)(cur_buf->vaddr[0]); |
|---|
| 5292 | | - __isp_isr_meas_config(params_vdev, new_params, type); |
|---|
| 5293 | | - __isp_isr_other_config(params_vdev, new_params, type); |
|---|
| 5294 | | - __isp_isr_other_en(params_vdev, new_params, type); |
|---|
| 5295 | | - __isp_isr_meas_en(params_vdev, new_params, type); |
|---|
| 5296 | | - if (!hw_dev->is_single && type != RKISP_PARAMS_SHD) |
|---|
| 5297 | | - __isp_config_hdrshd(params_vdev); |
|---|
| 5450 | + if (hw->unite) { |
|---|
| 5451 | + __isp_isr_meas_config(params_vdev, new_params + 1, type, 1); |
|---|
| 5452 | + __isp_isr_other_config(params_vdev, new_params + 1, type, 1); |
|---|
| 5453 | + __isp_isr_other_en(params_vdev, new_params + 1, type, 1); |
|---|
| 5454 | + __isp_isr_meas_en(params_vdev, new_params + 1, type, 1); |
|---|
| 5455 | + } |
|---|
| 5456 | + __isp_isr_meas_config(params_vdev, new_params, type, 0); |
|---|
| 5457 | + __isp_isr_other_config(params_vdev, new_params, type, 0); |
|---|
| 5458 | + __isp_isr_other_en(params_vdev, new_params, type, 0); |
|---|
| 5459 | + __isp_isr_meas_en(params_vdev, new_params, type, 0); |
|---|
| 5298 | 5460 | |
|---|
| 5299 | 5461 | if (type != RKISP_PARAMS_IMD) { |
|---|
| 5300 | | - struct rkisp_isp_params_val_v32 *priv_val = |
|---|
| 5301 | | - (struct rkisp_isp_params_val_v32 *)params_vdev->priv_val; |
|---|
| 5302 | | - |
|---|
| 5303 | | - priv_val->last_hdrmge = priv_val->cur_hdrmge; |
|---|
| 5304 | | - priv_val->last_hdrdrc = priv_val->cur_hdrdrc; |
|---|
| 5305 | | - priv_val->cur_hdrmge = new_params->others.hdrmge_cfg; |
|---|
| 5306 | | - priv_val->cur_hdrdrc = new_params->others.drc_cfg; |
|---|
| 5307 | 5462 | new_params->module_cfg_update = 0; |
|---|
| 5463 | + if (hw->unite) |
|---|
| 5464 | + (new_params++)->module_cfg_update = 0; |
|---|
| 5308 | 5465 | vb2_buffer_done(&cur_buf->vb.vb2_buf, VB2_BUF_STATE_DONE); |
|---|
| 5309 | 5466 | cur_buf = NULL; |
|---|
| 5310 | 5467 | } |
|---|
| .. | .. |
|---|
| 5317 | 5474 | static void |
|---|
| 5318 | 5475 | rkisp_params_clear_fstflg(struct rkisp_isp_params_vdev *params_vdev) |
|---|
| 5319 | 5476 | { |
|---|
| 5320 | | - u32 value = isp3_param_read(params_vdev, ISP3X_ISP_CTRL1); |
|---|
| 5477 | + u32 value = isp3_param_read(params_vdev, ISP3X_ISP_CTRL1, 0); |
|---|
| 5321 | 5478 | |
|---|
| 5322 | 5479 | value &= (ISP3X_YNR_FST_FRAME | ISP3X_ADRC_FST_FRAME | |
|---|
| 5323 | 5480 | ISP3X_DHAZ_FST_FRAME | ISP3X_CNR_FST_FRAME | |
|---|
| 5324 | | - ISP3X_RAW3D_FST_FRAME); |
|---|
| 5481 | + ISP3X_RAW3D_FST_FRAME | ISP32_SHP_FST_FRAME); |
|---|
| 5325 | 5482 | if (value) { |
|---|
| 5326 | | - isp3_param_clear_bits(params_vdev, ISP3X_ISP_CTRL1, value); |
|---|
| 5483 | + isp3_param_clear_bits(params_vdev, ISP3X_ISP_CTRL1, value, 0); |
|---|
| 5484 | + if (params_vdev->dev->hw_dev->unite) |
|---|
| 5485 | + isp3_param_clear_bits(params_vdev, ISP3X_ISP_CTRL1, value, 1); |
|---|
| 5327 | 5486 | } |
|---|
| 5328 | 5487 | } |
|---|
| 5329 | 5488 | |
|---|
| .. | .. |
|---|
| 5382 | 5541 | return -ENOMEM; |
|---|
| 5383 | 5542 | |
|---|
| 5384 | 5543 | size = sizeof(struct isp32_isp_params_cfg); |
|---|
| 5544 | + if (params_vdev->dev->hw_dev->unite) |
|---|
| 5545 | + size *= 2; |
|---|
| 5385 | 5546 | params_vdev->isp32_params = vmalloc(size); |
|---|
| 5386 | 5547 | if (!params_vdev->isp32_params) { |
|---|
| 5387 | 5548 | kfree(priv_val); |
|---|