disp: msm: sde: reset bl_scale_sv in power off case

In userspace, the backlight scale of LTM will be set to the maximum value
in the suspend case. However, sometimes this value is sent to the driver
after resume. This will cause a backlight flicker issue.
For fix this issue, this change resets the backlight scale in the suspend
case.

Change-Id: I0eb586eeefbf3444d6f44281d58789460300dffc
Signed-off-by: Yuchao Ma <quic_yuchaom@quicinc.com>
This commit is contained in:
Yuchao Ma
2023-06-07 17:48:00 +08:00
parent 6d21952dd2
commit 02428b713f

View File

@@ -1728,6 +1728,20 @@ static int _sde_connector_set_prop_dyn_transfer_time(struct sde_connector *c_con
return rc;
}
static void _sde_connector_handle_dpms_off(struct sde_connector *c_conn, uint64_t val)
{
/* suspend case: clear stale MISR */
if (val == SDE_MODE_DPMS_OFF) {
memset(&c_conn->previous_misr_sign, 0, sizeof(struct sde_misr_sign));
/* reset backlight scale of LTM */
if (c_conn->bl_scale_sv != MAX_SV_BL_SCALE_LEVEL) {
c_conn->bl_scale_sv = MAX_SV_BL_SCALE_LEVEL;
c_conn->bl_scale_dirty = true;
}
}
}
static int sde_connector_atomic_set_property(struct drm_connector *connector,
struct drm_connector_state *state,
struct drm_property *property,
@@ -1823,9 +1837,7 @@ static int sde_connector_atomic_set_property(struct drm_connector *connector,
_sde_connector_set_prop_dyn_transfer_time(c_conn, val);
break;
case CONNECTOR_PROP_LP:
/* suspend case: clear stale MISR */
if (val == SDE_MODE_DPMS_OFF)
memset(&c_conn->previous_misr_sign, 0, sizeof(struct sde_misr_sign));
_sde_connector_handle_dpms_off(c_conn, val);
break;
default:
break;