Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1447871

[PATCH v1 2/2] drm/bridge: analogix_dp: turn off the panel when eDP need to disable

From Yakir Yang <ykk@rock-chips.com>
Newsgroups linux.kernel
Subject [PATCH v1 2/2] drm/bridge: analogix_dp: turn off the panel when eDP need to disable
Date 2016-07-21 15:20 +0200
Message-ID <rXm3o-7UG-33@gated-at.bofh.it> (permalink)
References <rXm3o-7UG-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Some panels (like Sharp LQ123P1JX31) need to be turn off when eDP
controller stop to send valid video signal, otherwhise panel would
go burn in, and keep flicker and flicker.

So it's better to turn off the panel when eDP need to disable, and
we need to turn on the panel in connector->detect() callback, so
that driver would detect panel status rightly.

Signed-off-by: Yakir Yang <ykk@rock-chips.com>
---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 32715da..ea059b3 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -961,6 +961,14 @@ analogix_dp_detect(struct drm_connector *connector, bool force)
 {
 	struct analogix_dp_device *dp = to_dp(connector);
 
+	/*
+	 * Panle would prepare for several times here, but don't worry it
+	 * would only enable the hardware at the first prepare time.
+	 */
+	if (dp->plat_data->panel)
+		if (drm_panel_prepare(dp->plat_data->panel))
+			DRM_ERROR("failed to setup the panel\n");
+
 	if (analogix_dp_detect_hpd(dp))
 		return connector_status_disconnected;
 
@@ -1063,7 +1071,8 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)
 		return;
 
 	if (dp->plat_data->panel) {
-		if (drm_panel_disable(dp->plat_data->panel)) {
+		if (drm_panel_disable(dp->plat_data->panel) ||
+		    drm_panel_unprepare(dp->plat_data->panel)) {
 			DRM_ERROR("failed to disable the panel\n");
 			return;
 		}
@@ -1333,13 +1342,6 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
 
 	phy_power_on(dp->phy);
 
-	if (dp->plat_data->panel) {
-		if (drm_panel_prepare(dp->plat_data->panel)) {
-			DRM_ERROR("failed to setup the panel\n");
-			return -EBUSY;
-		}
-	}
-
 	analogix_dp_init_dp(dp);
 
 	ret = devm_request_threaded_irq(&pdev->dev, dp->irq,
-- 
1.9.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v1 2/2] drm/bridge: analogix_dp: turn off the panel when eDP need to disable Yakir Yang <ykk@rock-chips.com> - 2016-07-21 15:20 +0200
  Re: [PATCH v1 2/2] drm/bridge: analogix_dp: turn off the panel when  eDP need to disable Sean Paul <seanpaul@chromium.org> - 2016-07-21 16:30 +0200
    Re: [PATCH v1 2/2] drm/bridge: analogix_dp: turn off the panel when  eDP need to disable Sean Paul <seanpaul@chromium.org> - 2016-07-22 17:10 +0200

csiph-web