drm: msm: modify doze backlight sysfs
* ported and adapted for k20pro from sirius-q-oss Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
This commit is contained in:
@@ -260,17 +260,6 @@ static ssize_t panel_info_show(struct device *device,
|
||||
return written;
|
||||
}
|
||||
|
||||
static ssize_t doze_brightness_show(struct device *device,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct drm_connector *connector = to_drm_connector(device);
|
||||
struct drm_device *dev = connector->dev;
|
||||
|
||||
return snprintf(buf, PAGE_SIZE, "%d\n",
|
||||
dev->doze_brightness);
|
||||
}
|
||||
|
||||
void drm_bridge_disp_param_set(struct drm_bridge *bridge, int cmd);
|
||||
static ssize_t disp_param_store(struct device *device,
|
||||
struct device_attribute *attr,
|
||||
@@ -302,6 +291,57 @@ static ssize_t disp_param_store(struct device *device,
|
||||
return count;
|
||||
}
|
||||
|
||||
int dsi_bridge_disp_set_doze_backlight(struct drm_connector *connector,
|
||||
int doze_backlight);
|
||||
ssize_t dsi_bridge_disp_get_doze_backlight(struct drm_connector *connector,
|
||||
char *buf);
|
||||
static ssize_t doze_brightness_show(struct device *device,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
int writen = 0;
|
||||
struct drm_connector *connector = NULL;
|
||||
struct drm_device *dev = NULL;
|
||||
|
||||
if (!device)
|
||||
return writen;
|
||||
|
||||
connector = to_drm_connector(device);
|
||||
if (!connector)
|
||||
return writen;
|
||||
|
||||
dev = connector->dev;
|
||||
if (!dev)
|
||||
return writen;
|
||||
|
||||
return snprintf(buf, PAGE_SIZE, "%d\n",
|
||||
dev->doze_brightness);
|
||||
}
|
||||
|
||||
static ssize_t doze_backlight_store(struct device *device,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct drm_connector *connector = to_drm_connector(device);
|
||||
int doze_backlight;
|
||||
int ret;
|
||||
|
||||
ret = kstrtoint(buf, 0, &doze_backlight);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = dsi_bridge_disp_set_doze_backlight(connector, doze_backlight);
|
||||
|
||||
return ret ? ret : count;
|
||||
}
|
||||
|
||||
static ssize_t doze_backlight_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct drm_connector *connector = to_drm_connector(dev);
|
||||
return dsi_bridge_disp_get_doze_backlight(connector, buf);
|
||||
}
|
||||
|
||||
extern ssize_t mipi_reg_write(char *buf, size_t count);
|
||||
extern ssize_t mipi_reg_read(char *buf);
|
||||
|
||||
@@ -461,6 +501,7 @@ static DEVICE_ATTR_RO(modes);
|
||||
static DEVICE_ATTR_RO(panel_info);
|
||||
static DEVICE_ATTR_WO(disp_param);
|
||||
static DEVICE_ATTR_RO(doze_brightness);
|
||||
static DEVICE_ATTR_RW(doze_backlight);
|
||||
static DEVICE_ATTR_RW(mipi_reg);
|
||||
static DEVICE_ATTR_RW(disp_count);
|
||||
static DEVICE_ATTR_RW(dim_layer_enable);
|
||||
@@ -476,6 +517,7 @@ static struct attribute *connector_dev_attrs[] = {
|
||||
&dev_attr_panel_info.attr,
|
||||
&dev_attr_disp_param.attr,
|
||||
&dev_attr_doze_brightness.attr,
|
||||
&dev_attr_doze_backlight.attr,
|
||||
&dev_attr_mipi_reg.attr,
|
||||
&dev_attr_disp_count.attr,
|
||||
&dev_attr_dim_layer_enable.attr,
|
||||
|
||||
@@ -233,19 +233,13 @@ int dsi_display_set_backlight(struct drm_connector *connector,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (drm_dev && (drm_dev->doze_state == MSM_DRM_BLANK_LP1 || drm_dev->doze_state == MSM_DRM_BLANK_LP2)) {
|
||||
rc = dsi_panel_set_doze_backlight(display, (u32)bl_temp);
|
||||
if (rc)
|
||||
pr_err("unable to set doze backlight\n");
|
||||
rc = dsi_panel_enable_doze_backlight(panel, (u32)bl_temp);
|
||||
if (rc)
|
||||
pr_err("unable to enable doze backlight\n");
|
||||
} else {
|
||||
drm_dev->doze_brightness = DOZE_BRIGHTNESS_INVALID;
|
||||
rc = dsi_panel_set_backlight(panel, (u32)bl_temp);
|
||||
if (rc)
|
||||
pr_err("unable to set backlight\n");
|
||||
}
|
||||
rc = dsi_panel_set_backlight(panel, (u32)bl_temp);
|
||||
if (rc)
|
||||
pr_err("unable to set backlight\n");
|
||||
else
|
||||
pr_info("set backlight successfully at: bl_scale = %u, bl_scale_ad = %u, bl_lvl = %u\n",
|
||||
bl_scale, bl_scale_ad, (u32)bl_temp);
|
||||
|
||||
rc = dsi_display_clk_ctrl(dsi_display->dsi_clk_handle,
|
||||
DSI_CORE_CLK, DSI_CLK_OFF);
|
||||
if (rc) {
|
||||
@@ -1265,7 +1259,7 @@ int dsi_display_set_power(struct drm_connector *connector,
|
||||
return -EINVAL;
|
||||
} else {
|
||||
dev = connector->dev;
|
||||
event = dev->doze_state;
|
||||
event = dev->state;
|
||||
}
|
||||
|
||||
g_notify_data.data = &event;
|
||||
@@ -1274,11 +1268,15 @@ int dsi_display_set_power(struct drm_connector *connector,
|
||||
case SDE_MODE_DPMS_LP1:
|
||||
msm_drm_notifier_call_chain(MSM_DRM_EARLY_EVENT_BLANK, &g_notify_data);
|
||||
rc = dsi_panel_set_lp1(display->panel);
|
||||
if (!rc)
|
||||
dsi_panel_set_doze_backlight(display);
|
||||
msm_drm_notifier_call_chain(MSM_DRM_EVENT_BLANK, &g_notify_data);
|
||||
break;
|
||||
case SDE_MODE_DPMS_LP2:
|
||||
msm_drm_notifier_call_chain(MSM_DRM_EARLY_EVENT_BLANK, &g_notify_data);
|
||||
rc = dsi_panel_set_lp2(display->panel);
|
||||
if (!rc)
|
||||
dsi_panel_set_doze_backlight(display);
|
||||
msm_drm_notifier_call_chain(MSM_DRM_EVENT_BLANK, &g_notify_data);
|
||||
break;
|
||||
case SDE_MODE_DPMS_ON:
|
||||
@@ -1286,6 +1284,8 @@ int dsi_display_set_power(struct drm_connector *connector,
|
||||
display->panel->power_mode == SDE_MODE_DPMS_LP2) {
|
||||
msm_drm_notifier_call_chain(MSM_DRM_EARLY_EVENT_BLANK, &g_notify_data);
|
||||
rc = dsi_panel_set_nolp(display->panel);
|
||||
if (!rc)
|
||||
dsi_panel_set_doze_backlight(display);
|
||||
msm_drm_notifier_call_chain(MSM_DRM_EVENT_BLANK, &g_notify_data);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -656,7 +656,14 @@ void dsi_display_enable_event(struct drm_connector *connector,
|
||||
int dsi_display_set_backlight(struct drm_connector *connector,
|
||||
void *display, u32 bl_lvl);
|
||||
|
||||
int dsi_panel_set_doze_backlight(struct dsi_display *display, u32 bl_lvl);
|
||||
/**
|
||||
* dsi_display_set_doze_backlight() - set doze backlight
|
||||
* @display: Handle to display.
|
||||
*/
|
||||
|
||||
int dsi_panel_set_doze_backlight(struct dsi_display *display);
|
||||
|
||||
ssize_t dsi_panel_get_doze_backlight(struct dsi_display *display, char *buf);
|
||||
|
||||
/**
|
||||
* dsi_display_check_status() - check if panel is dead or alive
|
||||
|
||||
@@ -198,12 +198,12 @@ static void dsi_bridge_pre_enable(struct drm_bridge *bridge)
|
||||
struct drm_device *dev = bridge->dev;
|
||||
int event = 0;
|
||||
|
||||
if (dev->doze_state == MSM_DRM_BLANK_POWERDOWN) {
|
||||
dev->doze_state = MSM_DRM_BLANK_UNBLANK;
|
||||
if (dev->state == MSM_DRM_BLANK_POWERDOWN) {
|
||||
dev->state = MSM_DRM_BLANK_UNBLANK;
|
||||
pr_info("%s power on from power off\n", __func__);
|
||||
}
|
||||
|
||||
event = dev->doze_state;
|
||||
event = dev->state;
|
||||
|
||||
g_notify_data.data = &event;
|
||||
|
||||
@@ -223,7 +223,7 @@ static void dsi_bridge_pre_enable(struct drm_bridge *bridge)
|
||||
cancel_delayed_work_sync(&prim_panel_work);
|
||||
__pm_relax(&prim_panel_wakelock);
|
||||
if (dev->fp_quickon &&
|
||||
(dev->doze_state == MSM_DRM_BLANK_LP1 || dev->doze_state == MSM_DRM_BLANK_LP2)) {
|
||||
(dev->state == MSM_DRM_BLANK_LP1 || dev->state == MSM_DRM_BLANK_LP2)) {
|
||||
event = MSM_DRM_BLANK_POWERDOWN;
|
||||
msm_drm_notifier_call_chain(MSM_DRM_EARLY_EVENT_BLANK, &g_notify_data);
|
||||
msm_drm_notifier_call_chain(MSM_DRM_EVENT_BLANK, &g_notify_data);
|
||||
@@ -364,6 +364,53 @@ static int dsi_bridge_get_panel_info(struct drm_bridge *bridge, char *buf)
|
||||
return rc;
|
||||
}
|
||||
|
||||
int dsi_panel_set_doze_backlight(struct dsi_display *display);
|
||||
|
||||
ssize_t dsi_panel_get_doze_backlight(struct dsi_display *display, char *buf);
|
||||
|
||||
int dsi_bridge_disp_set_doze_backlight(struct drm_connector *connector,
|
||||
int doze_backlight)
|
||||
{
|
||||
struct dsi_display *display = NULL;
|
||||
struct dsi_bridge *c_bridge = NULL;
|
||||
|
||||
if (!connector || !connector->encoder || !connector->encoder->bridge) {
|
||||
pr_err("Invalid connector/encoder/bridge ptr\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
c_bridge = to_dsi_bridge(connector->encoder->bridge);
|
||||
display = c_bridge->display;
|
||||
if (!display || !display->panel || !display->drm_dev) {
|
||||
pr_err("Invalid display/panel/drm_dev ptr\n");
|
||||
return -EINVAL;
|
||||
} else
|
||||
display->drm_dev->doze_brightness = doze_backlight;
|
||||
|
||||
return dsi_panel_set_doze_backlight(display);
|
||||
}
|
||||
|
||||
ssize_t dsi_bridge_disp_get_doze_backlight(struct drm_connector *connector,
|
||||
char *buf)
|
||||
{
|
||||
struct dsi_display *display = NULL;
|
||||
struct dsi_bridge *c_bridge = NULL;
|
||||
|
||||
if (!connector || !connector->encoder || !connector->encoder->bridge) {
|
||||
pr_err("Invalid connector/encoder/bridge ptr\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
c_bridge = to_dsi_bridge(connector->encoder->bridge);
|
||||
display = c_bridge->display;
|
||||
if (!display || !display->panel) {
|
||||
pr_err("Invalid display/panel ptr\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return dsi_panel_get_doze_backlight(display, buf);
|
||||
}
|
||||
|
||||
static void dsi_bridge_enable(struct drm_bridge *bridge)
|
||||
{
|
||||
int rc = 0;
|
||||
@@ -421,12 +468,12 @@ static void dsi_bridge_post_disable(struct drm_bridge *bridge)
|
||||
struct drm_device *dev = bridge->dev;
|
||||
int event = 0;
|
||||
|
||||
if (dev->doze_state == MSM_DRM_BLANK_UNBLANK) {
|
||||
dev->doze_state = MSM_DRM_BLANK_POWERDOWN;
|
||||
if (dev->state == MSM_DRM_BLANK_UNBLANK) {
|
||||
dev->state = MSM_DRM_BLANK_POWERDOWN;
|
||||
pr_info("%s wrong doze state\n", __func__);
|
||||
}
|
||||
|
||||
event = dev->doze_state;
|
||||
event = dev->state;
|
||||
|
||||
g_notify_data.data = &event;
|
||||
|
||||
@@ -440,7 +487,7 @@ static void dsi_bridge_post_disable(struct drm_bridge *bridge)
|
||||
return;
|
||||
}
|
||||
|
||||
if (dev->doze_state == MSM_DRM_BLANK_LP1 || dev->doze_state == MSM_DRM_BLANK_LP2) {
|
||||
if (dev->state == MSM_DRM_BLANK_LP1 || dev->state == MSM_DRM_BLANK_LP2) {
|
||||
pr_err("%s doze state can't power off panel\n", __func__);
|
||||
event = MSM_DRM_BLANK_POWERDOWN;
|
||||
msm_drm_notifier_call_chain(MSM_DRM_EARLY_EVENT_BLANK, &g_notify_data);
|
||||
|
||||
@@ -739,62 +739,79 @@ error:
|
||||
return rc;
|
||||
}
|
||||
|
||||
int dsi_panel_set_doze_backlight(struct dsi_display *display, u32 bl_lvl)
|
||||
int dsi_panel_set_doze_backlight(struct dsi_display *display)
|
||||
{
|
||||
int rc = 0;
|
||||
struct dsi_display *dsi_display = display;
|
||||
struct dsi_panel *panel = NULL;
|
||||
struct drm_device *drm_dev = NULL;
|
||||
|
||||
if (!display || !display->panel || !display->drm_dev) {
|
||||
if (!dsi_display || !dsi_display->panel || !dsi_display->drm_dev) {
|
||||
pr_err("invalid display/panel/drm_dev\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
panel = display->panel;
|
||||
drm_dev = display->drm_dev;
|
||||
|
||||
if (panel->fod_hbm_enabled || panel->fod_backlight_flag || panel->fod_dimlayer_hbm_enabled) {
|
||||
pr_debug("%s FOD HBM open, skip value:%u [hbm=%d][fod_bl=%d][dimlayer_fod=%d]\n", __func__,
|
||||
bl_lvl, panel->fod_hbm_enabled, panel->fod_backlight_flag, panel->fod_dimlayer_hbm_enabled);
|
||||
return rc;
|
||||
panel = dsi_display->panel;
|
||||
drm_dev = dsi_display->drm_dev;
|
||||
mutex_lock(&panel->panel_lock);
|
||||
if (!dsi_panel_initialized(panel)) {
|
||||
pr_info("[%s] set doze backlight before panel initialized!\n", dsi_display->name);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (bl_lvl > panel->doze_backlight_threshold) {
|
||||
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_DOZE_HBM);
|
||||
if (rc)
|
||||
pr_err("[%s] failed to send DSI_CMD_SET_DOZE_HBM cmd, rc=%d\n",
|
||||
panel->name, rc);
|
||||
drm_dev->doze_brightness = DOZE_BRIGHTNESS_HBM;
|
||||
panel->in_aod = true;
|
||||
panel->skip_dimmingon = STATE_DIM_BLOCK;
|
||||
} else if (bl_lvl <= panel->doze_backlight_threshold && bl_lvl > 0) {
|
||||
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_DOZE_LBM);
|
||||
if (rc)
|
||||
pr_err("[%s] failed to send DSI_CMD_SET_DOZE_LBM cmd, rc=%d\n",
|
||||
panel->name, rc);
|
||||
drm_dev->doze_brightness = DOZE_BRIGHTNESS_LBM;
|
||||
panel->in_aod = true;
|
||||
panel->skip_dimmingon = STATE_DIM_BLOCK;
|
||||
} else {
|
||||
drm_dev->doze_brightness = DOZE_BRIGHTNESS_INVALID;
|
||||
if (drm_dev && (drm_dev->state == MSM_DRM_BLANK_LP1 || drm_dev->state == MSM_DRM_BLANK_LP2)) {
|
||||
if (panel->fod_hbm_enabled || panel->fod_backlight_flag) {
|
||||
pr_info("%s FOD HBM open, skip set doze backlight at: [hbm=%d][fod_bl=%d]\n", __func__,
|
||||
panel->fod_hbm_enabled, panel->fod_backlight_flag);
|
||||
goto error;
|
||||
}
|
||||
if (drm_dev->doze_brightness == DOZE_BRIGHTNESS_HBM) {
|
||||
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_DOZE_HBM);
|
||||
if (rc)
|
||||
pr_err("[%s] failed to send DSI_CMD_SET_DOZE_HBM cmd, rc=%d\n", panel->name, rc);
|
||||
else
|
||||
pr_info("In %s the doze_brightness value:%u\n", __func__, drm_dev->doze_brightness);
|
||||
panel->in_aod = true;
|
||||
panel->skip_dimmingon = STATE_DIM_BLOCK;
|
||||
} else if (drm_dev->doze_brightness == DOZE_BRIGHTNESS_LBM) {
|
||||
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_DOZE_LBM);
|
||||
if (rc)
|
||||
pr_err("[%s] failed to send DSI_CMD_SET_DOZE_LBM cmd, rc=%d\n",
|
||||
panel->name, rc);
|
||||
else
|
||||
pr_info("In %s the doze_brightness value:%u\n", __func__, drm_dev->doze_brightness);
|
||||
panel->in_aod = true;
|
||||
panel->skip_dimmingon = STATE_DIM_BLOCK;
|
||||
} else {
|
||||
drm_dev->doze_brightness = DOZE_BRIGHTNESS_INVALID;
|
||||
pr_info("In %s the doze_brightness value:%u\n", __func__, drm_dev->doze_brightness);
|
||||
}
|
||||
}
|
||||
|
||||
pr_debug("%s value:%u\n", __func__, drm_dev->doze_brightness);
|
||||
error:
|
||||
mutex_unlock(&panel->panel_lock);
|
||||
return rc;
|
||||
}
|
||||
|
||||
int dsi_panel_enable_doze_backlight(struct dsi_panel *panel, u32 bl_lvl)
|
||||
ssize_t dsi_panel_get_doze_backlight(struct dsi_display *display, char *buf)
|
||||
{
|
||||
|
||||
int rc = 0;
|
||||
struct dsi_backlight_config *bl = &panel->bl_config;
|
||||
struct dsi_display *dsi_display = display;
|
||||
struct dsi_panel *panel = NULL;
|
||||
struct drm_device *drm_dev = NULL;
|
||||
|
||||
if (panel->fod_backlight_flag) {
|
||||
pr_debug("fod_backlight_flag set\n");
|
||||
} else {
|
||||
pr_debug("enable doze backlight type:%d lvl:%d\n", bl->type, bl_lvl);
|
||||
rc = dsi_panel_update_backlight(panel, bl_lvl);
|
||||
if (!dsi_display || !dsi_display->panel || !dsi_display->drm_dev) {
|
||||
pr_err("invalid display/panel/drm_dev\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
panel = dsi_display->panel;
|
||||
drm_dev = dsi_display->drm_dev;
|
||||
|
||||
panel->last_bl_lvl = bl_lvl;
|
||||
mutex_lock(&panel->panel_lock);
|
||||
|
||||
rc = snprintf(buf, PAGE_SIZE, "%d\n", drm_dev->doze_brightness);
|
||||
pr_info("In %s the doze_brightness value:%u\n", __func__, drm_dev->doze_brightness);
|
||||
|
||||
mutex_unlock(&panel->panel_lock);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -4488,45 +4505,6 @@ int dsi_panel_set_lp1(struct dsi_panel *panel)
|
||||
pr_err("[%s] failed to send DSI_CMD_SET_LP1 cmd, rc=%d\n",
|
||||
panel->name, rc);
|
||||
|
||||
if (panel->fod_hbm_enabled || panel->fod_backlight_flag || panel->fod_dimlayer_hbm_enabled) {
|
||||
pr_debug("%s skip [hbm=%d][fod_bl=%d][dimlayer_hbm=%d]\n", __func__,
|
||||
panel->fod_hbm_enabled, panel->fod_backlight_flag, panel->fod_dimlayer_hbm_enabled);
|
||||
} else {
|
||||
struct dsi_display *display = NULL;
|
||||
struct mipi_dsi_host *host = panel->host;
|
||||
if (host)
|
||||
display = container_of(host, struct dsi_display, host);
|
||||
|
||||
if (panel->last_bl_lvl > panel->doze_backlight_threshold) {
|
||||
pr_debug("dsi_panel_set_lp1 DSI_CMD_SET_DOZE_HBM");
|
||||
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_DOZE_HBM);
|
||||
if (rc)
|
||||
pr_err("[%s] failed to send DSI_CMD_SET_DOZE_HBM cmd, rc=%d\n",
|
||||
panel->name, rc);
|
||||
if (display)
|
||||
display->drm_dev->doze_brightness = DOZE_BRIGHTNESS_HBM;
|
||||
|
||||
panel->in_aod = true;
|
||||
panel->skip_dimmingon = STATE_DIM_BLOCK;
|
||||
} else if (panel->last_bl_lvl <= panel->doze_backlight_threshold && panel->last_bl_lvl > 0) {
|
||||
pr_debug("dsi_panel_set_lp1 DSI_CMD_SET_DOZE_LBM");
|
||||
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_DOZE_LBM);
|
||||
if (rc)
|
||||
pr_err("[%s] failed to send DSI_CMD_SET_DOZE_LBM cmd, rc=%d\n",
|
||||
panel->name, rc);
|
||||
|
||||
if (display)
|
||||
display->drm_dev->doze_brightness = DOZE_BRIGHTNESS_LBM;
|
||||
|
||||
panel->in_aod = true;
|
||||
panel->skip_dimmingon = STATE_DIM_BLOCK;
|
||||
} else {
|
||||
pr_debug("dsi_panel_set_lp1 DOZE_BRIGHTNESS_INVALID");
|
||||
if (display)
|
||||
display->drm_dev->doze_brightness = DOZE_BRIGHTNESS_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
exit:
|
||||
mutex_unlock(&panel->panel_lock);
|
||||
return rc;
|
||||
@@ -5035,8 +5013,8 @@ static int panel_disp_param_send_lock(struct dsi_panel *panel, int param)
|
||||
if (host)
|
||||
display = container_of(host, struct dsi_display, host);
|
||||
|
||||
if ((display->drm_dev && display->drm_dev->doze_state == MSM_DRM_BLANK_LP1) ||
|
||||
(display->drm_dev && display->drm_dev->doze_state == MSM_DRM_BLANK_LP2)) {
|
||||
if ((display->drm_dev && display->drm_dev->state == MSM_DRM_BLANK_LP1) ||
|
||||
(display->drm_dev && display->drm_dev->state == MSM_DRM_BLANK_LP2)) {
|
||||
#if 0
|
||||
if (panel->last_bl_lvl > panel->doze_backlight_threshold) {
|
||||
pr_info("hbm fod off DSI_CMD_SET_DOZE_HBM");
|
||||
@@ -5154,13 +5132,13 @@ static int panel_disp_param_send_lock(struct dsi_panel *panel, int param)
|
||||
if (host)
|
||||
display = container_of(host, struct dsi_display, host);
|
||||
|
||||
pr_debug("FOD backlight restore last_bl_lvl=%d, doze_state=%d",
|
||||
panel->last_bl_lvl, display->drm_dev->doze_state);
|
||||
pr_info("FOD backlight restore last_bl_lvl=%d, state=%d",
|
||||
panel->last_bl_lvl, display->drm_dev->state);
|
||||
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_DISP_DIMMINGOFF);
|
||||
rc = dsi_panel_update_backlight(panel, panel->last_bl_lvl);
|
||||
|
||||
if ((display->drm_dev && display->drm_dev->doze_state == MSM_DRM_BLANK_LP1) ||
|
||||
(display->drm_dev && display->drm_dev->doze_state == MSM_DRM_BLANK_LP2)) {
|
||||
if ((display->drm_dev && display->drm_dev->state == MSM_DRM_BLANK_LP1) ||
|
||||
(display->drm_dev && display->drm_dev->state == MSM_DRM_BLANK_LP2)) {
|
||||
#if 0
|
||||
if (panel->last_bl_lvl > panel->doze_backlight_threshold) {
|
||||
pr_info("FOD backlight restore DSI_CMD_SET_DOZE_HBM");
|
||||
|
||||
@@ -355,8 +355,6 @@ int dsi_panel_post_unprepare(struct dsi_panel *panel);
|
||||
|
||||
int dsi_panel_set_backlight(struct dsi_panel *panel, u32 bl_lvl);
|
||||
|
||||
int dsi_panel_enable_doze_backlight(struct dsi_panel *panel, u32 bl_lvl);
|
||||
|
||||
int dsi_panel_update_pps(struct dsi_panel *panel);
|
||||
|
||||
int dsi_panel_send_qsync_on_dcs(struct dsi_panel *panel,
|
||||
|
||||
@@ -702,8 +702,8 @@ int sde_connector_update_hbm(struct sde_connector *c_conn)
|
||||
if (dsi_display->panel->fod_dimlayer_hbm_enabled) {
|
||||
mutex_lock(&dsi_display->panel->panel_lock);
|
||||
sde_encoder_wait_for_event(c_conn->encoder, MSM_ENC_VBLANK);
|
||||
if ((dsi_display->drm_dev && dsi_display->drm_dev->doze_state == MSM_DRM_BLANK_LP1) ||
|
||||
(dsi_display->drm_dev && dsi_display->drm_dev->doze_state == MSM_DRM_BLANK_LP2)) {
|
||||
if ((dsi_display->drm_dev && dsi_display->drm_dev->state == MSM_DRM_BLANK_LP1) ||
|
||||
(dsi_display->drm_dev && dsi_display->drm_dev->state == MSM_DRM_BLANK_LP2)) {
|
||||
if (dsi_display->panel->last_bl_lvl > dsi_display->panel->doze_backlight_threshold) {
|
||||
dsi_display->panel->fod_dimlayer_hbm_enabled = false;
|
||||
dsi_display_write_panel(dsi_display, &dsi_display->panel->cur_mode->priv_info->cmd_sets[DSI_CMD_SET_DOZE_HBM]);
|
||||
@@ -1321,7 +1321,7 @@ static int sde_connector_atomic_set_property(struct drm_connector *connector,
|
||||
switch (idx) {
|
||||
case CONNECTOR_PROP_LP:
|
||||
if(connector->dev)
|
||||
connector->dev->doze_state = val;
|
||||
connector->dev->state = val;
|
||||
break;
|
||||
case CONNECTOR_PROP_OUT_FB:
|
||||
/* clear old fb, if present */
|
||||
|
||||
@@ -195,7 +195,7 @@ struct drm_device {
|
||||
struct drm_vma_offset_manager *vma_offset_manager;
|
||||
/*@} */
|
||||
int switch_power_state;
|
||||
int doze_state;
|
||||
int state;
|
||||
int doze_brightness;
|
||||
bool fp_quickon;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user