Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5510831rdb; Wed, 13 Dec 2023 10:38:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IGdsEDalyI+AE2UhW4lsZkEnJGMr6LpnWBEbk/5MP3BHJCEJnzn5qD2KYOeMEwDC0zVWj0S X-Received: by 2002:a05:6a20:6a08:b0:18b:826d:1e89 with SMTP id p8-20020a056a206a0800b0018b826d1e89mr9954243pzk.12.1702492687853; Wed, 13 Dec 2023 10:38:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702492687; cv=none; d=google.com; s=arc-20160816; b=ZwpqV8SRJ1U9MhjBU2nYq7gGLL1DYogCnE3Hj0R7qlkoBTRve5MRvSWpUMmpomfyqw XsFu0DCLs2IMIHfMfSikqw8/NvcjWvU7Omw0NKFgY7VePDffwKTwd36GSAZoC0nwjiEQ 6kkXnd11D08vnF4lPdlXNXoAz8et5igiGoc9ydt/4f7cnuQnNvKXByNr7BT5RjhJH4+q z/Z6a2Js/SSqBFs2RCL7QFAkcQC4649Mba1ycSeiP32UIhbNEhGF7wFUj9QHT7CrAYhX k6xJrO/1a3g4dX247Txy9tzRaEw0Iw/x6L4k5EUuK/yh5lXDTTftFpXzn8qAxpRjNko6 uemA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3CX2gA6r/dtvGkH0YEYWwI6mzbAd5lMyIJziHnyg55Q=; fh=m6aHy4GVWeiYcahcFfIzqNn3pzsQZUVlVWbThwuybpU=; b=NrvtRi0qB5rTREwI5YsZCL6gR00AORbyG5uar7dms7env7O148ejk3+ooK2PXtRsaF nFcHPv4Pw3UkxdzQOGnb8YLS/WH6Zoqr9dxrwdtquTybDboajfCtk7Lf/cneOWkNkmhM t3bTOuiU1q2pac/O6jjLK/nCWn21zBF/wWvjn9k/AJi1R/wolwAVeCn+BpS9VFi957ls KekdKqIR67kgP8tNkRsXHItPzCWlNNRLI0YPCSh/uUXL3ZPGLey8iFRPliNKa60Mcb2C rv0OI61uWgWZoV2mUZrgo5usOCO2XXvpf/rs7TfebrLhh5DBZH3fGSa5HLsGdw7j1rgT 0ttg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EUMycRy+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id p24-20020aa78618000000b006ce544ed22csi9788177pfn.128.2023.12.13.10.38.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 10:38:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EUMycRy+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0350482A3943; Wed, 13 Dec 2023 10:38:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233536AbjLMSho (ORCPT + 99 others); Wed, 13 Dec 2023 13:37:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233504AbjLMShm (ORCPT ); Wed, 13 Dec 2023 13:37:42 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00667AB for ; Wed, 13 Dec 2023 10:37:48 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40c60dfa5bfso292735e9.0 for ; Wed, 13 Dec 2023 10:37:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1702492667; x=1703097467; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3CX2gA6r/dtvGkH0YEYWwI6mzbAd5lMyIJziHnyg55Q=; b=EUMycRy+uCVdUqM2QNIk0/jxQorodOwwT9VEuRM9NWetk7twBQpDDZ0G32RUzQo3gh vcCN5afXuIjGOdYHGs5dYn0W7qR77g8e6aYwMyNd+NxOsjuupoBnxHMT2KExALohPyJV lcDNew8FcgrbLO7qRk1oIYZKZhdUaxgKxh/xU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702492667; x=1703097467; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3CX2gA6r/dtvGkH0YEYWwI6mzbAd5lMyIJziHnyg55Q=; b=Fb13m/BR59JDOq95Sx1xZLikLaAZ+twGzo2nJ31eyXZzUkp07c4nJJ1PaezQm7t13i XYJbzxE3CDmHv0o+0I8o3ZgYBuyEwe9YzyCJ54/dfVFOC6AIWFNTTQr9NImMoPk9Pt/M 3XKE/RFzbkBPtHw1/kbyYfb0a4YeHXQc0/67oDh97dyUnNrsgRvkFM0AwYQ1cIz12vl4 +/yYkxWuKq4qrdqwgPhZOQ3mrPhEcxhdQu/O13jfXGOSEnOL2wU3QTveWv7cSPVuN6Kq 2qK89OT0FJq1tasyjfRM2kb98rL1wWSXaNZFhR38mxH0h5JKO78cvqXEX5pAzLNFl+S6 956g== X-Gm-Message-State: AOJu0YxmiXjRCNLbmRWxvnAeONvnYfbdVnNXUu+NKCfJt1/gB8bS4duh gCviF0T/ho8rdtvCPdVWs/ttcWM1gQiRgpG1etb4MQ== X-Received: by 2002:a7b:c3d5:0:b0:40c:3774:8ae9 with SMTP id t21-20020a7bc3d5000000b0040c37748ae9mr4703544wmj.7.1702492667147; Wed, 13 Dec 2023 10:37:47 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-80-182-13-188.pool80182.interbusiness.it. [80.182.13.188]) by smtp.gmail.com with ESMTPSA id rd12-20020a170907a28c00b00a11b2677acbsm8152775ejc.163.2023.12.13.10.37.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 10:37:46 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi , Andrzej Hajda , Daniel Vetter , David Airlie , Inki Dae , Jagan Teki , Jernej Skrabec , Jonas Karlman , Laurent Pinchart , Maarten Lankhorst , Marek Szyprowski , Maxime Ripard , Neil Armstrong , Robert Foss , Thomas Zimmermann , dri-devel@lists.freedesktop.org Subject: [PATCH v7 1/3] drm: bridge: samsung-dsim: enter display mode in the enable() callback Date: Wed, 13 Dec 2023 19:37:10 +0100 Message-ID: <20231213183737.4182996-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231213183737.4182996-1-dario.binacchi@amarulasolutions.com> References: <20231213183737.4182996-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 13 Dec 2023 10:38:03 -0800 (PST) The synaptics-r63353 (panel-bridge) can only be configured in command mode. So, samsung-dsim (bridge) must not be in display mode during the prepare()/unprepare() of the panel-bridge. Setting the "pre_enable_prev_first" flag to true allows the prepare() of the panel-bridge to be called between the pre_enabled() and enabled() of the bridge. So, the bridge can enter display mode only in the enabled(). The unprepare() of the panel-bridge is instead called between the disable() and post_disable() of the bridge. So, the disable() must exit the display mode (i .e. enter command mode) to allow the panel-bridge to receive DSI commands. samsung_dsim_atomic_pre_enable -> command mode r63353_panel_prepare -> send DSI commands samsung_dsim_atomic_enable -> enter display mode samsung_dsim_atomic_disable -> exit display mode (command mode) r63353_panel_unprepare -> send DSI commands samsung_dsim_atomic_post_disable Co-developed-by: Michael Trimarchi Signed-off-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- (no changes since v1) drivers/gpu/drm/bridge/samsung-dsim.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index be5914caa17d..15bf05b2bbe4 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1494,7 +1494,6 @@ static void samsung_dsim_atomic_pre_enable(struct drm_bridge *bridge, return; samsung_dsim_set_display_mode(dsi); - samsung_dsim_set_display_enable(dsi, true); } } @@ -1507,6 +1506,7 @@ static void samsung_dsim_atomic_enable(struct drm_bridge *bridge, samsung_dsim_set_display_mode(dsi); samsung_dsim_set_display_enable(dsi, true); } else { + samsung_dsim_set_display_enable(dsi, true); samsung_dsim_set_stop_state(dsi, false); } @@ -1524,6 +1524,8 @@ static void samsung_dsim_atomic_disable(struct drm_bridge *bridge, if (!samsung_dsim_hw_is_exynos(dsi->plat_data->hw_type)) samsung_dsim_set_stop_state(dsi, true); + samsung_dsim_set_display_enable(dsi, false); + dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE; } @@ -1532,7 +1534,8 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, { struct samsung_dsim *dsi = bridge_to_dsi(bridge); - samsung_dsim_set_display_enable(dsi, false); + if (!samsung_dsim_hw_is_exynos(dsi->plat_data->hw_type)) + samsung_dsim_set_stop_state(dsi, true); dsi->state &= ~DSIM_STATE_ENABLED; pm_runtime_put_sync(dsi->dev); -- 2.43.0