Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4121181rdh; Tue, 28 Nov 2023 12:23:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMtrQCl9bgTbD5UZWNshtSYst+G/jVw5Xr6Gz8z6G2XUGwXIp+VSBAYPUlVrTtgCuq3RRH X-Received: by 2002:a05:6830:2b14:b0:6d8:16f4:d303 with SMTP id l20-20020a0568302b1400b006d816f4d303mr15579867otv.27.1701203013850; Tue, 28 Nov 2023 12:23:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701203013; cv=none; d=google.com; s=arc-20160816; b=PwaP8OlS9W82EuQCVpEOpalXSDQudTPCxH6a6E9hT9wWNwA531FP/IJ0w2hMGV4Wk8 v/BvE/upZCPcD4UAdTDIpmCzgZWUKc+NsHBUJ4XwyPHAcn8ils94whKOLCwbj2b5Kn37 AZ23xysWC+c81Q9SRI69e9RakwktxJa7fX6tIG7tlFkuYAPsD3tpVbdh4qZ2fanLclNm rdvZ+xtZJ5d1dFYSw+ixK58iPWBy5TT6Ni1ZGImcq1+126RADHVkEywEfQkw+f2f59qE lKF9U3CFbP9f4AEwm+4VPEza3gaHT3iESGvgj2yq6kIalbB6hsbph7LLIb0LcTyE97Sz yWjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+BgGK1++XliXcG/Z+XxDuJiyYM8L9NZn4eXTDAvgifM=; fh=Gzb2h9KQzEyLYB0k9LvJNtnjgCUToZdceFwykSb4bew=; b=b81ppjoFZUUffczT1YKkyB1H0LMu0hnwVjW8QijJN+kbnWvH011QMqUt2Wo8Oca3eh rxUNjhSvDPHgioSXnn3RHxfKnkoGC8KWd5+0oXSbXaatZZHjooYXvd3mgzwNk7Ak2a9h 9fxcap/BsnZ/we9I7lqKXO9qoXEJmbEpksbCdl8rm1If3NRunwoacBEPud+TmW4J9uvX y96ouwzNlm1yM94+RUS9H97L2S74QIrhoqetksX/sqMAm2J2Fkb4hnlG6PSCGQqIAeU0 t72AF9H85F/5H2TdJaxFQVWf8ZoT0MqXPxKLCJLkE1nI2XcpJIaZRqxbsI2UBcbMQXv7 K2lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NxCFv1Nh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id g23-20020a63f417000000b005c1b59032b5si12202272pgi.453.2023.11.28.12.23.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 12:23:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NxCFv1Nh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5E6778072807; Tue, 28 Nov 2023 12:23:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344444AbjK1UXW (ORCPT + 99 others); Tue, 28 Nov 2023 15:23:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbjK1UXV (ORCPT ); Tue, 28 Nov 2023 15:23:21 -0500 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68F2093 for ; Tue, 28 Nov 2023 12:23:27 -0800 (PST) Received: by mail-yb1-xb2e.google.com with SMTP id 3f1490d57ef6-da077db5145so5441350276.0 for ; Tue, 28 Nov 2023 12:23:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701203006; x=1701807806; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+BgGK1++XliXcG/Z+XxDuJiyYM8L9NZn4eXTDAvgifM=; b=NxCFv1NhjDcDSdXkDsNDR3Hg5AnTCUONzhHtRFk7ngfbEiXu2qNZL3gWsT2saO/hJe GY5+zwbM+TKvgTeQ2sk8Qki8MvYsWzs5P6nO/YxjrsMG6B0OuxTuy9XsXibozrpO1tpl t+ccqtKd4nrIGeQYB9wolzQGFq3nbeEuUUZhO33CZ1IfwGOH4iwzHnUPeRAAzb1B0QW6 iY0IV0leEycu6XQ7L1h7PJexmPm8PH7g/6QjDytHCvvu+qwVFaCa50VqjmBSY/Qc/6g8 lCAeLSa3mtPLak7QaCLEfd1PqgE9WmO0DXF6HVIHydBVKoBkfR5/PfOgiY4P6UzZ9oG/ 1eNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701203006; x=1701807806; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+BgGK1++XliXcG/Z+XxDuJiyYM8L9NZn4eXTDAvgifM=; b=LjlpiO2mH+o2HwaXYdzCLIUVUVzaQE+xiLryF+Wg7wc2ihhFZTTo3l0rcB9a97Cqf0 30QY3OFxRwGh5e/KkVR8z4ZFwd4W5Xej7ff/iHKnd+fNGzOK2SKM9gCfzDly1ODlp5cK B5zjpV7+Ss9ncNuOzn7c+LclyiAA3riV6ukc9HjbU7T2rda4Vu59G2t9V7N+tB6y9Vnk UhELncWbtRDkrTq8jOUVgIzZ4kPayct2HBGJJ3sU4hqMVi+r/ZRqG8RC6L6mf7M20jvp iOJpIQr951keUxj9PWvZzEhCtDybQ9O1Rh95rctOF6KiR9ZVRTx36UicEuGD+CQE5pQj 5VcA== X-Gm-Message-State: AOJu0YwoF3jIl+aRmotMl8nPvXqkdO5/QX+mc/znLXuG8vZyhK+1yx4J hqnWaAc6xD8S65dp9jKP1IE4ycId4bc9nusxhi7Ugw== X-Received: by 2002:a25:fc22:0:b0:d9a:618a:d727 with SMTP id v34-20020a25fc22000000b00d9a618ad727mr14689953ybd.41.1701203006568; Tue, 28 Nov 2023 12:23:26 -0800 (PST) MIME-Version: 1.0 References: <20231127160658.2164612-1-mwalle@kernel.org> <14D9F495-425D-47FA-AD0D-F7299285936F@walle.cc> In-Reply-To: <14D9F495-425D-47FA-AD0D-F7299285936F@walle.cc> From: Dmitry Baryshkov Date: Tue, 28 Nov 2023 22:23:15 +0200 Message-ID: Subject: Re: [RFC PATCH 03/10] drm/mipi-dsi: add API for manual control over the DSI link power state To: Michael Walle Cc: Michael Walle , Laurent.pinchart@ideasonboard.com, andrzej.hajda@intel.com, dave.stevenson@raspberrypi.com, dianders@chromium.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, jernej.skrabec@gmail.com, jonas@kwiboo.se, konrad.dybcio@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, marex@denx.de, marijn.suijten@somainline.org, mripard@kernel.org, neil.armstrong@linaro.org, quic_abhinavk@quicinc.com, quic_jesszhan@quicinc.com, rfoss@kernel.org, sean@poorly.run, tzimmermann@suse.de, tony@atomide.com, alexander.stein@ew.tq-group.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 28 Nov 2023 12:23:32 -0800 (PST) On Tue, 28 Nov 2023 at 21:50, Michael Walle wrote: > > >> >> > DSI device lifetime has three different stages: > >> >> > 1. before the DSI link being powered up and clocking, > >> >> > 2. when the DSI link is in LP state (for the purpose of this question, > >> >> > this is the time between the DSI link being powered up and the video > >> >> > stream start) > >> >> > 3. when the DSI link is in HS state (while streaming the video). > >> >> > >> >> It's not clear to me what (2) is. What is the state of the clock and > >> >> data lanes? > >> > > >> > Clk an Data0 should be in the LP mode, ready for LP Data Transfer. > >> > >> Then this is somehow missing > >> https://docs.kernel.org/gpu/drm-kms-helpers.html#mipi-dsi-bridge-operation > >> > >> A DSI host should keep the PHY powered down until the pre_enable > >> operation > >> is called. All lanes are in an undefined idle state up to this point, > >> and > >> it must not be assumed that it is LP-11. pre_enable should initialise > >> the > >> PHY, set the data lanes to LP-11, and the clock lane to either LP-11 > >> or HS > >> depending on the mode_flag MIPI_DSI_CLOCK_NON_CONTINUOUS. > >> > >> So I don't think these three states are sufficient, see below, that > >> there > >> should be at least four. > > > >Which one is #4? > > enabled clock lane (HS mode), data lanes in LP-11 What is the purpose of such a mode? > > -michael > > >> > >> > > >> > I don't think we support ULPS currently. > >> > > >> > > >> >> > >> >> I'm facing similar issues with the tc358775 bridge. This bridge needs > >> >> to release its reset while both clock and data lanes are in LP-11 > >> >> mode. > >> >> But then it needs to be configured (via I2C) while the clock lane is > >> >> in enabled (HS mode), but the data lanes are still in LP-11 mode. > >> >> > >> >> To me it looks like there is a fouth case then: > >> >> 1. unpowered > >> >> 2. DSI clock and data are in LP-11 > >> >> 3. DSI clock is in HS and data are in LP-11 > >> >> 4. DSI clock is in HS and data is in HS > >> >> > >> >> (And of course the bridge needs continuous clock mode). > >> >> > >> >> > Different DSI bridges have different requirements with respect to the > >> >> > code being executed at stages 1 and 2. For example several DSI-to-eDP > >> >> > bridges (ps8640, tc358767 require for the link to be quiet during > >> >> > reset time. > >> >> > The DSI-controlled bridges and DSI panels need to send some commands > >> >> > in stage 2, before starting up video > >> >> > > >> >> > In the DRM subsystem stage 3 naturally maps to the > >> >> > drm_bridge_funcs::enable, stage 1 also naturally maps to the > >> >> > drm_bridge_funcs::pre_enable. Stage 2 doesn't have its own place in > >> >> > the DRM call chain. > >> >> > Earlier we attempted to solve that using the pre_enable_prev_first, > >> >> > which remapped pre-enable callback execution order. However it has led > >> >> > us to the two issues. First, at the DSI host driver we do not know > >> >> > whether the panel / bridge were updated to use pre_enable_prev_first > >> >> > or not. Second, if the bridge has to perform steps during both stages > >> >> > 1 and 2, it can not do that. > >> >> > > >> >> > I'm trying to find a way to express the difference between stages 1 > >> >> > and 2 in the generic code, so that we do not to worry about particular > >> >> > DSI host and DSI bridge / panel peculiarities when implementing the > >> >> > DSI host and/or DSI panel driver. > >> >> > >> >> For now, I have a rather hacky ".dsi_lp11_notify" callback in > >> >> drm_bridge_funcs which is supposed to be called by the DSI host while > >> >> the > >> >> clock and data lanes are in LP-11 mode. But that is rather an RFC and > >> >> me > >> >> needing something to get the driver for this bridge working. Because > >> >> it's > >> >> badly broken. FWIW, you can find my work-in-progress patches at > >> >> https://github.com/mwalle/linux/tree/feature-tc358775-fixes > >> >> > >> >> -michael > >> >> > >> > > >> > > >> > -- > >> > With best wishes > >> > Dmitry > > > > > > > -- With best wishes Dmitry