Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a0e7d7e authored by jabashque's avatar jabashque Committed by MajorP93
Browse files

techpack: display: Don't skip LP1 cmd for AoD with fingerprint_mode on

OPlus added extra code to skip sending the LP1/LP2 command if the
fingerprint sensor is active. They probably have other changes they made
in their fork of Android that requires this, but for us, this causes our
panels to not actually enter LP1 mode at all when Ambient Display is
enabled.

Delete special case handling for this so that we can actually use LP1
mode properly.

Change-Id: Ib4a39f14df28ccbf21124defe6283f4a67837bb5
parent fcc81f18
Loading
Loading
Loading
Loading
+4 −52
Original line number Diff line number Diff line
@@ -2306,32 +2306,6 @@ int dsi_display_oplus_set_power(struct drm_connector *connector,
			rc = dsi_panel_set_lp1(display->panel);
			rc = dsi_panel_set_lp2(display->panel);
			set_oplus_display_scene(OPLUS_DISPLAY_AOD_SCENE);
			break;
		case OPLUS_DISPLAY_AOD_HBM_SCENE:
			/* Skip aod off if fingerprintpress exist */
			if (!sde_crtc_get_fingerprint_pressed(connector->state->crtc->state)) {
				mutex_lock(&display->panel->panel_lock);
				dsi_display_clk_ctrl(display->dsi_clk_handle,
						     DSI_CORE_CLK, DSI_CLK_ON);
				if (display->panel->panel_initialized) {
					if (!strcmp(display->panel->oplus_priv.vendor_name, "S6E3HC3") && (display->panel->panel_id2 >= 5)) {
						rc = dsi_panel_tx_cmd_set(display->panel, DSI_CMD_AOD_HBM_OFF_PVT);
					} else {
						rc = dsi_panel_tx_cmd_set(display->panel, DSI_CMD_AOD_HBM_OFF);
					}
					if (!strcmp(display->panel->oplus_priv.vendor_name, "AMB655XL08")) {
						display->panel->is_hbm_enabled = false;
					}
					oplus_update_aod_light_mode_unlock(display->panel);
				} else {
					pr_err("[%s][%d]failed to setting dsi command", __func__, __LINE__);
				}
				dsi_display_clk_ctrl(display->dsi_clk_handle,
						     DSI_CORE_CLK, DSI_CLK_OFF);
				mutex_unlock(&display->panel->panel_lock);
				set_oplus_display_scene(OPLUS_DISPLAY_AOD_SCENE);
			}

			break;
		case OPLUS_DISPLAY_AOD_SCENE:
		default:
@@ -2360,34 +2334,12 @@ int dsi_display_oplus_set_power(struct drm_connector *connector,
				}
			}
#endif /* OPLUS_FEATURE_ADFR */
			if (sde_crtc_get_fingerprint_mode(connector->state->crtc->state)) {
				mutex_lock(&display->panel->panel_lock);
				dsi_display_clk_ctrl(display->dsi_clk_handle,
						     DSI_CORE_CLK, DSI_CLK_ON);
				if (display->panel->panel_initialized) {
					if (!strcmp(display->panel->oplus_priv.vendor_name, "S6E3HC3") && (display->panel->panel_id2 >= 5)) {
						rc = dsi_panel_tx_cmd_set(display->panel, DSI_CMD_AOD_HBM_ON_PVT);
					} else {
						rc = dsi_panel_tx_cmd_set(display->panel, DSI_CMD_AOD_HBM_ON);
					}
					if (!strcmp(display->panel->oplus_priv.vendor_name, "AMB655XL08")) {
						display->panel->is_hbm_enabled = true;
					}
				} else {
					pr_err("[%s][%d]failed to setting dsi command", __func__, __LINE__);
				}
				dsi_display_clk_ctrl(display->dsi_clk_handle,
						     DSI_CORE_CLK, DSI_CLK_OFF);
				mutex_unlock(&display->panel->panel_lock);
				set_oplus_display_scene(OPLUS_DISPLAY_AOD_HBM_SCENE);
			} else {
			if (!strcmp(display->panel->oplus_priv.vendor_name, "AMS644VK04")) {
				display->panel->need_power_on_backlight = true;
			}
			rc = dsi_panel_set_nolp(display->panel);
			set_oplus_display_scene(OPLUS_DISPLAY_NORMAL_SCENE);
		}
		}
		if (!strcmp(display->panel->oplus_priv.vendor_name, "S6E3HC3")) {
			if (!sde_crtc_get_fingerprint_mode(connector->state->crtc->state)) {
				mutex_lock(&display->panel->panel_lock);