From patchwork Mon Mar 5 08:57:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10258429 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 E01D46055D for ; Mon, 5 Mar 2018 08:58:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFA3D2895B for ; Mon, 5 Mar 2018 08:58:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C464428995; Mon, 5 Mar 2018 08:58:12 +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 4C3A82896D for ; Mon, 5 Mar 2018 08:58:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933491AbeCEI6L (ORCPT ); Mon, 5 Mar 2018 03:58:11 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:39600 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933492AbeCEI6J (ORCPT ); Mon, 5 Mar 2018 03:58:09 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180305085807euoutp01123cc93d2e272ab5f55292dfa431fc5d~Y_ny8L4qO2387723877euoutp011; Mon, 5 Mar 2018 08:58:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180305085807euoutp01123cc93d2e272ab5f55292dfa431fc5d~Y_ny8L4qO2387723877euoutp011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1520240287; bh=bW/OM0hqVhw2bwfdhVWXyXGcaTquvOO/BaMir5HmBb0=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=d7WMTu4wkKZzWyM0D6tFjneXZp1eI3Z2sFhHGzXV4TQcjZcWBlMWF3VPG0cHZZcNK yHE0TUAi1AXbZplCn961K5uElJupiyZ7lp1j9BOgg6swysjQu8o/UWIATYIC6SevJx uY8N1LwGsIXM1cDVRRY9pdugC63ty+Osk4i1xv3E= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180305085807eucas1p2f2bb549b7dc1151b27f8639b34048ee9~Y_nyZzWjl2306223062eucas1p22; Mon, 5 Mar 2018 08:58:07 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 04.C6.17380.E960D9A5; Mon, 5 Mar 2018 08:58:06 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180305085806eucas1p2156c70fa406dd25814b12a873dac5281~Y_nxl_mNF0174101741eucas1p2H; Mon, 5 Mar 2018 08:58:06 +0000 (GMT) X-AuditID: cbfec7f4-6f9ff700000043e4-25-5a9d069ea170 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 60.F1.04178.E960D9A5; Mon, 5 Mar 2018 08:58:06 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P5400MEY0WMAI90@eusync1.samsung.com>; Mon, 05 Mar 2018 08:58:06 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org Cc: Marek Szyprowski , Archit Taneja , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Thierry Escande , Tomasz Figa , Sean Paul , Bartlomiej Zolnierkiewicz , Laurent Pinchart , Thierry Reding , Sandy Huang , Enric Balletbo i Serra , Andrzej Hajda , Douglas Anderson , Haixia Shi , Zain Wang , Lin Huang Subject: [PATCH 3/3] drm/bridge: analogix_dp: Don't create useless connectors Date: Mon, 05 Mar 2018 09:57:41 +0100 Message-id: <20180305085741.18896-4-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.15.0 In-reply-to: <20180305085741.18896-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWSfyyUcRzH+z6/7nG5PDvGd2q1XauZSWm1fW9Ev6antaY/rLbbKocn5Bzd wxWFW5OOOD82y88L3fxahEyYH1HRMoxIkmXEH4S4miy5nEf/vT6f9/v9+Xy+25fGpQbSmQ5T R3MatVIlo8REY/da/yEjVaQ4YqySo881/SS6r18gUV3ucxL1lXVSaPjXEoWejXcBZJmaJ1FR djz6XfseRw8bpjCUkmUSoZVJC45yB9oxVP1mQoQmavsAMj/YoFDGyBCF1lqMBEoedTxpzxbo Bgn2gyEdY5smTIBtzp8QsQX6PJL9+qgHY1+YEtm/+R0Ea2ioAuzLj0acNdfvvbRTIfYK5lRh Wk5z2DtAHFq+OElF/XW+M/a2ktSBT46pwIaGzDG4kNOBpQIxLWUqAHwyObxdmAFc7lgH/121 f0wiQSgD8NX9SkIodBhcbTNhVhfFeMDUhVTKyg6MCq7ovwOrCWfqSFg93rw1yp7xg+ZRi8jK BHMAFqXptsIS5gSsmDOIhHX74NPV5q1BNow3LCzpxq2DIGOhYMYDy/ZNZ+F6WS8hsD2c62nY Du+BKfpOTOBEaFh9gwnhNADbknK2BU/4umeQtDLO7ILZjY83N9CbfQnUJ0sFCwvbvg1QAp+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nH9ETxlMPajDu/ XH8gIdnmO/vr8sZPlkI8W+PUDpgJvOWdxOmaMGmyUE/3pq/XUyYZq93dw9gxL2qdxEtvh7+Z wU0fovKF9zdllVuYN6yIUmIpzkg01GIuKk4EAI+myKZxAgAA X-CMS-MailID: 20180305085806eucas1p2156c70fa406dd25814b12a873dac5281 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180305085806eucas1p2156c70fa406dd25814b12a873dac5281 X-RootMTR: 20180305085806eucas1p2156c70fa406dd25814b12a873dac5281 References: <20180305085741.18896-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If there is another bridge after analogix_dp, then the connector object should not be created. This fixes following timeouts on Exynos5420-based Chromebook2 Peach-PIT board during boot: exynos-dp 145b0000.dp-controller: AUX CH cmd reply timeout! exynos-dp 145b0000.dp-controller: AUX CH enable timeout! exynos-dp 145b0000.dp-controller: AUX CH enable timeout! exynos-dp 145b0000.dp-controller: AUX CH enable timeout! exynos-dp 145b0000.dp-controller: AUX CH enable timeout! Signed-off-by: Marek Szyprowski Tested-by: Heiko Stuebner --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 29 ++++++++++++---------- drivers/gpu/drm/exynos/exynos_dp.c | 1 + include/drm/bridge/analogix_dp.h | 1 + 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index b391d149db91..a693ab3078f0 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1012,27 +1012,30 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge) { struct analogix_dp_device *dp = bridge->driver_private; struct drm_encoder *encoder = dp->encoder; - struct drm_connector *connector = &dp->connector; - int ret; + struct drm_connector *connector = NULL; + int ret = 0; if (!bridge->encoder) { DRM_ERROR("Parent encoder object not found"); return -ENODEV; } - connector->polled = DRM_CONNECTOR_POLL_HPD; + if (!dp->plat_data->skip_connector) { + connector = &dp->connector; + connector->polled = DRM_CONNECTOR_POLL_HPD; - ret = drm_connector_init(dp->drm_dev, connector, - &analogix_dp_connector_funcs, - DRM_MODE_CONNECTOR_eDP); - if (ret) { - DRM_ERROR("Failed to initialize connector with drm\n"); - return ret; - } + ret = drm_connector_init(dp->drm_dev, connector, + &analogix_dp_connector_funcs, + DRM_MODE_CONNECTOR_eDP); + if (ret) { + DRM_ERROR("Failed to initialize connector with drm\n"); + return ret; + } - drm_connector_helper_add(connector, - &analogix_dp_connector_helper_funcs); - drm_mode_connector_attach_encoder(connector, encoder); + drm_connector_helper_add(connector, + &analogix_dp_connector_helper_funcs); + drm_mode_connector_attach_encoder(connector, encoder); + } /* * NOTE: the connector registration is implemented in analogix diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c index 33319a858f3a..964831dab102 100644 --- a/drivers/gpu/drm/exynos/exynos_dp.c +++ b/drivers/gpu/drm/exynos/exynos_dp.c @@ -244,6 +244,7 @@ static int exynos_dp_probe(struct platform_device *pdev) /* The remote port can be either a panel or a bridge */ dp->plat_data.panel = panel; + dp->plat_data.skip_connector = !!bridge; dp->ptn_bridge = bridge; out: diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h index 5518fc75dd6e..711fff9b6803 100644 --- a/include/drm/bridge/analogix_dp.h +++ b/include/drm/bridge/analogix_dp.h @@ -31,6 +31,7 @@ struct analogix_dp_plat_data { struct drm_panel *panel; struct drm_encoder *encoder; struct drm_connector *connector; + bool skip_connector; int (*power_on)(struct analogix_dp_plat_data *); int (*power_off)(struct analogix_dp_plat_data *);