drm/rockchip: vop: Fix brightness process for RK3506/RV1126B

The RK3506/RV1126B use 7bit signed number to calculate the brightness.
That is [-64, 63].

Fixes: 08fbbdb571 ("drm/rockchip: vop: add support for rk3506")

Change-Id: I64df5bd97e20350e8f3e7db9fe68966f01155dd8
Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
This commit is contained in:
Chaoyi Chen
2025-07-09 09:31:06 +08:00
committed by Tao Huang
parent 3fc5e850f4
commit b25696bf69
2 changed files with 3 additions and 3 deletions

View File

@@ -4842,7 +4842,7 @@ static void vop_tv_config_update(struct drm_crtc *crtc,
if (vop_data->feature & VOP_FEATURE_OUTPUT_10BIT)
brightness = interpolate(0, -128, 100, 127, s->tv_state->brightness);
else if (VOP_MAJOR(vop->version) == 2 && VOP_MINOR(vop->version) == 6) /* px30 vopb */
else if (vop->version == VOP_VERSION_PX30_BIG || vop->version >= VOP_VERSION_RK3506)
brightness = interpolate(0, -64, 100, 63, s->tv_state->brightness);
else
brightness = interpolate(0, -32, 100, 31, s->tv_state->brightness);

View File

@@ -2001,7 +2001,7 @@ static const struct vop_ctrl rv1126b_ctrl_data = {
.bcsh_r2y_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 7),
.bcsh_color_bar = VOP_REG(RK3366_LIT_BCSH_COL_BAR, 0xffffff, 0),
.bcsh_brightness = VOP_REG(RK3366_LIT_BCSH_BCS, 0xff, 0),
.bcsh_brightness = VOP_REG(RK3366_LIT_BCSH_BCS, 0x7f, 0),
.bcsh_contrast = VOP_REG(RK3366_LIT_BCSH_BCS, 0x1ff, 8),
.bcsh_sat_con = VOP_REG(RK3366_LIT_BCSH_BCS, 0x3ff, 20),
.bcsh_sin_hue = VOP_REG(RK3366_LIT_BCSH_H, 0x1ff, 0),
@@ -2219,7 +2219,7 @@ static const struct vop_ctrl rk3506_ctrl_data = {
.bcsh_r2y_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 7),
.bcsh_color_bar = VOP_REG(RK3366_LIT_BCSH_COL_BAR, 0xffffff, 0),
.bcsh_brightness = VOP_REG(RK3366_LIT_BCSH_BCS, 0xff, 0),
.bcsh_brightness = VOP_REG(RK3366_LIT_BCSH_BCS, 0x7f, 0),
.bcsh_contrast = VOP_REG(RK3366_LIT_BCSH_BCS, 0x1ff, 8),
.bcsh_sat_con = VOP_REG(RK3366_LIT_BCSH_BCS, 0x3ff, 20),
.bcsh_sin_hue = VOP_REG(RK3366_LIT_BCSH_H, 0x1ff, 0),