Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3183041rdh; Mon, 27 Nov 2023 08:07:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IHaF687TPo+ymQoAqoIx2cfA3A9NYCDqdiF9LrSAYwBQufAOEbqQ3X/9qdX4u09XJRR1c8M X-Received: by 2002:a05:6808:4cc:b0:3b8:3a9d:7ef4 with SMTP id a12-20020a05680804cc00b003b83a9d7ef4mr12383603oie.55.1701101257922; Mon, 27 Nov 2023 08:07:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701101257; cv=none; d=google.com; s=arc-20160816; b=qs+OwNWBFZ+8YgN6KMO6vRUnsPDlrxnp9sdIo6Hze5UluJBwg0B5L0iBaimuLwoKO+ Bzx2HPlKAIDEA/4LZ3DoZC+MzGSAb5Hw/wVhtfQn7m0vdrc58S2wSGxELkebhaM5pT+Y u8Hr56/RIXmj7b33tbxWdrBAbtKhCppyTulJt+8nbbYlU56BhjBNqTf58g3OUQRzVz/B Phk/KgCh37JWJ2OjtFnoKj9J9FdZYZ2Evh9jwqYKPt+/Lphmr7pJuj+Tv9ndEYDuLUJb XOhewFKrmCvXe4ahwuyx25pyZyVFQwtrsovStGn2TUtPZT7RJ8DKVv+7bqw/v6mu3toj juHg== 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=Y7wBufIKQMhLp63SLVHsf17Z6swtXqpafnQRnbbLmY8=; fh=/ncskDtRVjyl5B6jfyM6OulPnR6L2qhjF3e2BIj3i+Q=; b=jA21m65Nwuxla79VqcGXLWYUCRCQqAzzG0/B1Z7m7HobpCisVHyPXjQLEjMfKN7DYH 9q4lY56o50i+4Dz+hsO6jkJqE+4iz0tFzkq21I+SjlVPEUlRlmbg9YHiIxktxIIOH5jr vVHVRgfDVIIJXxLVL6A+aB1pchADElwf/nS2FuWcZqRpvfBIcMKGBoUzcoeMhZN3sSnx CS4vu/or99vPWuNRVFYuptOmO21wg3Ne6+1JBQ5qTSuDcmIqsEc0rl+WlCKcZu4JrTvE 7AyJ9znWf7w1kiAXp3yyQzc9SAeoSAlrl5EljtZy5NUb5yS8F/SLgu1Z3GyWaThvDOg7 BWAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=neC+N+L8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id s11-20020a05680810cb00b003b8488c6322si1783723ois.154.2023.11.27.08.07.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 08:07:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=neC+N+L8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id CE1568079335; Mon, 27 Nov 2023 08:07:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234297AbjK0QHL (ORCPT + 99 others); Mon, 27 Nov 2023 11:07:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234282AbjK0QHK (ORCPT ); Mon, 27 Nov 2023 11:07:10 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF11BBF for ; Mon, 27 Nov 2023 08:07:16 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 071E7C433C8; Mon, 27 Nov 2023 16:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701101236; bh=CAVT3JTOqdhtMpmyz9hZHgwDT59aK+uHYtnwfXlCXjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=neC+N+L85KemwluYfyC3P9D8ihbrOkVoCvJ1GV+ZCiqo+YeGQ+HY4hTVBV3Lgst1c 9cRWM9QUolfeC7sLFu6CjfnGHEDCD91cdhkG28ea4OXjfhYrvhX5ZHfsYnRlg6ZUiA k5CiTAic0qf0jfdGSnB0j/vVsSAOKia85mq/DgzEfOhmXZMDihTqw1oFDrM9Z5aHch ky2TtMRPtTg3TjuAT89xXCSoa61vxHGKzsrk1bl/q17DIUsoctaErgIcTVn0Dsc2IP dh+C+nnHqZTChSA4mHWgVcFt7UPRn6r2KKG0p0K8s/8KfvDTrB8/EIIjr5+uu8DELK fnKjh5PjHfbmw== From: Michael Walle To: dmitry.baryshkov@linaro.org Cc: 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, Michael Walle Subject: Re: [RFC PATCH 03/10] drm/mipi-dsi: add API for manual control over the DSI link power state Date: Mon, 27 Nov 2023 17:06:58 +0100 Message-Id: <20231127160658.2164612-1-mwalle@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 27 Nov 2023 08:07:33 -0800 (PST) Hi, > 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? 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