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: 9221041 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 A2B4C60572 for ; Fri, 8 Jul 2016 14:13:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93D4C28813 for ; Fri, 8 Jul 2016 14:13:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87B5828815; Fri, 8 Jul 2016 14:13:26 +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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2824028813 for ; Fri, 8 Jul 2016 14:13:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1C0E86E93B; Fri, 8 Jul 2016 14:13:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 1248 seconds by postgrey-1.35 at gabe; Fri, 08 Jul 2016 14:13:23 UTC Received: from metanate.com (dougal.metanate.com [90.155.101.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 245286E93B for ; Fri, 8 Jul 2016 14:13:23 +0000 (UTC) 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 Cc: linux-rockchip@lists.infradead.org, yzq@rock-chips.com, dianders@chromium.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, tfiga@chromium.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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; }