From patchwork Wed Sep 20 10:31:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 13392513 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 4889BCE79C2 for ; Wed, 20 Sep 2023 10:32:13 +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=LTi8LzA5kkKJGNMyD+vZWoF+YJVQw6I+rU4UWEUJ8Q8=; b=LL8Uu0r8r9Scmu DJTfuTxtcUYxqV32vvLm6mhgHExZCOo8dpcNKQ1HqmCzcWRSCM89pl9/iQjdA5dYh1rJdLnjGZ18Y mVNI/gaBcxinnJCwsz1YB39WEu79ygZQYz3zdv409ZYmSE2RDTRqD4aZeqOFHDrJ65yMmscZ0TOOe fU/YeezI3mV7Pk/86ZObPyNRVwIbK4kRdRE2oOINTKQuYkdldaH53A4qtIsuJhk1L2EJ3aJCKZaWs 23KdpOH5hdh8tMxBmXUFJ6vOqDY9D6Ia+ranCwut/Kv1RnPUZ+o6jN7Rtm+1ZQJHw19s8+qeQYsW7 z85/ZxlBc3ndwAKecFCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qiuUq-002cNa-08; Wed, 20 Sep 2023 10:31:52 +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-002c91-0s for linux-arm-kernel@lists.infradead.org; Wed, 20 Sep 2023 10:31:37 +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-0003mR-Ps; 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-7Z; 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 2/5] drm: lcdif: move controller enable into atomic_flush Date: Wed, 20 Sep 2023 12:31:23 +0200 Message-Id: <20230920103126.2759601-3-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_337045_B53A99DA X-CRM114-Status: GOOD ( 11.78 ) 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 Allow drm_atomic_helper_commit_tail_rpm to setup all the plane state before the scanout is started. Signed-off-by: Lucas Stach Reviewed-by: Marek Vasut --- drivers/gpu/drm/mxsfb/lcdif_kms.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index f5bfe8b52920..4acf6914a8d1 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -505,6 +505,8 @@ static int lcdif_crtc_atomic_check(struct drm_crtc *crtc, static void lcdif_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) { + struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, + crtc); struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->dev); struct drm_pending_vblank_event *event; u32 reg; @@ -513,6 +515,9 @@ static void lcdif_crtc_atomic_flush(struct drm_crtc *crtc, reg |= CTRLDESCL0_5_SHADOW_LOAD_EN; writel(reg, lcdif->base + LCDC_V8_CTRLDESCL0_5); + if (drm_atomic_crtc_needs_modeset(crtc_state)) + lcdif_enable_controller(lcdif); + event = crtc->state->event; crtc->state->event = NULL; @@ -552,7 +557,6 @@ static void lcdif_crtc_atomic_enable(struct drm_crtc *crtc, writel(CTRLDESCL_HIGH0_4_ADDR_HIGH(upper_32_bits(paddr)), lcdif->base + LCDC_V8_CTRLDESCL_HIGH0_4); } - lcdif_enable_controller(lcdif); drm_crtc_vblank_on(crtc); }