From patchwork Thu Mar 30 11:15:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 9653937 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 6F69560113 for ; Thu, 30 Mar 2017 11:17:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 645141FFD6 for ; Thu, 30 Mar 2017 11:17:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55E94262F2; Thu, 30 Mar 2017 11:17:07 +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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 16EA31FFD6 for ; Thu, 30 Mar 2017 11:17:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DE3B6E8BA; Thu, 30 Mar 2017 11:16:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelnx193.ext.ti.com (lelnx193.ext.ti.com [198.47.27.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id C0A036E8B3 for ; Thu, 30 Mar 2017 11:16:10 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id v2UBG8cG009193; Thu, 30 Mar 2017 06:16:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1490872568; bh=dAOXPip7zsHUUuTlul2ckNufG6ITokuSyBIdSb5Rgf4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=qQgQ/gnEC7JQZhH7BBO6nt+t22FaKNVaUV168ybSholpIAX7m2zMr1EeBNPJ9RYYM gA6Du+Eo3qXICMWVfsmra4/WnS1P5Eh2fMxdRYpY4vcE9DBuCl7K9nBaKFWOsdnTBr KYZcl6IuVZgyf6fkLoMfhDiFajDyFiT8NVyqpjmQ= Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v2UBG8ln001941; Thu, 30 Mar 2017 06:16:08 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Thu, 30 Mar 2017 06:16:07 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v2UBFV8G016391; Thu, 30 Mar 2017 06:16:06 -0500 From: Tomi Valkeinen To: , Laurent Pinchart Subject: [PATCHv4 22/29] drm/omap: Use omapdss_stack_is_ready() to check that the display stack is up Date: Thu, 30 Mar 2017 14:15:22 +0300 Message-ID: <1490872529-23084-23-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490872529-23084-1-git-send-email-tomi.valkeinen@ti.com> References: <1490872529-23084-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Cc: Peter Ujfalusi , Tomi Valkeinen , Jyri Sarha 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 From: Peter Ujfalusi Instead of 'guessing' based on aliases of the status of the DSS drivers, use the new interface to check that all needed drivers are loaded. In this way we can be sure that all needed drivers are loaded so it is safe to continue the probing of omapdrm. This method will allow the omapdrm to be probed 'headless', without outputs. Signed-off-by: Peter Ujfalusi Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_drv.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index c7dbf30a61fa..ad8d16cf819c 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -250,7 +250,9 @@ static int omap_connect_dssdevs(void) { int r; struct omap_dss_device *dssdev = NULL; - bool no_displays = true; + + if (!omapdss_stack_is_ready()) + return -EPROBE_DEFER; for_each_dss_dev(dssdev) { r = dssdev->driver->connect(dssdev); @@ -260,14 +262,9 @@ static int omap_connect_dssdevs(void) } else if (r) { dev_warn(dssdev->dev, "could not connect display: %s\n", dssdev->name); - } else { - no_displays = false; } } - if (no_displays) - return -EPROBE_DEFER; - return 0; cleanup: