From patchwork Tue Aug 4 16:55:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 11700693 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BFF5E138C for ; Tue, 4 Aug 2020 16:56:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A4AA82086A for ; Tue, 4 Aug 2020 16:56:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NHcADwoe"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mailerdienst.de header.i=@mailerdienst.de header.b="dIenpDED" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A4AA82086A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fw-web.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=c8HkcgqUXpZh33uXeDXA09GAFC5q6dLtTsa2Fklun10=; b=NHcADwoevGk8fYW4g2m2CfSER 9f6wIiYirZ/5vhyOGO1pxU9Pt1gcj7dRwS4vUuMfobtIHFeqP3reCaHM6yTpxeFT8h1gnauxIr32d jbsXWz8wy9ry6lfsgNQe+kXOI5xwr7QRHeU5scYMm3TyjYr8G4ie9+2CcvqNFOgCPovxY5nHjTkza NUhn0nT8TCV36BAHbMCZhVB3GhB1mXYH5Q/HXYdoZqTNltrZWpMIwMEy9DapIsp3saCtNrQ7tkHqk wf7YPpOTi3G1pjx+AtJw/6VWsdZ5QJ7hqRGjos9y1k5H40HHxU8jEHATyZROQXyMHRi2Ari0pxnyN xq8Y7vV/g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k30FB-0004xI-HS; Tue, 04 Aug 2020 16:56:53 +0000 Received: from mxwww.masterlogin.de ([2a03:2900:1:1::b]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k30EZ-0004hh-UQ; Tue, 04 Aug 2020 16:56:18 +0000 Received: from mxout1.routing.net (unknown [192.168.10.81]) by forward.mxwww.masterlogin.de (Postfix) with ESMTPS id 5467A96153; Tue, 4 Aug 2020 16:56:13 +0000 (UTC) Received: from mxbox3.masterlogin.de (unknown [192.168.10.78]) by mxout1.routing.net (Postfix) with ESMTP id 2D0FC402F8; Tue, 4 Aug 2020 16:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1596560173; 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=P6cNEjRALO0TlHjFZLwAJkcxyJkEDRqVED41Xard7SE=; b=dIenpDEDIxH+p2CzkBrC4sjz/hiTVVg0J55RuLf39UDZWElo3qslZ+2d5jso+UTqcY1kT7 e2bSl1bDh/zSWqWOTj9L6U3KLHINflAIcfwHUHWzEPLmxG4cI/11YvlPTnai14zhUH1cRb atYymnuIdYYE8nwGeg5NGl7H3uLjL2c= Received: from localhost.localdomain (fttx-pool-217.61.144.119.bambit.de [217.61.144.119]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 6B87F3601C7; Tue, 4 Aug 2020 16:56:12 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Subject: [PATCH v4 5/6] drm/mediatek: dpi/dsi: change the getting possible_crtc way Date: Tue, 4 Aug 2020 18:55:54 +0200 Message-Id: <20200804165555.75159-7-linux@fw-web.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200804165555.75159-1-linux@fw-web.de> References: <20200804165555.75159-1-linux@fw-web.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200804_125616_120566_547BF086 X-CRM114-Status: GOOD ( 13.71 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a03:2900:1:1:0:0:0:b listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chun-Kuang Hu , Jitao Shi , Philipp Zabel , Frank Wunderlich , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Matthias Brugger , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.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 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) {