mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
disp: msm: sde: allow backlight device registration for trusted vm
Trusted VM can support dynamic backlight updates through DCS commands. Allow SDE to register for the backlight device only if the panel supports DCS backlight update mode. Note that thermal driver is disabled in trusted vm. So we are still avoiding registering with msm thermal driver. The backlight updates are only supported through backlight driver provided sysfs nodes. Change-Id: I9cd41d473445387c8bc9048d7e565d49124a36b7 Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
This commit is contained in:
parent
987888e623
commit
08c40fb26e
1 changed files with 15 additions and 4 deletions
|
|
@ -188,15 +188,16 @@ static int sde_backlight_setup(struct sde_connector *c_conn,
|
|||
return -EINVAL;
|
||||
|
||||
sde_kms = to_sde_kms(priv->kms);
|
||||
if (sde_in_trusted_vm(sde_kms))
|
||||
display = (struct dsi_display *) c_conn->display;
|
||||
bl_config = &display->panel->bl_config;
|
||||
|
||||
if (bl_config->type != DSI_BACKLIGHT_DCS &&
|
||||
sde_in_trusted_vm(sde_kms))
|
||||
return 0;
|
||||
|
||||
memset(&props, 0, sizeof(props));
|
||||
props.type = BACKLIGHT_RAW;
|
||||
props.power = FB_BLANK_UNBLANK;
|
||||
|
||||
display = (struct dsi_display *) c_conn->display;
|
||||
bl_config = &display->panel->bl_config;
|
||||
props.max_brightness = bl_config->brightness_max_level;
|
||||
props.brightness = bl_config->brightness_max_level;
|
||||
snprintf(bl_node_name, BL_NODE_NAME_SIZE, "panel%u-backlight",
|
||||
|
|
@ -210,6 +211,14 @@ static int sde_backlight_setup(struct sde_connector *c_conn,
|
|||
return -ENODEV;
|
||||
}
|
||||
c_conn->thermal_max_brightness = bl_config->brightness_max_level;
|
||||
|
||||
/**
|
||||
* In TVM, thermal cooling device is not enabled. Registering with dummy
|
||||
* thermal device will return a NULL leading to a failure. So skip it.
|
||||
*/
|
||||
if (sde_in_trusted_vm(sde_kms))
|
||||
goto done;
|
||||
|
||||
c_conn->n.notifier_call = sde_backlight_cooling_cb;
|
||||
c_conn->cdev = backlight_cdev_register(dev->dev, c_conn->bl_device,
|
||||
&c_conn->n);
|
||||
|
|
@ -220,6 +229,8 @@ static int sde_backlight_setup(struct sde_connector *c_conn,
|
|||
c_conn->bl_device = NULL;
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
done:
|
||||
display_count++;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue