Skip to content
This repository has been archived by the owner on Nov 24, 2019. It is now read-only.

Commit

Permalink
drm/msm/dsi-staging: cleanup drm device node access
Browse files Browse the repository at this point in the history
Since we're already initialize it at the beginning (ad33e93), we can just use it instead.

Signed-off-by: Nanda Oktavera <codeharuka.yusa@gmail.com>
  • Loading branch information
okitavera committed Aug 16, 2019
1 parent ad33e93 commit 0f1cde4
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions drivers/gpu/drm/msm/dsi-staging/dsi_panel.c
Expand Up @@ -4605,48 +4605,49 @@ static int panel_disp_param_send_lock(struct dsi_panel *panel, int param)
case DISPPARAM_HBM_ON:
pr_info("hbm on\n");
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_DISP_HBM_ON);
drm_dev->hbm_status = 1;
if (drm_dev)
drm_dev->hbm_status = 1;
break;
case DISPPARAM_HBM_FOD_ON:
pr_info("hbm fod on\n");
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_DISP_HBM_FOD_ON);
panel->skip_dimmingon = STATE_DIM_BLOCK;
panel->fod_hbm_enabled = true;
drm_dev->hbm_status = 1;
if (drm_dev)
drm_dev->hbm_status = 1;
break;
case DISPPARAM_HBM_FOD2NORM:
pr_info("hbm fod to normal mode\n");
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_DISP_HBM_FOD2NORM);
drm_dev->hbm_status = 1;
if (drm_dev)
drm_dev->hbm_status = 1;
break;
case DISPPARAM_HBM_FOD_OFF:
pr_info("hbm fod off\n");
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_DISP_HBM_FOD_OFF);
panel->skip_dimmingon = STATE_DIM_RESTORE;
panel->fod_hbm_enabled = false;
panel->fod_hbm_off_time = ktime_add_ms(ktime_get(), panel->fod_off_dimming_delay);
display = NULL;
if (host)
display = container_of(host, struct dsi_display, host);

if ((display->drm_dev && display->drm_dev->state == DRM_BLANK_LP1) ||
(display->drm_dev && display->drm_dev->state == DRM_BLANK_LP2)) {
if ((drm_dev && drm_dev->state == DRM_BLANK_LP1) ||
(drm_dev && drm_dev->state == DRM_BLANK_LP2)) {
pr_info("HBM_FOD_OFF 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);
display->drm_dev->doze_brightness = DOZE_BRIGHTNESS_HBM;
drm_dev->doze_brightness = DOZE_BRIGHTNESS_HBM;
panel->in_aod = true;
panel->skip_dimmingon = STATE_NONE;
}
drm_dev->hbm_status = 1;
if (drm_dev)
drm_dev->hbm_status = 1;
break;
case DISPPARAM_HBM_OFF:
pr_info("hbm off\n");
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_DISP_HBM_OFF);
panel->skip_dimmingon = STATE_NONE;
drm_dev->hbm_status = 1;
if (drm_dev)
drm_dev->hbm_status = 1;
break;
default:
break;
Expand Down Expand Up @@ -4716,23 +4717,20 @@ static int panel_disp_param_send_lock(struct dsi_panel *panel, int param)
case DISPPARAM_FOD_BACKLIGHT:
pr_info("FOD backlight");
if (fod_backlight == DISPPARAM_ACL_L1) {
display = NULL;
if (host)
display = container_of(host, struct dsi_display, host);

pr_info("FOD backlight restore last_bl_lvl=%d, doze_state=%d",
panel->last_bl_lvl, display->drm_dev->state);
panel->last_bl_lvl, 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->state == DRM_BLANK_LP1) ||
(display->drm_dev && display->drm_dev->state == DRM_BLANK_LP2)) {
if ((drm_dev && drm_dev->state == DRM_BLANK_LP1) ||
(drm_dev && drm_dev->state == DRM_BLANK_LP2)) {
pr_info("FOD backlight restore 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);
display->drm_dev->doze_brightness = DOZE_BRIGHTNESS_HBM;
drm_dev->doze_brightness = DOZE_BRIGHTNESS_HBM;
panel->in_aod = true;
panel->skip_dimmingon = STATE_NONE;
} else {
Expand Down

0 comments on commit 0f1cde4

Please sign in to comment.