Received: by 10.213.65.68 with SMTP id h4csp2755093imn; Mon, 9 Apr 2018 08:31:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx49nliFY6PZ9VOB0Nex2MVFlUo9gdI8hXEirllK4BmlVlmW/rSCcIp4Pc4CrdXs6oa9FSbee X-Received: by 10.101.102.196 with SMTP id c4mr15312880pgw.146.1523287890295; Mon, 09 Apr 2018 08:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523287890; cv=none; d=google.com; s=arc-20160816; b=ktfpcUT15CS1md9bwF7gp+pFe2YQzvFmi+sQeCH7ZUw//uT6GY3uSLNBLFof0+P+Bd QhQfGMsWjAWDWBWRX1GSrhOESK0lmoqTj/Qesxpepema2X27HXeQsXgBiu2FEZOIJNZQ +vgeKDRHg4ZPjAh58303ulOYbTI5T1GeSPJbsxT5UeHssCocvtRVIr3MvNE6sagLhyP2 tWuP4mBUFnxO2Is2kxn5T5UxHHXNn+21wDsAiQTOlV+pAq0BIkAKqifhS2NY3cTf0prY iQRirYTlK1rSzWQiil2qZip3Wvu2Meoi2BTi9gaZVt3GRgj8r9gnzNDI1P1EBkCYW0Lu IWYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=5Q2IqBUoCpPIEX/bjKYqHf79oA60d19NJBCHs4HrLVM=; b=iyXEcWwznvGLm2iotz6sHTOkbw/m2FIrYWsPrSFLpPSVTQmAvhBdkxriSv5FVL36nx XGOTemj0lMmJUs2+dJOwODcUjSAEfv/zHj0sb0dWRvjNzX0YlF90xHn53PzK15owgOd/ FrlhR/25gjIF4yjCEVw7h4OkMsvHdDW1jn0e/gy5jkrYIQPQ/WwjUCntBQw5K4stYEoA BZi3ooN7U6gS4HlslPpJP00iWTtN/uDwlobDLeW5TBEYmO7cEeCP7mveJvYdzcfS/mWr 3xkiy1nwFe7saYh1Yy5nx2PBtJF78bDnUjRj/A0AYv0mHd7Xe/S/3B6CTbHaDS97s4M/ TCtw== ARC-Authentication-Results: i=1; mx.google.com; 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 b10-v6si483129plz.464.2018.04.09.08.30.51; Mon, 09 Apr 2018 08:31:30 -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; 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 S1753116AbeDIP1V (ORCPT + 99 others); Mon, 9 Apr 2018 11:27:21 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:62267 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751662AbeDIP1T (ORCPT ); Mon, 9 Apr 2018 11:27:19 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w39FOOIQ006064; Mon, 9 Apr 2018 17:27:01 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2h6k45uf56-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 09 Apr 2018 17:27:01 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E9F5331; Mon, 9 Apr 2018 15:26:58 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A1D064F54; Mon, 9 Apr 2018 15:26:58 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 9 Apr 2018 17:26:58 +0200 Received: from localhost (10.201.23.32) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 9 Apr 2018 17:26:57 +0200 From: Philippe Cornu To: Laurent Pinchart , Daniel Vetter , Gustavo Padovan , "Maarten Lankhorst" , Sean Paul , David Airlie , , CC: Benjamin Gaignard , Yannick Fertre , Philippe Cornu , "Vincent Abriou" Subject: [PATCH] drm: clarify adjusted_mode documentation for bridges Date: Mon, 9 Apr 2018 17:24:27 +0200 Message-ID: <20180409152427.12449-1-philippe.cornu@st.com> X-Mailer: git-send-email 2.15.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.23.32] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-09_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch clarifies the adjusted_mode documentation for bridges. Signed-off-by: Philippe Cornu Signed-off-by: Laurent Pinchart --- This patch follows discussions in: - "drm: clarify adjusted_mode for a bridge connected to a crtc" https://patchwork.freedesktop.org/patch/206801/ - "drm: bridge: Constify mode arguments to bridge .mode_set() operation" https://patchwork.freedesktop.org/patch/215449/ include/drm/drm_bridge.h | 16 ++++++++++++++++ include/drm/drm_crtc.h | 11 +++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 3270fec46979..7d632c6a9214 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -178,6 +178,22 @@ struct drm_bridge_funcs { * 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. */ void (*mode_set)(struct drm_bridge *bridge, struct drm_display_mode *mode, diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index a2d81d2907a9..65f749a9e9d3 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -134,10 +134,13 @@ struct drm_crtc_state { * * 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. It is purely driver - * implementation defined what exactly this adjusted mode means. Usually - * it is used to store the hardware display timings used between the - * CRTC and encoder blocks. + * is actually programmed into the hardware. + * + * For drivers using drm_bridge, this stores 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. */ struct drm_display_mode adjusted_mode; -- 2.15.1