Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1465558lqt; Sat, 20 Apr 2024 17:24:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVU41MBPMBawCpY80Bf7AaPLnIhclr/I1orDG1zvbrGGtisaKzScCA4lZTrmqRxRf1SGERnQ5SIAxFlh4wxWg/Yaea5KcCIhOup2h7YsA== X-Google-Smtp-Source: AGHT+IFZWLqymu+sGGk24TgLA0OQUu4oQjHWOuAmCweWu6hZGp1R7+9NHXCkCPQkk2wboKaRhK7L X-Received: by 2002:a05:6359:4f87:b0:17f:7807:320c with SMTP id nh7-20020a0563594f8700b0017f7807320cmr7907555rwb.5.1713659046713; Sat, 20 Apr 2024 17:24:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713659046; cv=pass; d=google.com; s=arc-20160816; b=S8Tl9qgWwuSeyC3kJZIsgjcc6E9Xar15RbnWTcZTqj2sfQPzO0yQudDGFXkj80oS+A xb+T5SYku65/XPcJvfXyCUIj4jCWdK671xQeqBu/zdbzXD/wgOGEDmAgkgjUCv8IU8XI aJNkHBk1yB6LV8Lo3W5CFCV5txRJFNExLoND79T7GmOEnZ1PuiZOt41iVoDqCXTFF6Fr ogcVHCOB0Zu/8L1CMk+hisoxxRWyvPM05una30oamI1iUs49+WhdWjOUrWx2qlaagRRH tMTCTthTI0K98cl/CPQHg9gzgI8pnYIcuyYNMZ/huOIuU97tgs5yaM+R7SyDRtvs9ZtA M1TA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=CdPWfkaruhSSMkZ/UtsjxPabArNBr6LA6zfCTatS0Jc=; fh=L/salmYkpFMF8nNn7w7xqERkL6Op6Ds41fw8dhsnFVQ=; b=i67DLG+NOE/ckL0XdXC5r2OAlFd6P7h+knfcSVEbx4MfJ5aq6hKr792nW00uhdxGrk 9wuLdFUXhnXvjizimiUEXPiUulVVPf88L0V0D44Lm12jKQwD9O+KEm183y2NQm3lmG5h 6V/ZLghiggsFrQGaFDc1Scf2nkAjizxi2FE3F9gzgKb/i6CaD/nW/jqifMYyVF88h0b2 U7QDrNwfLRahhChL8+dHA39wq7mfwowhbfhLD8jmZcqID30plczWX3IGWZa+AIETm+i+ 3bMmV0FxTNVstkWIIMqv8MbDN9N0jCPwBkgWr4r++8tZ+1ZJdU74ZKwebmOGkJMkFt1r qrqg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=IpnHOKUG; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-kernel+bounces-152399-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152399-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m11-20020a0562141bcb00b0069937046d9asi7397924qvc.533.2024.04.20.17.24.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Apr 2024 17:24:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152399-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=IpnHOKUG; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-kernel+bounces-152399-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152399-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6E7411C20C1F for ; Sun, 21 Apr 2024 00:24:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF54915B7; Sun, 21 Apr 2024 00:24:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b="IpnHOKUG" Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 187514C6C for ; Sun, 21 Apr 2024 00:23:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.214.62.61 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713659040; cv=none; b=ri3n2wKcOrIY4ZLZwQQp62XUKW8BagLe1Sgsyovbp0W7HSezZmITF/CRL79CqQ1V17sryDyfZzl7/KSwM/d/vX46NtfoeXXNnbVDdOFV6mnrWc0dNWPTmV/l5i2u0+flBsrN7vb4NWPn3SFtG0GwOGUkWQK0csfnTkfaEDOwj8U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713659040; c=relaxed/simple; bh=5WIHDz9j3J8qVLPTmDc6NzHreB/LUYrkwR7a5KRFH0c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jZAqrX+9JPOxYJYravzFx0g/QL62BFmM7DR/AzHC0hPyI2hxHcduifZo7sPas6ouskbu+J03s43bIhn1hVwzz4keM04DmZi3dDeJkxhpPX0tD+EdJjsLFEtzR1wrJpjFIicLdm6nndLXuyJKOFkvzdyn1fptKiJc5/xJxLpcpAQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de; spf=pass smtp.mailfrom=denx.de; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b=IpnHOKUG; arc=none smtp.client-ip=85.214.62.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=denx.de Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 913C48825A; Sun, 21 Apr 2024 02:23:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1713659029; bh=CdPWfkaruhSSMkZ/UtsjxPabArNBr6LA6zfCTatS0Jc=; h=From:To:Cc:Subject:Date:From; b=IpnHOKUG7bulT3vvIpV8UDEa2LSDein+QidY7g1abrucwskWoPj4KuOEkMl+T7p/Z yto+PwSnvURcAC1PBgKG4Oa0GFRWokJbHs20LhFVTp5+CQZTccnMpwm+/VwMr6+9TB U2x5OmX5qvgd9bsbNbTH2o3+Avy9Bfzhv/hRsmf0AOfOgTsy5pE2WfWv0NgtwubmoC zvRFpmvb5Z3++kJQAm8dnG0rIBC4bndXs5ktS59VDWG3A6BKpjT3+62hxrz/GFWT01 0msI++wh/2JBA8zBcmR9+T6KBWP65PntQSUiZlWFY4JcvsuAA47MYDK9k7XaHU1sIX SwZmTjEJJ5oKQ== From: Marek Vasut To: dri-devel@lists.freedesktop.org Cc: Marek Vasut , Andrzej Hajda , Biju Das , Daniel Vetter , David Airlie , Douglas Anderson , Jernej Skrabec , Jonas Karlman , Laurent Pinchart , Liu Ying , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Ondrej Jirman , Rob Herring , Robert Foss , Sam Ravnborg , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: [RFC][PATCH] drm: bridge: dw-mipi-dsi: Call modeset in modeset callback Date: Sun, 21 Apr 2024 02:22:35 +0200 Message-ID: <20240421002330.172723-1-marex@denx.de> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Doing modeset in .atomic_pre_enable callback instead of dedicated .mode_set callback does not seem right. Undo this change, which was added as part of commit 05aa61334592 ("drm: bridge: dw-mipi-dsi: Fix enable/disable of DSI controller") as it breaks STM32MP15xx LTDC scanout (DSI)->TC358762 DSI-to-DPI bridge->PT800480 DPI panel pipeline. The original fix for HX8394 panel likely requires HX8394 panel side fix instead. Fixes: 05aa61334592 ("drm: bridge: dw-mipi-dsi: Fix enable/disable of DSI controller") Signed-off-by: Marek Vasut --- Cc: Andrzej Hajda Cc: Biju Das Cc: Daniel Vetter Cc: David Airlie Cc: Douglas Anderson Cc: Jernej Skrabec Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Liu Ying Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Neil Armstrong Cc: Ondrej Jirman Cc: Rob Herring Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 824fb3c65742e..ca5894393dba4 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -268,7 +268,6 @@ struct dw_mipi_dsi { struct dw_mipi_dsi *master; /* dual-dsi master ptr */ struct dw_mipi_dsi *slave; /* dual-dsi slave ptr */ - struct drm_display_mode mode; const struct dw_mipi_dsi_plat_data *plat_data; }; @@ -1016,25 +1015,15 @@ static void dw_mipi_dsi_mode_set(struct dw_mipi_dsi *dsi, phy_ops->power_on(dsi->plat_data->priv_data); } -static void dw_mipi_dsi_bridge_atomic_pre_enable(struct drm_bridge *bridge, - struct drm_bridge_state *old_bridge_state) -{ - struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge); - - /* Power up the dsi ctl into a command mode */ - dw_mipi_dsi_mode_set(dsi, &dsi->mode); - if (dsi->slave) - dw_mipi_dsi_mode_set(dsi->slave, &dsi->mode); -} - static void dw_mipi_dsi_bridge_mode_set(struct drm_bridge *bridge, const struct drm_display_mode *mode, const struct drm_display_mode *adjusted_mode) { struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge); - /* Store the display mode for later use in pre_enable callback */ - drm_mode_copy(&dsi->mode, adjusted_mode); + dw_mipi_dsi_mode_set(dsi, adjusted_mode); + if (dsi->slave) + dw_mipi_dsi_mode_set(dsi->slave, adjusted_mode); } static void dw_mipi_dsi_bridge_atomic_enable(struct drm_bridge *bridge, @@ -1090,7 +1079,6 @@ static const struct drm_bridge_funcs dw_mipi_dsi_bridge_funcs = { .atomic_get_input_bus_fmts = dw_mipi_dsi_bridge_atomic_get_input_bus_fmts, .atomic_check = dw_mipi_dsi_bridge_atomic_check, .atomic_reset = drm_atomic_helper_bridge_reset, - .atomic_pre_enable = dw_mipi_dsi_bridge_atomic_pre_enable, .atomic_enable = dw_mipi_dsi_bridge_atomic_enable, .atomic_post_disable = dw_mipi_dsi_bridge_post_atomic_disable, .mode_set = dw_mipi_dsi_bridge_mode_set, -- 2.43.0