Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp228755pxa; Tue, 4 Aug 2020 04:14:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymzf9wgbP8jnf4FJgPiLYdpbJHfPkjVQs/UKO2RctXjabUYxiVkQ8LZb2PE4OtGU9L4k2M X-Received: by 2002:a17:906:348a:: with SMTP id g10mr7675558ejb.551.1596539667424; Tue, 04 Aug 2020 04:14:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596539667; cv=none; d=google.com; s=arc-20160816; b=vnN8Pu518sj1UufoxmrFJD4uK6nFoeWFxUvfvSJBk1X2uPRm639u25kh6PWtbVSUXU i/GX5eOjRq9TTlqsESokFbsDxeiUGAu/lzINQcn6Gp3lim0LGw+kNZu2HMISs3lxqEKU oixRGkcl26zvava8WvLnA6URqPNW2dhIx1NWiaDGkagFxWCjMv4tTd6E6hcSCgkE4KPV 7sKpyoW/yNgvJd35PF81SshWREANfosDgUTnpNiGkjF1z+DRlHR4ZH7U6+nVZcAsISZy HC8rLl5W3yuQQm1jmXZIbnFxRZ5r/y+/mnwUa6EV7ldEfW5H0wbkz13k0SR7l61JqSFC M5bw== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=9e/a3rUwFuBMSskkYZ+RYGEA6Kthgmd/yV5yPyHRPeg=; b=yVqVHeN+Cbc21RL7mMmV7qxaxpIielqGNvi2CJzr1Pjf6+0DYCer0BndyWGalAkGYM pSEhiVoC3rC3PtxwohidMoIzgfcK0FX/n+Ugf6eyPHPbtPRwmzJfNcJM2Zl1pEb5CKgA YOV1eQS34jXcg+TUI4hUpvxUlFul8p1gdR08Q/N7rExpE86ITHMbKBnG820NXl78LL22 /ybxucJjdsPY3GINKMVvdtqCy8vGLSbag5b9BCN/yBvkB+A6rjRGm7cqhlsEqMT3qqgz EAyu5LcwBAYHK/zoJQRC/a6UYaTOMuB8WRWzRfWn4lUzlGwp+h0m/6JZmfhFG9NWawsc 7RTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=Y14NMTcz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si10966850ejp.500.2020.08.04.04.12.54; Tue, 04 Aug 2020 04:14:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=Y14NMTcz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728945AbgHDLLL (ORCPT + 99 others); Tue, 4 Aug 2020 07:11:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727923AbgHDLF0 (ORCPT ); Tue, 4 Aug 2020 07:05:26 -0400 Received: from mxwww.masterlogin.de (mxwww.masterlogin.de [IPv6:2a03:2900:1:1::b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01741C061757 for ; Tue, 4 Aug 2020 04:05:13 -0700 (PDT) Received: from mxout4.routing.net (unknown [192.168.10.112]) by forward.mxwww.masterlogin.de (Postfix) with ESMTPS id ABAF596320; Tue, 4 Aug 2020 10:59:24 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.78]) by mxout4.routing.net (Postfix) with ESMTP id 6E61D100039; Tue, 4 Aug 2020 10:59:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1596538764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9e/a3rUwFuBMSskkYZ+RYGEA6Kthgmd/yV5yPyHRPeg=; b=Y14NMTcz5IclwJJLeaLMeJySnzqkACz75ctV+HTIaAyhxSCc32+VrbbhadmYoxChGgnI5b DeHGYyCRjlBnoFb+LAtwx6mNfvpEuGNrk6O9ZRhbgcWAlmE4rv02diGjs0XvMDUu4zN9b2 lO8QqbWBfpqJNOJDNF75KU7ndfeAl7A= Received: from localhost.localdomain (fttx-pool-217.61.144.119.bambit.de [217.61.144.119]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id B2CAD3606F6; Tue, 4 Aug 2020 10:59:23 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jitao Shi Subject: [PATCH v3 4/5] drm/mediatek: dpi/dsi: change the getting possible_crtc way Date: Tue, 4 Aug 2020 12:58:48 +0200 Message-Id: <20200804105849.70876-5-linux@fw-web.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200804105849.70876-1-linux@fw-web.de> References: <20200804105849.70876-1-linux@fw-web.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jitao Shi For current mediatek dsi encoder, its possible crtc is fixed in crtc 0, and mediatek dpi encoder's possible crtc is fixed in crtc 1. In some SoC the possible crtc is not fixed in this case, so call mtk_drm_find_possible_crtc_by_comp() to find out the correct possible crtc. Signed-off-by: Jitao Shi Signed-off-by: Frank Wunderlich --- drivers/gpu/drm/mediatek/mtk_dpi.c | 3 ++- drivers/gpu/drm/mediatek/mtk_dsi.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c index d4f0fb7ad312..e43977015843 100644 --- a/drivers/gpu/drm/mediatek/mtk_dpi.c +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c @@ -608,7 +608,8 @@ static int mtk_dpi_bind(struct device *dev, struct device *master, void *data) drm_encoder_helper_add(&dpi->encoder, &mtk_dpi_encoder_helper_funcs); /* Currently DPI0 is fixed to be driven by OVL1 */ - dpi->encoder.possible_crtcs = BIT(1); + dpi->encoder.possible_crtcs = + mtk_drm_find_possible_crtc_by_comp(drm_dev, dpi->ddp_comp); ret = drm_bridge_attach(&dpi->encoder, dpi->bridge, NULL, 0); if (ret) { diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index 270bf22c98fe..c31d9c12d4a9 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -892,7 +892,8 @@ static int mtk_dsi_create_conn_enc(struct drm_device *drm, struct mtk_dsi *dsi) * Currently display data paths are statically assigned to a crtc each. * crtc 0 is OVL0 -> COLOR0 -> AAL -> OD -> RDMA0 -> UFOE -> DSI0 */ - dsi->encoder.possible_crtcs = 1; + dsi->encoder.possible_crtcs = + mtk_drm_find_possible_crtc_by_comp(drm, dsi->ddp_comp); /* If there's a bridge, attach to it and let it create the connector */ if (dsi->bridge) { -- 2.25.1