From patchwork Wed Sep 20 10:31:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 13392515 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E3A50CE79BE for ; Wed, 20 Sep 2023 10:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=k3cpythsxejIzk/V+QKlv5UUBtptOTQCKFd2J0Nhvaw=; b=MCsdo+DcR5zqsQ iJ2i3Ivy/NNElXyh+qyr5+xU8KP3ZKeBLcD8fbP+tYkAyoTHkMAlUm6tA/L55gANaGxZbwjId09+C 6GULkVm3Qkoopcduolk6uqnBztpk4/S6q5GL3BCvFILMUKOHibq8eiTFiDfnDCcP4kvUVvSGsz+Dg wPxIuWbhdr2/gLMpym8+2XJrOwFZHLTx1RE3h85gxrg3P7062kCyn977csXqIQ8rm6Q2jUXTk44hG sC+4t0HbqbVRfBr+e9FP3I9R7ABcd5VcdZ9ERIB8GqEuFT/OwVm/e30L3KK2SDr1lQIZ0Q1yC29/H 7n9wd//esgK3BatCoRdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qiuUp-002cMK-0B; Wed, 20 Sep 2023 10:31:51 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qiuUY-002c8w-0r for linux-arm-kernel@lists.infradead.org; Wed, 20 Sep 2023 10:31:38 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiuUR-0003mT-Q9; Wed, 20 Sep 2023 12:31:27 +0200 Received: from [2a0a:edc0:0:1101:1d::28] (helo=dude02.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qiuUR-007fJ0-C4; Wed, 20 Sep 2023 12:31:27 +0200 From: Lucas Stach To: Marek Vasut , Liu Ying Cc: Pengutronix Kernel Team , NXP Linux Team , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, patchwork-lst@pengutronix.de Subject: [PATCH 4/5] drm: lcdif: move pitch setup to plane atomic update Date: Wed, 20 Sep 2023 12:31:25 +0200 Message-Id: <20230920103126.2759601-5-l.stach@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230920103126.2759601-1-l.stach@pengutronix.de> References: <20230920103126.2759601-1-l.stach@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230920_033134_337481_9DA65BA8 X-CRM114-Status: GOOD ( 13.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The buffer pitch may change when switching the buffer on a atomic update. As the register is double buffered it can be safely changed while the display is active. Signed-off-by: Lucas Stach Reviewed-by: Marek Vasut --- drivers/gpu/drm/mxsfb/lcdif_kms.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index 33a082366b25..3ebf55d06027 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -327,19 +327,6 @@ static void lcdif_set_mode(struct lcdif_drm_private *lcdif, u32 bus_flags) writel(CTRLDESCL0_1_HEIGHT(m->vdisplay) | CTRLDESCL0_1_WIDTH(m->hdisplay), lcdif->base + LCDC_V8_CTRLDESCL0_1); - - /* - * Undocumented P_SIZE and T_SIZE bitfields written in the downstream - * driver. Those bitfields control the AXI burst size. As of now there - * are two known values: - * 1 - 128Byte - * 2 - 256Byte - * Downstream sets this to 256B burst size to improve the memory access - * efficiency so set it here too. - */ - ctrl = CTRLDESCL0_3_P_SIZE(2) | CTRLDESCL0_3_T_SIZE(2) | - CTRLDESCL0_3_PITCH(lcdif->crtc.primary->state->fb->pitches[0]); - writel(ctrl, lcdif->base + LCDC_V8_CTRLDESCL0_3); } static void lcdif_enable_controller(struct lcdif_drm_private *lcdif) @@ -689,6 +676,19 @@ static void lcdif_plane_primary_atomic_update(struct drm_plane *plane, writel(CTRLDESCL_HIGH0_4_ADDR_HIGH(upper_32_bits(paddr)), lcdif->base + LCDC_V8_CTRLDESCL_HIGH0_4); } + + /* + * Undocumented P_SIZE and T_SIZE bitfields written in the downstream + * driver. Those bitfields control the AXI burst size. As of now there + * are two known values: + * 1 - 128Byte + * 2 - 256Byte + * Downstream sets this to 256B burst size to improve the memory access + * efficiency so set it here too. + */ + writel(CTRLDESCL0_3_P_SIZE(2) | CTRLDESCL0_3_T_SIZE(2) | + CTRLDESCL0_3_PITCH(new_pstate->fb->pitches[0]), + lcdif->base + LCDC_V8_CTRLDESCL0_3); } static bool lcdif_format_mod_supported(struct drm_plane *plane,