From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753087AbeAZJzD (ORCPT ); Fri, 26 Jan 2018 04:55:03 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:25993 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753071AbeAZJzB (ORCPT ); Fri, 26 Jan 2018 04:55:01 -0500 From: Philippe CORNU To: Brian Norris CC: Archit Taneja , Andrzej Hajda , Laurent Pinchart , David Airlie , Benjamin Gaignard , Bhumika Goyal , "dri-devel@lists.freedesktop.org" , "Linux Kernel" , Sandy Huang , Heiko Stubner , "linux-arm-kernel@lists.infradead.org" , "open list:ARM/Rockchip SoC..." , Yannick FERTRE , Vincent ABRIOU , Alexandre TORGUE , Maxime Coquelin , Ludovic BARRE , Mickael REULIER Subject: Re: [PATCH] drm/bridge/synopsys: dsi: use adjusted_mode in mode_set Thread-Topic: [PATCH] drm/bridge/synopsys: dsi: use adjusted_mode in mode_set Thread-Index: AQHTli51AxAS3zEgZEeYoSDzeMGpIaOF2g6A Date: Fri, 26 Jan 2018 09:54:01 +0000 Message-ID: <5f9d5de7-4597-b9e9-64fe-666230b12bce@st.com> References: <20180125155504.8611-1-philippe.cornu@st.com> In-Reply-To: Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.75.127.49] Content-Type: text/plain; charset="utf-8" Content-ID: <8DBC162521B2F94081BD4B73F57094BB@st.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-26_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id w0Q9tB7o007608 Hi Brian, And a big thanks for your Tested-by On 01/25/2018 11:47 PM, Brian Norris wrote: > On Thu, Jan 25, 2018 at 7:55 AM, Philippe Cornu wrote: >> The "adjusted_mode" clock value (ie the real pixel clock) is more >> accurate than "mode" clock value (ie the panel/bridge requested >> clock value). It offers a better preciseness for timing >> computations and allows to reduce the extra dsi bandwidth in >> burst mode (from ~20% to ~10-12%, hw platform dependant). >> >> Signed-off-by: Philippe Cornu >> --- >> Note: This patch replaces "drm/bridge/synopsys: dsi: add optional pixel clock" > > These two appear to be the same for my cases, but at least nothing breaks: > In drivers/gpu/drm/rockchip/rockchip_drm_vop.c function vop_crtc_mode_fixup(), the adjusted_mode->clock (ie. vop px clk output = dw dsi px clk input) is updated according to rockchip hw pll/dividers... So you "may" have a different value in adjusted_mode->clock compare to mode->clock. Maybe there is no difference for the panel you are using because its px clock matches perfectly with rockchip hw pll/dividers... or has been set to match with ;-) I did a similar patch (see [1]) and it works "fine" on stm, the only difference with the rockchip vop is that clk_round_rate() returns odd values on stm so I used set/get_rate instead. So now, both rockchip & stm crtc have an "adjusted_mode->clock" so it makes sense to use it in dw dsi :) Philippe :-) [1] https://patchwork.freedesktop.org/patch/200720/ "[PATCH] drm/stm: ltdc: use crtc_mode_fixup to update adjusted_mode clock" > Tested-by: Brian Norris >