sm7125: drm: msm: make Samsung HBM work

On stock ROM Samsung writes the brightness value for the finger mask to /sys/class/lcd/panel/mask_brightness and then turns on the mask layer. However we don't know how they actually turn it on. Therefore enable/disable the finger mask every time we write something to mask_brightness.

Signed-off-by: Simon1511 <simon2002.schoenmackers@gmail.com>
Change-Id: If14119b8856d329f6049701fd16d20c39301f712
tirimbino
Simon1511 3 years ago
parent 069ab60f40
commit d4e9440553
  1. 12
      drivers/gpu/drm/msm/samsung_lego/ss_dsi_panel_sysfs.c
  2. 12
      drivers/gpu/drm/msm/sde/sde_connector.c

@ -4285,12 +4285,20 @@ static ssize_t ss_finger_hbm_store(struct device *dev,
return size;
}
if (sscanf(buf, "%d", &value) != 1)
return size;
sscanf(buf, "%d", &value);
LCD_INFO("mask_bl_level value : %d\n", value);
vdd->br_info.common_br.finger_mask_bl_level = value;
// brightness value > 0 means enabled
if (value > 0) {
vdd->finger_mask = 1;
} else {
vdd->finger_mask = 0;
}
// Update finger mask after turning on and off
vdd->finger_mask_updated = true;
return size;
}

@ -645,11 +645,13 @@ int sde_connector_pre_kickoff(struct drm_connector *connector)
if (vdd->support_optical_fingerprint) {
finger_mask_state = sde_connector_get_property(c_conn->base.state,
CONNECTOR_PROP_FINGERPRINT_MASK);
vdd->finger_mask_updated = false;
if (finger_mask_state != vdd->finger_mask) {
vdd->finger_mask = finger_mask_state;
vdd->finger_mask_updated = true;
SDE_ERROR("[FINGER_MASK]updated finger mask mode %d\n", finger_mask_state);
if (finger_mask_state == 0 && vdd->finger_mask == 1) {
finger_mask_state = vdd->finger_mask;
SDE_ERROR("[FINGER_MASK]updated finger mask mode %d\n", vdd->finger_mask);
} else if (finger_mask_state == 1 && vdd->finger_mask == 0) {
finger_mask_state = vdd->finger_mask;
vdd->finger_mask_updated = false;
SDE_ERROR("[FINGER_MASK]updated finger mask mode %d\n", vdd->finger_mask);
}
}
}

Loading…
Cancel
Save