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: 52450 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by patches.linaro.org (Postfix) with ESMTPS id F05842031F for ; Fri, 14 Aug 2015 15:51:21 +0000 (UTC) Received: by lbck9 with SMTP id k9sf28031935lbc.0 for ; Fri, 14 Aug 2015 08:51:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=V4C2h98R4CDvYbqR+gUwStIXLVUkyc08iaF36rbDQI0=; b=chYPcQTodlusGV6b0CiDSDcIxgHflTcfDXP40mIbDwwruaHks8MDyAhybSyypOAiuz w+GDp7Z14ZtZmONJsAB8KfcNjJWN3K9+ZFiCn+50YOndy9C487/g3ChyzovVVCtREWq/ sPNWUocgpsgDwwEwfB29f+x7JyKHglCAFP7/WB5e3P8K52WHu+PkYIBEViIBSvwPpV+P ljMOtpeNsGIewagzmaTBb6I1HymPkRjPYVmqcsrYSoJeLhWYtA8oroKqfU6Kec8i0izn Rr+J9s4eFeV89NUO838K9wykpgdJWPqM2EjVJ+us0Fii8tAu+y+/UxUesu+6rrurJB2M GV3Q== X-Gm-Message-State: ALoCoQmsfmYQl++TyCFsbYVBvFXHuo4RspX/jHLy//zecrnavaHV9h1p3nQ4vXGZcDpeKCwUAoYS X-Received: by 10.112.16.200 with SMTP id i8mr13139808lbd.20.1439567480865; Fri, 14 Aug 2015 08:51:20 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.105 with SMTP id i9ls406115laa.72.gmail; Fri, 14 Aug 2015 08:51:20 -0700 (PDT) X-Received: by 10.112.138.199 with SMTP id qs7mr44366065lbb.21.1439567480713; Fri, 14 Aug 2015 08:51:20 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id c4si6187726laf.113.2015.08.14.08.51.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Aug 2015 08:51:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by lalv9 with SMTP id v9so46273210lal.0 for ; Fri, 14 Aug 2015 08:51:20 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr45977423lbc.32.1439567480604; Fri, 14 Aug 2015 08:51:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1715770lba; Fri, 14 Aug 2015 08:51:19 -0700 (PDT) X-Received: by 10.68.200.40 with SMTP id jp8mr90903234pbc.16.1439567478652; Fri, 14 Aug 2015 08:51:18 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id by6si9633236pdb.89.2015.08.14.08.51.17; Fri, 14 Aug 2015 08:51:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755570AbbHNPvP (ORCPT + 6 others); Fri, 14 Aug 2015 11:51:15 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:35107 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755534AbbHNPvO (ORCPT ); Fri, 14 Aug 2015 11:51:14 -0400 Received: by wicne3 with SMTP id ne3so22322105wic.0 for ; Fri, 14 Aug 2015 08:51:13 -0700 (PDT) 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 Cc: David Airlie , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, robdclark@gmail.com, bjorn@kryo.se, Srinivas Kandagatla 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> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: srinivas.kandagatla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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: */