Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6479258imu; Sun, 2 Dec 2018 19:28:03 -0800 (PST) X-Google-Smtp-Source: AFSGD/X51pg3PgrF3nZWr13IAFeP1En6GYLCDSmwHjFohactXkH9hXr+tY9fHn+WTbhQE/56oFRU X-Received: by 2002:a63:585c:: with SMTP id i28mr12087319pgm.178.1543807683135; Sun, 02 Dec 2018 19:28:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543807683; cv=none; d=google.com; s=arc-20160816; b=uPDCKyxnRQ7U78fL1T3G0wvgs8ht4MNYhUu3g+vKg1lELA4Me+A6CEr+B4u7E5qW+k 3NILu1FyzqvKoNk/ttF8OqjTUTbiMgXdbkWadh+h/EkQTzS3RutVK/Dnc0d1D1V47IhZ x7E3Z+/HOfVAUxZkFN6ywD3dfkPOuvsbR252I7WLmFtMy89vGcCylfNXc4J1gs7v0EEC lEUZmRc6R0LNPXGCAyBlFp2vYT4Z4LJvhOYbSGtwET1UNrn+PEsqaQj1WIU5JFeK9RTm yaVjp+kQ934JPt4/7eRCP0KX8lmBCy4oIUJw4ca/hsApbJm0LR94XmCFcMa2GkSHa6/N 7O+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=+U2m9DA5czHcFrKFuFDaxuV9jX1zjRCi7KWYSA3C7no=; b=NkTZ+cwuejN76vxTZvKNiuUxGGAVQSK652/JwbCh458vj1ypNBvXRiIR8Rg5PTl+Rw Bu36G3QdiFNxzPz9+iHXIJKn3TKGGLcMdHlmte8btkBhiRypLLF0PxkCTxsd/G2pvBPA KfOTm6rbDewT0BHS+w9TzF8q1/ESMRtD6iakCD+F6655K0soPpDqVp0gM6DgWzeqTW9L az7wg6hjexwJF6fRhhPSUsPURL927wPVfpsCs+1ygf1RAilY8q++CrY1Vqx9/fN72TfW PyyUKIVnNq6PD80R/FrXtvslmMnQtpsljmJtqDUdPkG0WH2yjAMSWe1AMzBnqp9VY/yl Z8XA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p19si11548035pgj.375.2018.12.02.19.27.45; Sun, 02 Dec 2018 19:28:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725877AbeLCD1L (ORCPT + 99 others); Sun, 2 Dec 2018 22:27:11 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:24918 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725805AbeLCD1L (ORCPT ); Sun, 2 Dec 2018 22:27:11 -0500 X-UUID: 58567d1b71d8435eae3b1b003a4e96a8-20181203 X-UUID: 58567d1b71d8435eae3b1b003a4e96a8-20181203 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1972276798; Mon, 03 Dec 2018 11:27:01 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 3 Dec 2018 11:27:00 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 3 Dec 2018 11:27:00 +0800 Message-ID: <1543807620.11594.2.camel@mtksdaap41> Subject: Re: [PATCH] drm/mediatek: Only try to attach bridge if there is one From: CK Hu To: Nicolas Boichat CC: Philipp Zabel , David Airlie , Matthias Brugger , , , , Date: Mon, 3 Dec 2018 11:27:00 +0800 In-Reply-To: <1543210200.1796.2.camel@mtksdaap41> References: <20181126040737.138682-1-drinkcat@chromium.org> <1543210200.1796.2.camel@mtksdaap41> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Nicolas: On Mon, 2018-11-26 at 13:30 +0800, CK Hu wrote: > Hi, Nicolas: > > On Mon, 2018-11-26 at 12:07 +0800, Nicolas Boichat wrote: > > Even if dsi->bridge is NULL, we still try to call drm_bridge_attach, > > and print out an error message, before creating the connector. > > > > When no bridge is provided, let's skip these 2 steps and directly > > create the connector. > Applied to mediatek-drm-fixes-4.20 [1], thanks. [1] https://github.com/ckhu-mediatek/linux.git-tags/commits/mediatek-drm-fixes-4.20 Regards, CK > Reviewed-by: CK Hu > > > > > Signed-off-by: Nicolas Boichat > > --- > > drivers/gpu/drm/mediatek/mtk_dsi.c | 11 +++++++---- > > 1 file changed, 7 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c > > index 66df1b17795921..27b507eb4a997d 100644 > > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c > > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c > > @@ -818,10 +818,13 @@ static int mtk_dsi_create_conn_enc(struct drm_device *drm, struct mtk_dsi *dsi) > > dsi->encoder.possible_crtcs = 1; > > > > /* If there's a bridge, attach to it and let it create the connector */ > > - ret = drm_bridge_attach(&dsi->encoder, dsi->bridge, NULL); > > - if (ret) { > > - DRM_ERROR("Failed to attach bridge to drm\n"); > > - > > + if (dsi->bridge) { > > + ret = drm_bridge_attach(&dsi->encoder, dsi->bridge, NULL); > > + if (ret) { > > + DRM_ERROR("Failed to attach bridge to drm\n"); > > + goto err_encoder_cleanup; > > + } > > + } else { > > /* Otherwise create our own connector and attach to a panel */ > > ret = mtk_dsi_create_connector(drm, dsi); > > if (ret) >