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

Commit 1e20848d authored by osaisruj's avatar osaisruj
Browse files

disp: msm: add support for twm entry



Skip backlight updates and panel off commands
during twm entry.

Change-Id: I7656fa0d513a8a3e82d9bbbf5c3f85c1b84ee9da
Signed-off-by: default avatarosaisruj <osaisruj@codeaurora.org>
parent 05ccf7d2
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -378,6 +378,10 @@ static int dsi_panel_power_off(struct dsi_panel *panel)
{
	int rc = 0;

	if (panel->is_twm_en) {
		DSI_DEBUG("TWM Enabled, skip panel power off\n");
		return rc;
	}
	if (gpio_is_valid(panel->reset_config.disp_en_gpio))
		gpio_set_value(panel->reset_config.disp_en_gpio, 0);

@@ -4305,6 +4309,10 @@ int dsi_panel_set_nolp(struct dsi_panel *panel)
		return -EINVAL;
	}

	if (panel->is_twm_en) {
		DSI_DEBUG("TWM Enabled, skip idle off\n");
		return rc;
	}
	mutex_lock(&panel->panel_lock);
	if (!panel->panel_initialized)
		goto exit;
@@ -4717,6 +4725,10 @@ int dsi_panel_disable(struct dsi_panel *panel)
		return -EINVAL;
	}

	if (panel->is_twm_en) {
		DSI_DEBUG("TWM Enabled, skip panel disable\n");
		return rc;
	}
	mutex_lock(&panel->panel_lock);

	/* Avoid sending panel off commands when ESD recovery is underway */
+2 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2020, 2021 The Linux Foundation. All rights reserved.
 */

#ifndef _DSI_PANEL_H_
@@ -244,6 +244,7 @@ struct dsi_panel {
	bool reset_gpio_always_on;
	atomic_t esd_recovery_pending;

	bool is_twm_en;
	bool panel_initialized;
	bool te_using_watchdog_timer;
	struct dsi_qsync_capabilities qsync_caps;
+5 −2
Original line number Diff line number Diff line
@@ -2865,18 +2865,21 @@ static ssize_t twm_enable_store(struct device *device,
{
	struct drm_connector *conn;
	struct sde_connector *sde_conn;
	struct dsi_display *dsi_display;
	int rc;
	int data;

	conn = dev_get_drvdata(device);
	sde_conn = to_sde_connector(conn);

	dsi_display = (struct dsi_display *) sde_conn->display;
	rc = kstrtoint(buf, 10, &data);
	if (rc) {
		SDE_ERROR("kstrtoint failed, rc = %d\n", rc);
		return -EINVAL;
	}
	sde_conn->twm_en = data ? true : false;
	dsi_display->panel->is_twm_en = sde_conn->twm_en;
	sde_conn->allow_bl_update = data ? false : true;
	SDE_DEBUG("TWM: %s\n", sde_conn->twm_en ? "ENABLED" : "DISABLED");
	return count;
}