Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp298272pxa; Wed, 19 Aug 2020 01:19:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJnTKOhxjpSSikkzx9GFi/je1vuzIRulChGQr7deDYvlvgi7ixBlgJ42R1XB13filA775c X-Received: by 2002:a17:906:6d54:: with SMTP id a20mr25234059ejt.501.1597825175941; Wed, 19 Aug 2020 01:19:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597825175; cv=none; d=google.com; s=arc-20160816; b=P3qqZ1q3LHNGUkVcqYrABoNF3+YALZBo2WKRTbedrWCPAL5wz1a4c7+haCoK6XplM8 kY4TWsyVifgIxVGT8kS6V4KkxMpM7MLTAgWZ5kOXxO+piIiHvMcf+pDrmrN7Xzq5gFeY KGH6BwMK4Z8N3eUlv9Om+xmn0hF5jXJOEnT+Fw4OGqm9aFz8CfZmVcG7Tj75h++q9kl5 lYYVugIW/C4sxfeG421ncY+vNC/JWj5V6CsWSOMONhj03FJVMTl3WgSj/sznYZ4qiR1s hjlJRKNpGZXjARPF5xPDCM0St5ayRHHFSLzdOx4LlVKM86NJCxA9MiiMCemXFhLgr5qV TeLQ== 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=aCIlZODk5CSAwOc0oa7YsTzGruTJxzQQ2MBZTDAe50c=; b=CliLQ4o1usWukcOqhrz1oVhdREdmMgksuTuawTzuffHo19FeD5qLWw8DPTG6iWmAly AN89k6nhkvaZ97BXGYz5/xk8IIfJbvDPW24UOSiUOCqqJeocWps/0RbX+BBCKvQFKQM/ 5Rwv2Ma3buHJj0vDz6+YxKcbQg1EDta/o+Yl/lrfS/s8/WIg1mtRFlMNT4cSBn39vDGs u24MwSQ1SA93CrzUSUKGf8jeUKNsu9G3gR6UAgM7HHIss+QVkscGiKX04ZfoxNSYfLQm F9FUny6mQOz0ga+Tp5cpcd6JmfHxdBvYDbVkdhMuROw+NqmPho9b5eNLXvpNa17vR/sf nv9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b="TGODLM/+"; 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 c20si14151294edx.70.2020.08.19.01.19.12; Wed, 19 Aug 2020 01:19:35 -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="TGODLM/+"; 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 S1726820AbgHSISX (ORCPT + 99 others); Wed, 19 Aug 2020 04:18:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726627AbgHSISF (ORCPT ); Wed, 19 Aug 2020 04:18:05 -0400 Received: from mxout4.routing.net (mxout4.routing.net [IPv6:2a03:2900:1:a::9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AE3CC061346 for ; Wed, 19 Aug 2020 01:18:04 -0700 (PDT) Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout4.routing.net (Postfix) with ESMTP id 3EE801014B5; Wed, 19 Aug 2020 08:18:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1597825083; 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=aCIlZODk5CSAwOc0oa7YsTzGruTJxzQQ2MBZTDAe50c=; b=TGODLM/+DQUi0GN/TEgV+98HceT/MdPymhyoV0SguSciXP7JkC2kJhD2P2yR6M6UaXHuVN bogFj6wLd3pAs2iQHYNrB0GN/rClAVKiaA+JfUlEF/tpzq6/E8FImc4lJlGOdBQKEP2f0v yObU5Urle4WUcmzObvkXwZd59k54iyU= Received: from localhost.localdomain (fttx-pool-185.76.97.101.bambit.de [185.76.97.101]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id 5DDF910007C; Wed, 19 Aug 2020 08:18:02 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Chun-Kuang Hu , Philipp Zabel , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Matthias Brugger , linux-arm-kernel@lists.infradead.org, Jitao Shi Subject: [PATCH v5 5/7] drm/mediatek: dpi/dsi: change the getting possible_crtc way Date: Wed, 19 Aug 2020 10:17:50 +0200 Message-Id: <20200819081752.4805-6-linux@fw-web.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200819081752.4805-1-linux@fw-web.de> References: <20200819081752.4805-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 Reviewed-by: Chun-Kuang Hu --- 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 16fd99dcdacf..c9f4ad029cb1 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -974,7 +974,8 @@ static int mtk_dsi_encoder_init(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); ret = drm_bridge_attach(&dsi->encoder, &dsi->bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); -- 2.25.1