From patchwork Fri Aug 14 15:51:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 7022711 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2B585C05AE for ; Mon, 17 Aug 2015 00:51:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51A862063E for ; Mon, 17 Aug 2015 00:51:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 50B532063B for ; Mon, 17 Aug 2015 00:51:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E4DA16E7C6; Sun, 16 Aug 2015 17:51:45 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4528B6EFB7 for ; Fri, 14 Aug 2015 08:51:15 -0700 (PDT) Received: by wicja10 with SMTP id ja10so22174988wic.1 for ; Fri, 14 Aug 2015 08:51:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ycYTlksGago7lUkurt9xhAeBKoGFruUJdOJgGuRaHck=; b=mxQIXaiwlhlZ2ANzc6x4WDi7sAxPPlfm/hDFw1LWvnQCX0Sg3K/vP4QjBe8JWm0+rj eccAdQ18t3Z/Zy8yynGYFKWj6Mo4ehZjk0t0FMra/6WtPNr/Skkwb6TaQMjdywdvhMBl 9I0jnCgD3BMbZGICyfSgxbeeWEwxEWbfKYw9DPfWQ7237PZ25leMHFVmmIq5uElnvPUB HTj57kA26/5RXE65zvHV7Z5cISuUVNyI4KH1XT+xeu5bvM2iTJUGRS/luMyTJOCw0Xjr CVTy8S8s7C1/E1YVMq8Ud1jfkg70e1Igc10/C0i6IiDW3JK5Onxqp93gldF01Y17rynR DuZw== X-Gm-Message-State: ALoCoQlcl8MoI/Rgj/M9y05JgUIfj/3tidWEE6AUPYk/AJ78B3kg+CdASBW+h4VcprRR7Jm/8SBp X-Received: by 10.194.190.110 with SMTP id gp14mr1156236wjc.76.1439567473764; Fri, 14 Aug 2015 08:51:13 -0700 (PDT) Received: from localhost.localdomain (host-92-13-246-184.as43234.net. [92.13.246.184]) by smtp.gmail.com with ESMTPSA id fs8sm3688037wib.0.2015.08.14.08.51.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Aug 2015 08:51:13 -0700 (PDT) From: Srinivas Kandagatla To: Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH RFC 4/5] drm/msm: mdp4 lvds: continue if the panel is not connected Date: Fri, 14 Aug 2015 16:51:04 +0100 Message-Id: <1439567464-13787-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <439567280-13491-1-git-send-email-srinivas.kandagatla@linaro.org> References: <439567280-13491-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailman-Approved-At: Sun, 16 Aug 2015 17:51:43 -0700 Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Two issues: 1> Intializing panel specific bits without actual panel presence. 2> Bailing out if the detect_panel() return -ENODEV. With the existing code if detect_panel() returns an error code the driver would bail out without doing anything, However it could continue intializing hdmi related things. This patch adds two things. 1> moves the panel specific intialization only if the panel is detected 2> let the driver continue with hdmi intialization if detect_panel() return -ENODEV. Signed-off-by: Srinivas Kandagatla --- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 72 +++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c index 601dcc0..ad02b8b 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c @@ -313,45 +313,55 @@ static int modeset_init(struct mdp4_kms *mdp4_kms) if (IS_ERR(panel)) { ret = PTR_ERR(panel); dev_err(dev->dev, "failed to detect LVDS panel: %d\n", ret); - goto fail; - } + /** + * Only fail if there is panel but not ready yet + * continue with other stuff if there is no panel connected. + */ + if (ret == -EPROBE_DEFER) + goto fail; + } else { + plane = mdp4_plane_init(dev, RGB2, true); + if (IS_ERR(plane)) { + dev_err(dev->dev, + "failed to construct plane for RGB2\n"); + ret = PTR_ERR(plane); + goto fail; + } - plane = mdp4_plane_init(dev, RGB2, true); - if (IS_ERR(plane)) { - dev_err(dev->dev, "failed to construct plane for RGB2\n"); - ret = PTR_ERR(plane); - goto fail; - } + crtc = mdp4_crtc_init(dev, plane, priv->num_crtcs, 0, DMA_P); + if (IS_ERR(crtc)) { + dev_err(dev->dev, + "failed to construct crtc for DMA_P\n"); + ret = PTR_ERR(crtc); + goto fail; + } - crtc = mdp4_crtc_init(dev, plane, priv->num_crtcs, 0, DMA_P); - if (IS_ERR(crtc)) { - dev_err(dev->dev, "failed to construct crtc for DMA_P\n"); - ret = PTR_ERR(crtc); - goto fail; - } + encoder = mdp4_lcdc_encoder_init(dev, panel); + if (IS_ERR(encoder)) { + dev_err(dev->dev, + "failed to construct LCDC encoder\n"); + ret = PTR_ERR(encoder); + goto fail; + } - encoder = mdp4_lcdc_encoder_init(dev, panel); - if (IS_ERR(encoder)) { - dev_err(dev->dev, "failed to construct LCDC encoder\n"); - ret = PTR_ERR(encoder); - goto fail; - } + /* LCDC can be hooked to DMA_P: */ + encoder->possible_crtcs = 1 << priv->num_crtcs; - /* LCDC can be hooked to DMA_P: */ - encoder->possible_crtcs = 1 << priv->num_crtcs; + priv->crtcs[priv->num_crtcs++] = crtc; + priv->encoders[priv->num_encoders++] = encoder; - priv->crtcs[priv->num_crtcs++] = crtc; - priv->encoders[priv->num_encoders++] = encoder; + connector = mdp4_lvds_connector_init(dev, panel, encoder); + if (IS_ERR(connector)) { + ret = PTR_ERR(connector); + dev_err(dev->dev, + "failed to initialize LVDS connector: %d\n", + ret); + goto fail; + } - connector = mdp4_lvds_connector_init(dev, panel, encoder); - if (IS_ERR(connector)) { - ret = PTR_ERR(connector); - dev_err(dev->dev, "failed to initialize LVDS connector: %d\n", ret); - goto fail; + priv->connectors[priv->num_connectors++] = connector; } - priv->connectors[priv->num_connectors++] = connector; - /* * Setup DTV/HDMI path: RGB1 -> DMA_E -> DTV -> HDMI: */