From patchwork Thu Jul 21 14:14:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yakir Yang X-Patchwork-Id: 9241767 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 904AB607D3 for ; Thu, 21 Jul 2016 14:14:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80D6827D64 for ; Thu, 21 Jul 2016 14:14:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 74F7E27EED; Thu, 21 Jul 2016 14:14:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1169327D64 for ; Thu, 21 Jul 2016 14:14:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bQEkU-00089J-UW; Thu, 21 Jul 2016 14:14:50 +0000 Received: from lucky1.263xmail.com ([211.157.147.132]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bQEkP-00086o-63 for linux-rockchip@lists.infradead.org; Thu, 21 Jul 2016 14:14:49 +0000 Received: from ykk?rock-chips.com (unknown [192.168.167.152]) by lucky1.263xmail.com (Postfix) with SMTP id B9B4C63270; Thu, 21 Jul 2016 22:14:14 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 06E1D3371; Thu, 21 Jul 2016 22:14:12 +0800 (CST) X-RL-SENDER: ykk@rock-chips.com X-FST-TO: yzq@rock-chips.com X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: ykk@rock-chips.com X-UNIQUE-TAG: <1558a60ed23489b81fb50038e9d8f76d> X-ATTACHMENT-NUM: 0 X-SENDER: ykk@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 105138Q2XJ9; Thu, 21 Jul 2016 22:14:15 +0800 (CST) From: Yakir Yang To: Mark Yao , Inki Dae , Thierry Reding , Heiko Stuebner Subject: [PATCH v1.1 2/2] drm/bridge: analogix_dp: turn off the panel when eDP need to disable Date: Thu, 21 Jul 2016 22:14:12 +0800 Message-Id: <1469110452-8806-1-git-send-email-ykk@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1469106874-4912-1-git-send-email-ykk@rock-chips.com> References: <1469106874-4912-1-git-send-email-ykk@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160721_071445_601120_D56B2727 X-CRM114-Status: GOOD ( 10.48 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, David Airlie , Jingoo Han , Yakir Yang , emil.l.velikov@gmail.com, dianders@chromium.org, dri-devel@lists.freedesktop.org, Tomasz Figa , Javier Martinez Canillas , Sean Paul , daniel.vetter@ffwll.ch, =?UTF-8?q?St=C3=A9phane=20Marchesin?= , linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- Changes in v1.1: - unprepare the panel at the end of bridge->disable() function drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 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..2e519bd 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; @@ -1077,6 +1085,13 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge) pm_runtime_put_sync(dp->dev); + if (dp->plat_data->panel) { + if (drm_panel_unprepare(dp->plat_data->panel)) { + DRM_ERROR("failed to turnoff the panel\n"); + return; + } + } + dp->dpms_mode = DRM_MODE_DPMS_OFF; } @@ -1333,13 +1348,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,