From patchwork Thu Dec 5 13:44:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13895377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 850AFE7716C for ; Thu, 5 Dec 2024 13:45:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EB47F10EE77; Thu, 5 Dec 2024 13:45:32 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="UzSD9oUW"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7890E10EE75 for ; Thu, 5 Dec 2024 13:45:31 +0000 (UTC) Received: from [127.0.1.1] (91-157-155-49.elisa-laajakaista.fi [91.157.155.49]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4DA817E2; Thu, 5 Dec 2024 14:45:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1733406301; bh=EE9tcKkS2kZxo3gub1ut819lrRxN2CSfvIKQfB09sY0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=UzSD9oUWHOadpRdv8M8vcy7Z1IWkg6Ns2J3tFVc6c4e3fJwnnMO5T4Al0lCvPOOk6 2WUYb2MnyVg225xF7YOBaGC/CdBJMGGwwyPXSzTb0Qcw6ilpibnoT/82HtAoWr8xiE Fx396KuJIiuqYDcydP7tDLmk1wm9AjssCWkXmTbk= From: Tomi Valkeinen Date: Thu, 05 Dec 2024 15:44:57 +0200 Subject: [PATCH v2 02/10] drm/rcar-du: Write DPTSR only if there are more than one crtc MIME-Version: 1.0 Message-Id: <20241205-rcar-gh-dsi-v2-2-42471851df86@ideasonboard.com> References: <20241205-rcar-gh-dsi-v2-0-42471851df86@ideasonboard.com> In-Reply-To: <20241205-rcar-gh-dsi-v2-0-42471851df86@ideasonboard.com> To: Laurent Pinchart , Kieran Bingham , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Michael Turquette , Stephen Boyd , LUU HOAI , Jagan Teki , Sam Ravnborg , Biju Das Cc: Laurent Pinchart , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Laurent Pinchart , linux-clk@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1397; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=68VJo9/6me+7DSWKf+abJ74K+HDESvcWJ/+aDvTsLBg=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBnUa5xyu6mcveVYNrcj4Z9QTJ7/8vbJV+o+pTrJ nH1mfAxMkWJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ1GucQAKCRD6PaqMvJYe 9fFxEACoDe10rlPglocxi5nqJiDZzxKaJ9mOZUExC3YeUBlHOrGladEhR5LLRCg83ej2wRmDNiZ S4XDEsZtuMqJEyiZGTETb9E49aYDhNrGhZg3KbQPDYFb2fhYDO1lmZZ0ZIojDeJ6COol/7YV0y4 3txzVNy5IahjGpJcpezfSymw+W9amGyTSUv7UqlsDdQ7/J3uwVOE59wE/9fGP6mYSrcEeRbcO3M F/IXe6qUBoZh5qkavhAwbJs4ms7H7AAD1r1DluheYKxgo6J5ZaEiuDN/B1sA7d0x+DhhXbJ+05o 21pAZzfa9TrBnZZTqRCjgjlkfXrsqzvfCdnDr4BuSzKHsHBBiHQ7jvEKxlU7sHU2vevcdfWcVc/ b0YFSlfsHVLxkxIIOHWR+BKJjbCZMSUkEDkTCMhG/I/ntOEceAE5Aa/YQ2V0e0seGXPuL42Pump nDn68M4uFbn1NXuqtIVLYpEX9NrSXxp1jGps2xbGOXZsFZCnC7he2KrfFFwO2S5r74qxTfGSdRT PXFiXXyFeXPUTsVzelfI91jqfncrQJtnsiz57t4jthNQ1dGPyNZuHzbOsoWy5YJ6aHJLm3bv2wK 1hvVs+uZi0fdNhza7/5g9ZnW4PsCFlcXSYSzuRSL5d3L4s5La3bnGv+OziZ4aRczTpF72We4dCe +BOmNsApIDm6XvA== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Tomi Valkeinen Currently the driver always writes DPTSR when setting up the hardware. However, the register is only meaningful when there are more than one crtc, and the only SoC with one crtc, V3M, does not have the register mentioned in its documentation. So move the write behind a condition. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c index 2ccd2581f544..0fbf6abbde6e 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c @@ -185,11 +185,13 @@ static void rcar_du_group_setup(struct rcar_du_group *rgrp) dorcr |= DORCR_PG1T | DORCR_DK1S | DORCR_PG1D_DS1; rcar_du_group_write(rgrp, DORCR, dorcr); - /* Apply planes to CRTCs association. */ - mutex_lock(&rgrp->lock); - rcar_du_group_write(rgrp, DPTSR, (rgrp->dptsr_planes << 16) | - rgrp->dptsr_planes); - mutex_unlock(&rgrp->lock); + if (rgrp->num_crtcs > 1) { + /* Apply planes to CRTCs association. */ + mutex_lock(&rgrp->lock); + rcar_du_group_write(rgrp, DPTSR, (rgrp->dptsr_planes << 16) | + rgrp->dptsr_planes); + mutex_unlock(&rgrp->lock); + } } /*