Received: by 2002:a9a:4c47:0:b029:116:c383:538 with SMTP id u7csp771236lko; Tue, 13 Jul 2021 09:51:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmbYJ4WobmKBab4qH/jwq8960a3wA5ShQX280k4N9ZnKSriZtYxRNnFBB1X+drUg32AJd9 X-Received: by 2002:a05:6402:128d:: with SMTP id w13mr6897119edv.1.1626195119085; Tue, 13 Jul 2021 09:51:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626195119; cv=none; d=google.com; s=arc-20160816; b=nRLa1+3IFtyQiL4Py8AY9vuycofg4jOOow78Du8ajqnZb9KX8oam1YkwaB2gfO9vJ7 CAbycQ6qY+Q8UUdXoiaWXnKDM466hNUIzrLXeEJSfFw6ypQ16QAcNrkp6Ggk/DeC1vek 5JYqThLSUYsruO6AhD4t+/Bf246nQrZ7I311EQop2+3eiAmQ41umGxS6QUeaIzEEv8Wp jVFcUwqzlkVLIMgoScP7ljjCV9LFF2UZ7VXL1vTPhm+kg70DpH580XQYSWYpOV94CzKi UfA0ojSaIeCoVIWMqDE8Ry6t+MfQ/Bw1bJVK6qhc0XdFbQayAmmUIbWXGb4JDpw0ZM00 tLNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=gg2gTv2lq4OleHCgViRouDUkyxkUyd4z5kbx03z9dNk=; b=oOhgO+xXJ15P+2lT8tfv2nn+bFjJvy/Ix79cXTnL44CfoPM1a7g7QZyJPXa+tp1De0 KDmlbKcWXrY3Ub+T157u3jjJw6MH9qURWj4tbxUW9eiIpY4hYRiK3Q6I2KwQXIyFA4Ei mkTlrksMnUTydy33bUrqA2eZYwmUHBZWjWT2R2mevZpBzy4ERuvpq8s5IVeUkgp3TVVm LT798fEUsZx/5NftOMWuTE4tb+FJLLB9PrHo/pv4rTQIc7J4224OTRM+wcfdEVlgBEf0 gWnPAac/9UL9iaiuxc3qMbCOlAileJ4UsGFMz3lajvPyfn2YD8hoClabFgeTBWZoOoM0 GAFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=cLpUYW2Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x24si21206391edr.323.2021.07.13.09.51.36; Tue, 13 Jul 2021 09:51:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=cLpUYW2Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230132AbhGMQux (ORCPT + 99 others); Tue, 13 Jul 2021 12:50:53 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:51546 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229604AbhGMQux (ORCPT ); Tue, 13 Jul 2021 12:50:53 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16DGlmtL019530; Tue, 13 Jul 2021 18:47:48 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=gg2gTv2lq4OleHCgViRouDUkyxkUyd4z5kbx03z9dNk=; b=cLpUYW2YltxWRKbbdofSonWO7t33yV0AXq1/u+uO8nO1z7wp2dKWo98zA8WCggSF4/hl MS+8izDBmDKu5YYEmo/6YX033Ca1MzAonFEsvTymVjN9n9sJ4vgM06cvd/QIUhAbO5Pa pYkx/I7K3aeW5FYrQDzw8hRznHCiUGQpS+i/q1WywQWg+xjQMP2ht/QD5B9DOS3twdVe MQPpgqLAkJbcZ8X1ZRzvJ8NvizEOm1NARCfqCCgbautiNVldcnTPAQMBVYsz2Vh3xwGY nLKHKGc2ofdSrIDlUe7AiSWORWwhSjNF8xh+a99vnnH/1lBJLpoInhKCt6rrKwe4ugaF Mg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 39s8vd22ah-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Jul 2021 18:47:48 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 56DD610002A; Tue, 13 Jul 2021 18:47:45 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 3E89F248ED3; Tue, 13 Jul 2021 18:47:45 +0200 (CEST) Received: from lmecxl0993.lme.st.com (10.75.127.44) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 13 Jul 2021 18:47:44 +0200 Subject: Re: [PATCH] drm/stm: dsi: compute the transition time from LP to HS and back To: Antonio Borneo , Yannick Fertre , Benjamin Gaignard , David Airlie , Daniel Vetter , Maxime Coquelin , Alexandre Torgue , Raphael Gallais-Pou , , , CC: References: <20210713144941.3599-1-antonio.borneo@foss.st.com> From: Philippe CORNU Message-ID: Date: Tue, 13 Jul 2021 18:47:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210713144941.3599-1-antonio.borneo@foss.st.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.44] X-ClientProxiedBy: SFHDAG1NODE3.st.com (10.75.127.3) To SFHDAG2NODE3.st.com (10.75.127.6) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-13_10:2021-07-13,2021-07-13 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Antonio, On 7/13/21 4:49 PM, Antonio Borneo wrote: > The driver uses a conservative set of hardcoded values for the > maximum time delay of the transitions between LP and HS, either > for data and clock lanes. > > By using the info in STM32MP157 datasheet, valid also for other ST > devices, compute the actual delay from the lane's bps. > > Signed-off-by: Antonio Borneo > --- > To: Yannick Fertre > To: Philippe Cornu > To: Benjamin Gaignard > To: David Airlie > To: Daniel Vetter > To: Maxime Coquelin > To: Alexandre Torgue > To: Raphael Gallais-Pou > To: dri-devel@lists.freedesktop.org > To: linux-stm32@st-md-mailman.stormreply.com > To: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > > drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 17 +++++++++++++---- > 1 file changed, 13 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c > index 8399d337589d..32cb41b2202f 100644 > --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c > +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c > @@ -309,14 +309,23 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode, > return 0; > } > > +#define DSI_PHY_DELAY(fp, vp, mbps) DIV_ROUND_UP((fp) * (mbps) + 1000 * (vp), 8000) > + > static int > dw_mipi_dsi_phy_get_timing(void *priv_data, unsigned int lane_mbps, > struct dw_mipi_dsi_dphy_timing *timing) > { > - timing->clk_hs2lp = 0x40; > - timing->clk_lp2hs = 0x40; > - timing->data_hs2lp = 0x40; > - timing->data_lp2hs = 0x40; > + /* > + * From STM32MP157 datasheet, valid for STM32F469, STM32F7x9, STM32H747 > + * phy_clkhs2lp_time = (272+136*UI)/(8*UI) > + * phy_clklp2hs_time = (512+40*UI)/(8*UI) > + * phy_hs2lp_time = (192+64*UI)/(8*UI) > + * phy_lp2hs_time = (256+32*UI)/(8*UI) > + */ > + timing->clk_hs2lp = DSI_PHY_DELAY(272, 136, lane_mbps); > + timing->clk_lp2hs = DSI_PHY_DELAY(512, 40, lane_mbps); > + timing->data_hs2lp = DSI_PHY_DELAY(192, 64, lane_mbps); > + timing->data_lp2hs = DSI_PHY_DELAY(256, 32, lane_mbps); Many thanks for your patch. Reviewed-by: Philippe Cornu Acked-by: Philippe Cornu I will apply it on drm-misc-next early next week, Philippe :-) > > return 0; > } > > base-commit: 35d283658a6196b2057be562096610c6793e1219 >