Received: by 10.213.65.68 with SMTP id h4csp2313665imn; Mon, 9 Apr 2018 01:03:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/ZoHyUboEMw9AmWEGFJABYvPpR4EtYadK6fdpjKJFSir1oZYJWe8ECLi3YcfVDnILenYjy X-Received: by 10.167.130.85 with SMTP id e21mr10138750pfn.86.1523261027860; Mon, 09 Apr 2018 01:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523261027; cv=none; d=google.com; s=arc-20160816; b=JKKWKPZiCGAr0XBlRjIH6T1wFacYyI7RNShVeu6XD5LoZllvZYOQcGpaxoauPkBpoa 9eLEAZqfAY2p7bKdg6tD9+ovW5/g9u+k+aSiU2aR3zAQdai6kRYR6US4LHt1dnmwE7A+ ZycuomVpL3j//1iBVqNSPDBCaPo5EzwSgKxNauZ2DEqIGFUwIo1IngNqqED/Mehx5n+H R4s/clgtJjtxEH+Kp2kG2Smo2HEN+3D3eFZ9Pvo1+WUAjxAMdvty3PKjyROusr2xCQSf 2suLodYwk1mbKkiSfi/LyLo6wR2jljpQ2QNziqvJZg2+1h4wnXrpyS/P6FrwlF1rMfX9 WmSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=i7dVO/NM4ct2XcA3V9GaJjMh8NSH1SgDWGvCjzrY6zs=; b=byg4ZRdQo5moWdR7XzDBUtHfQaZIpwxDQtTU8IbLpIpC/e/H2DiwoYAheXpqneOATf +T9L+8+u/GCqu5sBVAwTy59BN28rx4KLAvZhZMcg4QOWRNdsLoZa3Pg0rveJvdKnJvkb +ER37P6zvhCgbg6QR1UxnpF0zkhQgfMzzpM8OfN93CBJpebQ2NdUEOTedqB7BQP1Wp8K xCPnFK6I26PipIsbyhZOD9R88tecSZCVc1S9lBW+vmtei8If62zR3G7HDbfmL/Ht5RSI 5aiCUiVIHJY1x8P7rPc+0vIqV9WQGmKcuwYgOIjmpS3MwftmY9va2BIdtaovW844Ap7g GmjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=VDiCck3m; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1-v6si182457plo.88.2018.04.09.01.03.09; Mon, 09 Apr 2018 01:03:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=VDiCck3m; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751759AbeDIH4h (ORCPT + 99 others); Mon, 9 Apr 2018 03:56:37 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:37160 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbeDIH4g (ORCPT ); Mon, 9 Apr 2018 03:56:36 -0400 Received: by mail-wm0-f46.google.com with SMTP id r131so14558584wmb.2 for ; Mon, 09 Apr 2018 00:56:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=i7dVO/NM4ct2XcA3V9GaJjMh8NSH1SgDWGvCjzrY6zs=; b=VDiCck3mpCiRdQCUcBaag6GNOB4P6Pc5qUJPEsnVmk7y4ngpbci8XNFtwWk7vt0lUE hf6hTVVmY0xEAnH1/Js85odLu7hFO0/2Jn+yXbubkRSUdwUFiR5EkrXM8+3QtB5QZQ8M bRSlE3tRyluD/hrA/WOeaMfQipkxl/9mgmTqg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=i7dVO/NM4ct2XcA3V9GaJjMh8NSH1SgDWGvCjzrY6zs=; b=O2Ns4tYlzpY4DE3477WJjt8S05VnxGE5Sj2kVBQSy+ct+S/KYD8SDGHJtBpYgtX0VK mq4vAIxYQ5LmFT8XGlPxSRtDTQJdqIhYwxAXI9xLPxR3Ym1I6WzM+ik9gsVOpZr+I/RW RUBW/7Yj+MyyYSsAkhI9sbXxniiggcuraE1VhXoI8YsrqwKPygkvrEQ+0rDBnQr0DfeV uGMCDF1eI0RMa037rYwidigiEB4W3kvgoB6+IhGVdgCoaGfEUn/GMDlTG10StPBaWwAu qm6rB30QmluyfJgQZoA6F8v2P8hA6KsGLFyvqsRec812F5OSwS9knddkCEad3EVQjmg3 99dw== X-Gm-Message-State: ALQs6tCJQ0QkxpfcdAJnttvL1oQ3JmK94kfMdxk01NJPvx6jt1AFf6/x onkIlOIcbflQugLy0CSmHXIRAQ== X-Received: by 10.80.181.117 with SMTP id z50mr20632652edd.223.1523260595076; Mon, 09 Apr 2018 00:56:35 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5635:0:39d2:f87e:2033:9f6]) by smtp.gmail.com with ESMTPSA id a3sm25012edi.53.2018.04.09.00.56.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Apr 2018 00:56:34 -0700 (PDT) Date: Mon, 9 Apr 2018 09:56:32 +0200 From: Daniel Vetter To: Philippe CORNU Cc: Laurent Pinchart , David Airlie , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Yannick FERTRE , Daniel Vetter , Vincent ABRIOU Subject: Re: [PATCH] drm: clarify adjusted_mode for a bridge connected to a crtc Message-ID: <20180409075632.GC31310@phenom.ffwll.local> Mail-Followup-To: Philippe CORNU , Laurent Pinchart , David Airlie , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Yannick FERTRE , Daniel Vetter , Vincent ABRIOU References: <20180226121605.12050-1-philippe.cornu@st.com> <1765089.gI5krnOhAB@avalon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 4.15.0-1-amd64 User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 06, 2018 at 03:28:27PM +0000, Philippe CORNU wrote: > Hi Laurent, > > On 04/06/2018 04:53 PM, Laurent Pinchart wrote: > > Hi Philippe, > > > > Thank you for the patch. > > > > On Monday, 26 February 2018 14:16:04 EEST Philippe Cornu wrote: > >> This patch clarifies the adjusted_mode documentation > >> for a bridge directly connected to a crtc. > >> > >> Signed-off-by: Philippe Cornu > >> --- > >> This patch is linked to the discussion https://lkml.org/lkml/2018/1/25/367 > >> > >> include/drm/drm_bridge.h | 3 ++- > >> 1 file changed, 2 insertions(+), 1 deletion(-) > >> > >> diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h > >> index 3270fec46979..b5f3c070467c 100644 > >> --- a/include/drm/drm_bridge.h > >> +++ b/include/drm/drm_bridge.h > >> @@ -177,7 +177,8 @@ struct drm_bridge_funcs { > >> * pipeline has been called already. If the bridge is the first element > >> * then this would be &drm_encoder_helper_funcs.mode_set. The display > >> * pipe (i.e. clocks and timing signals) is off when this function is > >> - * called. > >> + * called. If the bridge is connected to the crtc, the adjusted_mode > >> + * parameter is the one defined in &drm_crtc_state.adjusted_mode. > > > > Unless I'm mistaken this will always be the mode stored in > > &drm_crtc_state.adjusted_mode (at least for atomic drivers), regardless of > > whether the bridge is the first in the chain (connected to the CRTC) or not. > > What is important to document is that we have a single adjusted_mode for the > > whole chain of bridges, and that it corresponds to the mode output by the CRTC > > for the first bridge. Bridges further in the chain can look at that mode, > > although there will probably be nothing of interest to them there. > > > > How about the following text ? > > > > /** > > * @mode_set: > > * > > * This callback should set the given mode on the bridge. It is called > > * after the @mode_set callback for the preceding element in the display > > * pipeline has been called already. If the bridge is the first element > > * then this would be &drm_encoder_helper_funcs.mode_set. The display > > * pipe (i.e. clocks and timing signals) is off when this function is > > * called. > > * > > * The adjusted_mode parameter corresponds to the mode output by the CRTC > > * for the first bridge in the chain. It can be different from the mode > > * parameter that contains the desired mode for the connector at the end > > * of the bridges chain, for instance when the first bridge in the chain > > * performs scaling. The adjusted mode is mostly useful for the first > > * bridge in the chain and is likely irrelevant for the other bridges. > > * > > * For atomic drivers the adjusted_mode is the mode stored in > > * &drm_crtc_state.adjusted_mode. > > * > > * NOTE: > > * > > * If a need arises to store and access modes adjusted for other locations > > * than the connection between the CRTC and the first bridge, the DRM > > * framework will have to be extended with DRM bridge states. > > */ > > > > Then I think we should also update the documentation of > > drm_crtc_state.adjusted_mode accordingly: > > > > /* > > * @adjusted_mode: > > * > > * Internal display timings which can be used by the driver to handle > > * differences between the mode requested by userspace in @mode and what > > * is actually programmed into the hardware. > > * > > * For drivers using drm_bridge, this store the hardware display timings > > * used between the CRTC and the first bridge. For other drivers, the > > * meaning of the adjusted_mode field is purely driver implementation > > * defined information, and will usually be used to store the hardware > > * display timings used between the CRTC and encoder blocks. > > */ > > > > Your proposal is very clear and understandable. I will make a new patch > version based on it. Just to avoid confusion: Needs to be a fully new patch on top of latest drm-misc-next, since no rebasing in a group maintained tree. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch