From patchwork Fri Jul 8 13:52:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Keeping X-Patchwork-Id: 9220981 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 AE5196044F for ; Fri, 8 Jul 2016 13:53:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F0CE287E3 for ; Fri, 8 Jul 2016 13:53:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 933B7287E6; Fri, 8 Jul 2016 13:53:05 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham 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 91E7D287E3 for ; Fri, 8 Jul 2016 13:53:04 +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 1bLWDG-0001xL-Dm; Fri, 08 Jul 2016 13:53:02 +0000 Received: from dougal.metanate.com ([90.155.101.14] helo=metanate.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bLWDD-0001ex-PY; Fri, 08 Jul 2016 13:53:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=metanate.com; s=stronger; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=d+LxHk31LCgDULumTGSN/5PxcNEeYpsWH0ZUNzRPaqg=; b=YGMGScIYvDU/t6joBxIdeMPGyhUa0DB2MQ2Px3z4CTBuFru5a1gOf7oWJx5GxnybrcuqjMglwmdOPX1yV44sixYJzZrmtGu1XVzooE0K444sTt05Y9lSdkSJ1gu/37ubFRFVoSfdw1yoM+2D5Qjs4BsEIhpwvkU5ZHbchRsjrTWFFfYKxPRjEQ2UYD+ikN2wFF6q5kFTt9dCXdHm9FThstrl055ibKY2avGPnbC4LXWeSHEsszBorDcwIgwoC2oFfQrtGmB+9ausPxd7bO1N2kPoKvrYKRd8SyZJKEDwufjl+Wrc/jzFfn6KGONuW5lccwO4vJDzS1RQ0xFm65J0nw==; Received: from johnkeeping.plus.com ([81.174.171.191] helo=localhost.localdomain) by shrek.metanate.com with esmtpsa (TLSv1.2:AES256-GCM-SHA384:256) (Exim 4.83_RC2) (envelope-from ) id 1bLWCV-0002Wd-Ou; Fri, 08 Jul 2016 14:52:15 +0100 Date: Fri, 8 Jul 2016 14:52:11 +0100 From: John Keeping To: Chris Zhong Subject: Re: [PATCH 5/7] drm/rockchip: dw-mipi: support HPD poll Message-ID: <20160708145211.6bf83d8f.john@metanate.com> In-Reply-To: <1467968701-15620-6-git-send-email-zyw@rock-chips.com> References: <1467968701-15620-1-git-send-email-zyw@rock-chips.com> <1467968701-15620-6-git-send-email-zyw@rock-chips.com> Organization: Metanate Ltd X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-unknown-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160708_065300_200021_84F48D93 X-CRM114-Status: GOOD ( 12.76 ) 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: heiko@sntech.de, linux-rockchip@lists.infradead.org, yzq@rock-chips.com, dianders@chromium.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, David Airlie , tfiga@chromium.org, linux-arm-kernel@lists.infradead.org, Mark Yao Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, 8 Jul 2016 17:04:59 +0800, Chris Zhong wrote: > At the first time of bind, there is no any panel attach in mipi. Add a > DRM_CONNECTOR_POLL_HPD porperty to detect the panel status, when panel > probe, the dw_mipi_dsi_host_attach would be called, then mipi-dsi will > trigger a event to notify the drm framework. > > Signed-off-by: Chris Zhong Can we do something like this instead? We know that the panel must always be attached and this has the advantage that the display size will be known when the framebuffer console loads. -- >8 -- Subject: [PATCH] drm/rockchip: dw-mipi-dsi: defer probe if panel is not loaded This ensures that the output resolution is known before fbcon loads. Signed-off-by: John Keeping --- drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c index 6ef5f3be8468..c0499266d116 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c @@ -1154,10 +1154,17 @@ static int dw_mipi_dsi_bind(struct device *dev, struct device *master, dsi->dsi_host.ops = &dw_mipi_dsi_host_ops; dsi->dsi_host.dev = dev; - return mipi_dsi_host_register(&dsi->dsi_host); + ret = mipi_dsi_host_register(&dsi->dsi_host); + if (!ret && !dsi->panel) { + mipi_dsi_host_unregister(&dsi->dsi_host); + drm_encoder_cleanup(&dsi->encoder); + drm_connector_cleanup(&dsi->connector); + ret = -EPROBE_DEFER; + } err_pllref: - clk_disable_unprepare(dsi->pllref_clk); + if (ret) + clk_disable_unprepare(dsi->pllref_clk); return ret; }