|
18 | 18 | unsigned int kcal_red = 256; |
19 | 19 | unsigned int kcal_green = 256; |
20 | 20 | unsigned int kcal_blue = 256; |
| 21 | +unsigned int kcal_hue = 0; |
| 22 | +unsigned int kcal_sat = 255; |
| 23 | +unsigned int kcal_val = 255; |
| 24 | +unsigned int kcal_cont = 255; |
21 | 25 |
|
22 | 26 | module_param(kcal_red, uint, 0644); |
23 | 27 | module_param(kcal_green, uint, 0644); |
24 | 28 | module_param(kcal_blue, uint, 0644); |
| 29 | +module_param(kcal_hue, uint, 0644); |
| 30 | +module_param(kcal_sat, uint, 0644); |
| 31 | +module_param(kcal_val, uint, 0644); |
| 32 | +module_param(kcal_cont, uint, 0644); |
25 | 33 |
|
26 | 34 | static int sde_write_3d_gamut(struct sde_hw_blk_reg_map *hw, |
27 | 35 | struct drm_msm_3d_gamut *payload, u32 base, |
@@ -184,6 +192,7 @@ void sde_setup_dspp_pccv4(struct sde_hw_dspp *ctx, void *cfg) |
184 | 192 | int i = 0; |
185 | 193 | int kcal_min = 20; |
186 | 194 | u32 base = 0; |
| 195 | + u32 opcode = 0, local_opcode = 0; |
187 | 196 |
|
188 | 197 | if (!ctx || !cfg) { |
189 | 198 | DRM_ERROR("invalid param ctx %pK cfg %pK\n", ctx, cfg); |
@@ -246,22 +255,47 @@ void sde_setup_dspp_pccv4(struct sde_hw_dspp *ctx, void *cfg) |
246 | 255 | } |
247 | 256 |
|
248 | 257 | SDE_REG_WRITE(&ctx->hw, base + PCC_C_OFF, coeffs->c); |
249 | | -// ==== |
250 | | -// RED |
| 258 | + |
| 259 | + // RED |
251 | 260 | SDE_REG_WRITE(&ctx->hw, base + PCC_R_OFF, |
252 | 261 | i == 0 ? (coeffs->r * kcal_red) / 256 : coeffs->r); |
253 | | -// GREEN |
| 262 | + // GREEN |
254 | 263 | SDE_REG_WRITE(&ctx->hw, base + PCC_G_OFF, |
255 | 264 | i == 1 ? (coeffs->g * kcal_green) / 256 : coeffs->g); |
256 | | -// BLUE |
| 265 | + // BLUE |
257 | 266 | SDE_REG_WRITE(&ctx->hw, base + PCC_B_OFF, |
258 | 267 | i == 2 ? (coeffs->b * kcal_blue) / 256 : coeffs->b); |
259 | | -// ===== |
| 268 | + |
260 | 269 | SDE_REG_WRITE(&ctx->hw, base + PCC_RG_OFF, coeffs->rg); |
261 | 270 | SDE_REG_WRITE(&ctx->hw, base + PCC_RB_OFF, coeffs->rb); |
262 | 271 | SDE_REG_WRITE(&ctx->hw, base + PCC_GB_OFF, coeffs->gb); |
263 | 272 | SDE_REG_WRITE(&ctx->hw, base + PCC_RGB_OFF, coeffs->rgb); |
264 | 273 | } |
265 | 274 |
|
| 275 | + opcode = SDE_REG_READ(&ctx->hw, ctx->cap->sblk->hsic.base); |
| 276 | + |
| 277 | + // HUE |
| 278 | + SDE_REG_WRITE(&ctx->hw, ctx->cap->sblk->hsic.base + PA_HUE_OFF, |
| 279 | + kcal_hue & PA_HUE_MASK); |
| 280 | + local_opcode |= PA_HUE_EN; |
| 281 | + |
| 282 | + // SATURATION |
| 283 | + SDE_REG_WRITE(&ctx->hw, ctx->cap->sblk->hsic.base + PA_SAT_OFF, |
| 284 | + kcal_sat & PA_SAT_MASK); |
| 285 | + local_opcode |= PA_SAT_EN; |
| 286 | + |
| 287 | + // VALUE |
| 288 | + SDE_REG_WRITE(&ctx->hw, ctx->cap->sblk->hsic.base + PA_VAL_OFF, |
| 289 | + kcal_val & PA_VAL_MASK); |
| 290 | + local_opcode |= PA_VAL_EN; |
| 291 | + |
| 292 | + // CONTRAST |
| 293 | + SDE_REG_WRITE(&ctx->hw, ctx->cap->sblk->hsic.base + PA_CONT_OFF, |
| 294 | + kcal_cont & PA_CONT_MASK); |
| 295 | + local_opcode |= PA_CONT_EN; |
| 296 | + |
| 297 | + opcode |= (local_opcode | PA_EN); |
| 298 | + SDE_REG_WRITE(&ctx->hw, ctx->cap->sblk->hsic.base, opcode); |
| 299 | + |
266 | 300 | SDE_REG_WRITE(&ctx->hw, ctx->cap->sblk->pcc.base, PCC_EN); |
267 | 301 | } |
0 commit comments