From patchwork Wed Jan 11 06:39:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Archit Taneja X-Patchwork-Id: 9509339 X-Patchwork-Delegate: agross@codeaurora.org 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 57F6F6075C for ; Wed, 11 Jan 2017 06:40:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 418C3285EE for ; Wed, 11 Jan 2017 06:40:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3642728606; Wed, 11 Jan 2017 06:40:03 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF532285F8 for ; Wed, 11 Jan 2017 06:40:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751982AbdAKGkC (ORCPT ); Wed, 11 Jan 2017 01:40:02 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:47968 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750769AbdAKGkB (ORCPT ); Wed, 11 Jan 2017 01:40:01 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B317360233; Wed, 11 Jan 2017 06:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1484116800; bh=/7Q75Yu3bj6ROXjW2EUMnvN04cvWhRkDCph2KIV11cA=; h=From:To:Cc:Subject:Date:From; b=WafvxjAS8X4DFM5vQKJKm9T8TUzoKkr3hoFGQCvZ/u0SlrvUXoUSP83J6UCTZppuD eq2M5I7LNKRoXygcD+BsASOg3xqtMziXxRE0bpuEY3PoFu8YVtIGZTJ1JXZXHsvmPv +dRR3wJrqOiIzVB1aWRESIZtzlTpO6BN7pklUSDM= Received: from localhost (unknown [202.46.23.61]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: architt@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3CC2160233; Wed, 11 Jan 2017 06:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1484116800; bh=/7Q75Yu3bj6ROXjW2EUMnvN04cvWhRkDCph2KIV11cA=; h=From:To:Cc:Subject:Date:From; b=WafvxjAS8X4DFM5vQKJKm9T8TUzoKkr3hoFGQCvZ/u0SlrvUXoUSP83J6UCTZppuD eq2M5I7LNKRoXygcD+BsASOg3xqtMziXxRE0bpuEY3PoFu8YVtIGZTJ1JXZXHsvmPv +dRR3wJrqOiIzVB1aWRESIZtzlTpO6BN7pklUSDM= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 3CC2160233 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=architt@codeaurora.org From: Archit Taneja To: robdclark@gmail.com Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Archit Taneja , Laurent Pinchart Subject: [PATCH] drm/msm/dsi: Set msm_dsi->encoders before initializing bridge Date: Wed, 11 Jan 2017 12:09:51 +0530 Message-Id: <1484116791-20523-1-git-send-email-architt@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The commit "drm: bridge: Link encoder and bridge in core code" updated the drm_bridge_attach() API to also include the drm_encoder pointer the bridge attaches to. The func msm_dsi_manager_bridge_init() now relies on the drm_encoder pointer stored in msm_dsi->encoders to pass the encoder to the bridge API. msm_dsi->encoders is unfortunately set after this function is called, resulting in us passing a NULL pointer to drm_brigde_attach. This results in an error and the DSI driver probe fails. Move the initialization of msm_dsi->encoders[] a bit up. Also, don't try to set the encoder's bridge. That's now managed by the bridge API. Cc: Laurent Pinchart Signed-off-by: Archit Taneja Acked-by: Laurent Pinchart --- drivers/gpu/drm/msm/dsi/dsi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index ec572f8..9593238 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -205,6 +205,9 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, goto fail; } + for (i = 0; i < MSM_DSI_ENCODER_NUM; i++) + msm_dsi->encoders[i] = encoders[i]; + msm_dsi->bridge = msm_dsi_manager_bridge_init(msm_dsi->id); if (IS_ERR(msm_dsi->bridge)) { ret = PTR_ERR(msm_dsi->bridge); @@ -213,11 +216,6 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, goto fail; } - for (i = 0; i < MSM_DSI_ENCODER_NUM; i++) { - encoders[i]->bridge = msm_dsi->bridge; - msm_dsi->encoders[i] = encoders[i]; - } - /* * check if the dsi encoder output is connected to a panel or an * external bridge. We create a connector only if we're connected to a