Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1082394rda; Mon, 23 Oct 2023 01:41:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEiXYVeHaYXMvJA+uwvbj3MJBSq1lzzd2tE+z6q0PeenF0CVJWVFORVJWsLua1JDQaVnHF3 X-Received: by 2002:a05:6a20:8f05:b0:161:aef5:6395 with SMTP id b5-20020a056a208f0500b00161aef56395mr11256153pzk.24.1698050477839; Mon, 23 Oct 2023 01:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698050477; cv=none; d=google.com; s=arc-20160816; b=NUcBbYH8gmxzzQxPbL6TILt/AYe5jkn8QKsv5LeHInHs/p2wF4c6sDQus939EmoAqu D4OqtSWiRuqQFj3jU17PX/Zfvi4G80zqZOWswPFV+P2go8rGu0/WAR45M5y1+ZVWpYyy 7rRdHakOaRVSMbRjqFyUzgW9C1oO4rXv/HuGOrVLzxV3sfmrxuzWSKvWd5IRjY7+VzZ8 lyvFtuQV8xG05QYURk9KDwDKdvJurYcOkIxBEqo2bPm5Ph+iN5ERfCtnvLsulkSLn9jI G/ouxMrMSL3BBQyn2TgUhsV/0P2JLOJpzggj/K3/Ce1xoBrl58tokI5LJiv0CMpH3a0j HBVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=jaL68/qeer0rqmvgi8CDg0bYTQpez2jRXyNtczwGTGY=; fh=TWvUNSILGPUIfXqqi1KM0HkZnrDM0WNHXD62wje5o7I=; b=PcIDmV62Qa+nCIYkTuQDuAbBOYk+idUD3dauG4UUQUzG6OqesrKrB6ZBh/XvjwyzEj PZPBAlYNo0w/TJ/W2GB0l+xzKgAhXGFOr01EpN3FWGa7OuGWfo1rqqqTFHeFuNYwVvUs Lzppy4Bsb3J92lTQhWnLUgYC0dFPDDi3NgWCXK32HyNgbkNzu8bj4rh1D+7TYOtkFNo6 mKVPCUF33H35k6NbLsGvNoH9Ohncp2vkIeHDGwpeJ2m/w0hI+GdpVz3bDVq1UucvDU+E 5b28/nAnbRsMniWCpMhIK+polVXcJ1gzrJI1O5mDajCIHLq9vP0f4EwANqXga/PUUtUF /foA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Jny/V4Uo"; 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=linaro.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id r37-20020a632065000000b005638179cecasi5921265pgm.833.2023.10.23.01.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 01:41:17 -0700 (PDT) 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=@linaro.org header.s=google header.b="Jny/V4Uo"; 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=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 6F1F9807C5C5; Mon, 23 Oct 2023 01:41:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229498AbjJWIk5 (ORCPT + 99 others); Mon, 23 Oct 2023 04:40:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229513AbjJWIk4 (ORCPT ); Mon, 23 Oct 2023 04:40:56 -0400 Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 203C9DD for ; Mon, 23 Oct 2023 01:40:54 -0700 (PDT) Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-5a877e0f0d8so32516647b3.1 for ; Mon, 23 Oct 2023 01:40:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698050453; x=1698655253; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=jaL68/qeer0rqmvgi8CDg0bYTQpez2jRXyNtczwGTGY=; b=Jny/V4UoH7SF3JDIHj7MqWIKiwOqRhCGexce7aV4xy3KzRlaKj5eknJuN/HK3+PlKK GGyvmtVzq14jzCwg1SzOJgg2ESPBXi5PTs5mBlzJ5p2wRrCdALTeJYsR2kefIWZRjQNE lsKKZYu0aZeiCOlg9SEMmCGkfz84ExBZAJrcVIzDHCLn0t8tLu1gPbvv+q/16xzeEWBw kkt0WPGNjbriX/gAikju93pQm6sVbLM6ICjLWN3a5aZyte+M7e0j0b+JGVT2wmOanuTH dpsqIldsg9TUdyuRH19LAXmD5dfO1QLliZ9JmCoJWIuMSL23ygHl3Ut6CiJvDsPwbEY0 3fDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698050453; x=1698655253; h=content-transfer-encoding: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=jaL68/qeer0rqmvgi8CDg0bYTQpez2jRXyNtczwGTGY=; b=BlcQqc+gOb18epf03l8D0+crtxKTRIrkA1cN+ts09weLy117e7ZP4mBJIEHwrVpotR P7sJoYezCDOQBInlm+rZwy7COFZk7w1HXfuh88W7wj3czwIo+53I00idvaHWgGL/sb1j CKkig7RWfcAgUmLYswf0u882YL0jUkNSh5/MUb3p6vSMLoTBhqRfjtSPwGZBihGX03Jq yiMLveyw+DxtZSS+48Zq9Ju9QJKac+OBerQl+/h9qVQyIyPo9n5bC6hP+GxRyrHwEeoK 5wD6joCgj99hHFncWl1XgeebSqiu/0aXns6hcOjT+rB88JQkA0HPTp8H0eiS94qsLqJ2 geNA== X-Gm-Message-State: AOJu0YzvXjtqDN5cYE0IcWOMCtcCVf6WIoaKZpt5u9nT21Ab4526pt+g mlFzi7z+SoBKUlB0XcuV3jolFTDypVOwOAQ9+sDAvg== X-Received: by 2002:a0d:d6c2:0:b0:5a7:fcad:e865 with SMTP id y185-20020a0dd6c2000000b005a7fcade865mr11281424ywd.2.1698050453310; Mon, 23 Oct 2023 01:40:53 -0700 (PDT) MIME-Version: 1.0 References: <20231016165355.1327217-1-dmitry.baryshkov@linaro.org> <1871104.tdWV9SEqCh@steina-w> <3266380.44csPzL39Z@steina-w> In-Reply-To: <3266380.44csPzL39Z@steina-w> From: Dmitry Baryshkov Date: Mon, 23 Oct 2023 11:40:42 +0300 Message-ID: Subject: Re: [RFC PATCH 03/10] drm/mipi-dsi: add API for manual control over the DSI link power state To: Alexander Stein Cc: Maxime Ripard , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Andrzej Hajda , Marijn Suijten , Marek Vasut , Robert Foss , Dave Stevenson , Jernej Skrabec , Jessica Zhang , Jonas Karlman , linux-arm-msm@vger.kernel.org, Abhinav Kumar , Sean Paul , Neil Armstrong , Douglas Anderson , Konrad Dybcio , Thomas Zimmermann , freedreno@lists.freedesktop.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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, 23 Oct 2023 01:41:14 -0700 (PDT) On Mon, 23 Oct 2023 at 11:14, Alexander Stein wrote: > > Am Montag, 23. Oktober 2023, 09:34:42 CEST schrieb Dmitry Baryshkov: > > On Mon, 23 Oct 2023 at 09:52, Alexander Stein > > > > wrote: > > > Hi Dmitry, > > > > > > Am Sonntag, 22. Oktober 2023, 12:49:41 CEST schrieb Dmitry Baryshkov: > > > > On Thu, 19 Oct 2023 at 14:42, Alexander Stein > > > > > > > > wrote: > > > > > Hi, > > > > > > > > > > Am Donnerstag, 19. Oktober 2023, 13:19:51 CEST schrieb Dmitry > Baryshkov: > > > > > > On Thu, 19 Oct 2023 at 12:26, Maxime Ripard > wrote: > > > > > > > On Mon, Oct 16, 2023 at 07:53:48PM +0300, Dmitry Baryshkov wr= ote: > > > > > > > > The MIPI DSI links do not fully fall into the DRM callbacks > > > > > > > > model. > > > > > > > > > > > > > > Explaining why would help > > > > > > > > > > > > A kind of explanation comes afterwards, but probably I should c= hange > > > > > > the order of the phrases and expand it: > > > > > > > > > > > > The atomic_pre_enable / atomic_enable and correspondingly > > > > > > atomic_disable / atomic_post_disable expect that the bridge lin= ks > > > > > > follow a simple paradigm: either it is off, or it is on and > > > > > > streaming > > > > > > video. Thus, it is fine to just enable the link at the enable t= ime, > > > > > > doing some preparations during the pre_enable. > > > > > > > > > > > > But then it causes several issues with DSI. First, some of the = DSI > > > > > > bridges and most of the DSI panels would like to send commands = over > > > > > > the DSI link to setup the device. Next, some of the DSI hosts h= ave > > > > > > limitations on sending the commands. The proverbial sunxi DSI h= ost > > > > > > can > > > > > > not send DSI commands after the video stream has started. Thus = most > > > > > > of > > > > > > the panels have opted to send all DSI commands from pre_enable = (or > > > > > > prepare) callback (before the video stream has started). > > > > > > > > > > > > However this leaves no good place for the DSI host to power up = the > > > > > > DSI > > > > > > link. By default the host's pre_enable callback is called after= the > > > > > > DSI bridge's pre_enable. For quite some time we were powering u= p the > > > > > > DSI link from mode_set. This doesn't look fully correct. And al= so we > > > > > > got into the issue with ps8640 bridge, which requires for the D= SI > > > > > > link > > > > > > to be quiet / unpowered at the bridge's reset time. > > > > > > > > > > There are also bridges (e.g. tc358767) which require DSI-LP11 upo= n > > > > > bridge > > > > > reset. And additionally this DSI-(e)DP bridge requires LP11 while > > > > > accessing > > > > > DP-AUX channel, e.g. reading EDID. So bridges need at least some > > > > > control > > > > > over DSI line state. > > > > > > > > For sending commands in LP11 it is typical to toggle the > > > > MIPI_DSI_MODE_LPM flag, for example see panel-=3Djdi-lt070me05000.c= or > > > > some other drives. It might be a good idea to make that more explic= it. > > > > All suggestions here would be appreciated. > > > > > > The biggest difference between that display and the tc358767 bridge i= s > > > that > > > the display uses DSI commands, while the bridge is using i2c transfer= to > > > issue DP-AUX commands. There is no host_transfer [1] which would enab= le > > > LP-11. It seems this DSI-DP bridge requires LP-11/HS on DSI lanes all > > > times. This contradicts current Linux behaviour. > > > > I see. I took a quick glance at the driver. Does the device mark AUX > > as busy when there is a HS transfer? > > Because otherwise it might be pretty hard to synchronise DP-AUX > > transfers with the DSI link state. We might need to add an API for > > this, if the DSI hosts actually can signal the blanking / DSI LP. > > I don't see that a synchronization would be required. AUX should be > independent from DSI transfers. ASFAICS the bridge internals just require= s DSI > lines to be LP-00 or HS for AUX channel to be functioning. Ah, LP or HS. Then it should be fine. I probably misread your original email. I thought that AUX transfers work only in the LP mode. > > > > > Side note: the driver needs some care. It doesn't support the aux-bus > > bindings for eDP panels, it doesn't support other bridges on top of DP > > connectors (but there can be e..g. dp-connector device). > > I don't think that this is necessary as you add an optional endpoint to p= ort2 > which will then add an eDP display panel bridge. This should then handle = aux- > bus bindings. Not quite, see Documentation/devicetree/bindings/display/dp-aux-bus.yaml and devm_of_dp_aux_populate_bus(). It is expected that eDP panels are to be placed under the edp_bridge / aux-bus device node. But this is a separate topic, I just wanted to point out other missing pieces. > > Best regards, > Alexander > > > > Best regards, > > > Alexander > > > > > > [1] > > > https://www.kernel.org/doc/html/latest/gpu/drm-kms-helpers.html#mipi-= dsi-> > bridge-operation > > > -- > TQ-Systems GmbH | M=C3=BChlstra=C3=9Fe 2, Gut Delling | 82229 Seefeld, Ge= rmany > Amtsgericht M=C3=BCnchen, HRB 105018 > Gesch=C3=A4ftsf=C3=BChrer: Detlef Schneider, R=C3=BCdiger Stahl, Stefan S= chneider > http://www.tq-group.com/ > > --=20 With best wishes Dmitry