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 2BE73C83F10 for ; Sun, 27 Aug 2023 08:16:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6DD9710E190; Sun, 27 Aug 2023 08:16:37 +0000 (UTC) X-Greylist: delayed 552 seconds by postgrey-1.36 at gabe; Sat, 26 Aug 2023 10:04:47 UTC Received: from mail.mimoja.de (mail.mimoja.de [IPv6:2a00:17d8:100::c31]) by gabe.freedesktop.org (Postfix) with ESMTP id DAB9F10E02B for ; Sat, 26 Aug 2023 10:04:47 +0000 (UTC) Received: from Mimoja-Datenschleuder.. (ip-185-104-138-32.ptr.icomera.net [185.104.138.32]) by mail.mimoja.de (Postfix) with ESMTPSA id CDE1A24C09; Sat, 26 Aug 2023 11:55:31 +0200 (CEST) From: Mimoja To: dri-devel@lists.freedesktop.org, mimoja@aachen.ccc.de, alu@fffuego.com Subject: [PATCH] drm/panel/panel-sitronix-st7701: Move init sequence from prepare() to enable() Date: Sat, 26 Aug 2023 11:55:16 +0200 Message-Id: <20230826095516.81387-1-git@mimoja.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Sun, 27 Aug 2023 08:16:19 +0000 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: , Cc: Marek Vasut , Jagan Teki , =?UTF-8?q?Guido=20G=C3=BCnther?= , Thierry Reding , Laurent Pinchart , Sam Ravnborg , Mimoja Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The struct drm_panel_funcs are offering a prepare() and an enable() entrypoint for panels. According to drm/panel.h: "The .prepare() function is typically called before the display controller starts to transmit video data." and "After the display controller has started transmitting video data, it's safe to call the .enable() function." The st7701 driver currently does not respect this, queing DSI control commands during enable. While generally fine this can lead to a fillup of the transmission queue before the transmission is set up on certain dsi bridges. This issue can also be seen on downstream imx8m* kernels. By moving the init sequence into the enable function we not only circumvent the issue but also properly soft-reset the panel on enable(). Signed-off-by: Mimoja Cc: Marek Vasut Cc: Guido Günther Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Sam Ravnborg Cc: Thierry Reding --- drivers/gpu/drm/panel/panel-sitronix-st7701.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/drm/panel/panel-sitronix-st7701.c index 7eae83aa0ea1..18c5a8d97cc8 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c @@ -439,6 +439,13 @@ static int st7701_prepare(struct drm_panel *panel) gpiod_set_value(st7701->reset, 1); msleep(150); + return 0; +} + +static int st7701_enable(struct drm_panel *panel) +{ + struct st7701 *st7701 = panel_to_st7701(panel); + st7701_init_sequence(st7701); if (st7701->desc->gip_sequence) @@ -447,13 +454,6 @@ static int st7701_prepare(struct drm_panel *panel) /* Disable Command2 */ st7701_switch_cmd_bkx(st7701, false, 0); - return 0; -} - -static int st7701_enable(struct drm_panel *panel) -{ - struct st7701 *st7701 = panel_to_st7701(panel); - ST7701_DSI(st7701, MIPI_DCS_SET_DISPLAY_ON, 0x00); return 0; -- 2.39.2