Received: by 10.213.65.68 with SMTP id h4csp725033imn; Fri, 6 Apr 2018 07:54:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+hlE4gELuYYxmykmHFWf6JxVZLGp6rt398wCXhJ0stmyZDkZJ+UZgHZbZZiaBDe54T+BzF X-Received: by 2002:a17:902:7785:: with SMTP id o5-v6mr25870736pll.356.1523026488885; Fri, 06 Apr 2018 07:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523026488; cv=none; d=google.com; s=arc-20160816; b=dV0qxxOME/AvfQzPc7nAhOuON3zToEK9DsweGPAQlneahgTObYCFCM+jCAqLczXNk6 I5TQMqJl/7LOdiaStYXP3k0ZULR+Cke9qy9DRSMFnDbb/qqrb08A9Yzq3O4m4dZq2OiJ 57DGGmGNds9ZU3rhQqzFnllfEg9Ev6xwKAVL9wwDtow+6skK9AhTNeno9RaLAUEuUwrz NGiekh/Xjo8ngPWCauzh3dhg2FYNl0pnwmmHB/OmCXj6NTpI+VgdYQ1tV9GqxxXqGHPF FejfWi8AD5qNTObw62LI7CfoOSFlUoum2P6HIR+MDbJ0tw9pQCRHI5owAq1HxRvQYWGt XUdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=cviGs9K5w7Kj3t+5rEkGsa+CQVfDAt1Zk/aCqDdB0UE=; b=J5eH6QWZeUupAz/7lAOY97nqaA4gXAEQuQPHOqhNWzVTFo9Faxp8zxy6/0j9Fwxexg OjEXjh/q8JTE6i+hxR2vUdruey6G8L02dV9hcdtn5BO3IY64E2RYVqe3o5baL9fnRSDb zotfJsdW9tF4eQOfvHmoek9ZdDi5yiqq4hDURl/YWXqjOIGrZbga3tqFd6TtbhDHrzqR HmZGG//fKO5E75Y50YeBVsGW2iqEkwrgGgUhoWOIMht/GFQRT8/FnvT5s8R4+IcwB5HB wSzbJB5JHZXPWpMTToZzxKr1zmYi9BfZ/jlwam+Urz3Tz8IRWlbwge9ED1OegKybHUkV yYzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=uofJX9il; 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 64-v6si8183074ply.528.2018.04.06.07.54.34; Fri, 06 Apr 2018 07:54:48 -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=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=uofJX9il; 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 S1755477AbeDFOxQ (ORCPT + 99 others); Fri, 6 Apr 2018 10:53:16 -0400 Received: from galahad.ideasonboard.com ([185.26.127.97]:35290 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755415AbeDFOxM (ORCPT ); Fri, 6 Apr 2018 10:53:12 -0400 Received: from avalon.localnet (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id 50F0020124; Fri, 6 Apr 2018 16:50:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1523026239; bh=mfSq4LQS8mu0jrKlqavYIBGMTMfeSN29lQ7Gu6Azcrs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uofJX9ilI3wi4p9/rACcyWpqQkw1gI0vg3QevXjHC9X0HyGLyS3fNDOZcMPsKhUGm 07B0ok2ZmKhyFyqYRTkb9G9iswgeWKliJnHOFA8z9A2fa89+1xjD70JQCHu6Q1dGM8 Qm11rsIfafSTCXyde0jny0HVmg+vuKqD+NvjMgys= From: Laurent Pinchart To: Philippe Cornu Cc: Daniel Vetter , Gustavo Padovan , Maarten Lankhorst , Sean Paul , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Benjamin Gaignard , Yannick Fertre , Vincent Abriou Subject: Re: [PATCH] drm: clarify adjusted_mode for a bridge connected to a crtc Date: Fri, 06 Apr 2018 17:53:09 +0300 Message-ID: <1765089.gI5krnOhAB@avalon> Organization: Ideas on Board Oy In-Reply-To: <20180226121605.12050-1-philippe.cornu@st.com> References: <20180226121605.12050-1-philippe.cornu@st.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. */ -- Regards, Laurent Pinchart