Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp783932rwr; Thu, 20 Apr 2023 06:29:02 -0700 (PDT) X-Google-Smtp-Source: AKy350aDRZKcCgFjKDtshNSK8nzYx1+eu07HcAkH2JRUrNjlB1A81MZAjjTd5vk+ambrTkMwrMrO X-Received: by 2002:a17:902:f54d:b0:19c:f232:21ca with SMTP id h13-20020a170902f54d00b0019cf23221camr1989958plf.3.1681997341761; Thu, 20 Apr 2023 06:29:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681997341; cv=none; d=google.com; s=arc-20160816; b=Cny0cIOAokf7d9ViFDGIp/NLM4N9e1kZALf2XlvIeqsp4k64IKK2R9+AQpvIWwLkfv kZCdMKjn94OcrVGhIxYkNsQFEnoNezdmCjaj4i0BnlvJVUD8ZU+cn3xj0Qm+SaSUUZB+ LkDhGMvL6q/I8uhmaqyL5JxhZxkASt1RIhV2nKqwbd5t7MQmFdtjuX1StI/iX7EX0W1i EaJ7MLGeg4w+M46DZr31kgElq/FeywRDro721zKzok0nPLrRB4zKl8UTs/malLA0+YBv ZHHfqmu1gpjMP/46jfWtzoWjbumFLE97HzZnIUsW/5Jx/+ni6To+FoGQ9JpfRUf6X7VM Wo5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ZwnhlLJyEh47311bVCrbK3D/ImOBY4/qp9iGa9ZeGIo=; b=R/qq3efsslrnDe07mzZVuJ5+2w4hD9ZTDsNNitEORjBq4j0fLV1CNtpEpxSrdqusZA sbmv2ABckaIQ42K52BrjDMYVrg8RkzR8vnILtX7hw3wYLlgHqZDzXSk+e7cdgbzg0I89 ctQ9ilZjFRI5LCRVTfwwUMJJ52IqyW83nB6ZI+7FOcRuYbyBJVp4khXM+S+QpC6u2VF7 3tXEwxKwq326BNtkteMlQbqPRbOmoqM+42r20HZGf1YyjVIeCiEqzWIFIOt/J/fvjLh/ LH2Q2qdjoLcjvFP3Vh//sXt+QFQ6QH3V37ZG2hrNhn5Celhm99CQKdJrFOVhCiR1Ng4g c5dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=ONIzX+fs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l12-20020a170903120c00b001a1af4abdedsi2028415plh.212.2023.04.20.06.28.47; Thu, 20 Apr 2023 06:29:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=ONIzX+fs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229761AbjDTNYw (ORCPT + 99 others); Thu, 20 Apr 2023 09:24:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbjDTNYs (ORCPT ); Thu, 20 Apr 2023 09:24:48 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5463455A8; Thu, 20 Apr 2023 06:24:47 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-247526f0eceso685678a91.2; Thu, 20 Apr 2023 06:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681997087; x=1684589087; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZwnhlLJyEh47311bVCrbK3D/ImOBY4/qp9iGa9ZeGIo=; b=ONIzX+fsmDFZ4VbgBdRcHCgYHnrSBP1dFd4aeE6I/29jSqTT3oOqtHUSmy8E2/Ki0A tSuP6Sh+TV8SNTGnG2V269F++sAwCMx/idYluhMe60Ihd1umwwpTKOjVY7wDo0trl6+E TEM/iFJhyla8toZ69F301BIJQSJiBWzWnGjrgib0aNCDydCMw58wBOYy4ESOOGZTYET7 D+bjvDnhu7F32xSO9A4iXFmfHwdjerlFtiNilL+yEsA8qlbrlKLo12pbtJhQSBx7YbCU v/luq3oLXXXoQ/8A5LxnVmiY6APx6fn2PukIWFuL1lVrRiKbCJMJoqITAXbULrGLnybz ST1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681997087; x=1684589087; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZwnhlLJyEh47311bVCrbK3D/ImOBY4/qp9iGa9ZeGIo=; b=gTu9gEu4A23dj6qNXr3yBbGFQ5TGsBjOtIEx7q36oh+J1yf3xQxk9MTP8JBP/CexsJ qOar8j4XZofSjcG5T9UWtXRBFaHbYFiIdNv2jmJTyR6sRdlLlS8uL4Yp3r5MgrdlsWsK GFJrvoEDYOKJ10/KqkN4EONcM5IUrJrRhQw3q6H7psTwbMJZEhucaC+uMDxVnmkWhBFd aPSoWeeU1K36w0Yd3kINaJmSw/VOB/29qT1aGCzIqDz8GWlfsN0Q2U3zRWWxVcAb9De9 qWXuYro/RGToaX7hMkjABetPeizEDvwxVZyiMy46xAKeQFTqQUSGKb5LM5f8RpejY+UV Uk2A== X-Gm-Message-State: AAQBX9f6Z/sStXxizlilgfok42TneqyMV8hRNiD919jZGwv+7WVx21dB 4X2ZnxSw/orNrziZLGbiwKMCcOZ8Xv50MX/8Q7k= X-Received: by 2002:a17:90a:e7cf:b0:246:f710:4f01 with SMTP id kb15-20020a17090ae7cf00b00246f7104f01mr1573886pjb.35.1681997086466; Thu, 20 Apr 2023 06:24:46 -0700 (PDT) MIME-Version: 1.0 References: <20230415104104.5537-1-aford173@gmail.com> <3e47f0d1017fe4c9f71a5de65f32c6ba1662efe2.camel@pengutronix.de> In-Reply-To: From: Adam Ford Date: Thu, 20 Apr 2023 08:24:35 -0500 Message-ID: Subject: Re: [PATCH 1/6] drm: bridge: samsung-dsim: Support multi-lane calculations To: Lucas Stach Cc: dri-devel@lists.freedesktop.org, Krzysztof Kozlowski , aford@beaconembedded.com, Laurent Pinchart , Andrzej Hajda , Fabio Estevam , m.szyprowski@samsung.com, marex@denx.de, Robert Foss , David Airlie , Jernej Skrabec , Jagan Teki , NXP Linux Team , devicetree@vger.kernel.org, Daniel Vetter , Jonas Karlman , Sascha Hauer , Inki Dae , Rob Herring , linux-arm-kernel@lists.infradead.org, Neil Armstrong , linux-kernel@vger.kernel.org, Pengutronix Kernel Team , Shawn Guo Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 20, 2023 at 8:06=E2=80=AFAM Lucas Stach wrote: > > Hi Adam, > > Am Mittwoch, dem 19.04.2023 um 05:47 -0500 schrieb Adam Ford: > > On Mon, Apr 17, 2023 at 6:55=E2=80=AFAM Adam Ford = wrote: > > > > > > On Mon, Apr 17, 2023 at 3:43=E2=80=AFAM Lucas Stach wrote: > > > > > > > > Hi Adam, > > > > > > > > Am Samstag, dem 15.04.2023 um 05:40 -0500 schrieb Adam Ford: > > > > > If there is more than one lane, the HFP, HBP, and HSA is calculat= ed in > > > > > bytes/pixel, then they are divided amongst the different lanes wi= th some > > > > > additional overhead. This is necessary to achieve higher resoluti= ons while > > > > > keeping the pixel clocks lower as the number of lanes increase. > > > > > > > > > > > > > In the testing I did to come up with my patch "drm: bridge: samsung= - > > > > dsim: fix blanking packet size calculation" the number of lanes did= n't > > > > make any difference. My testing might be flawed, as I could only > > > > measure the blanking after translation from MIPI DSI to DPI, so I'm > > > > interested to know what others did here. How did you validate the > > > > blanking with your patch? Would you have a chance to test my patch = and > > > > see if it works or breaks in your setup? > > > > Lucas, > > > > I tried your patch instead of mine. Yours is dependent on the > > hs_clock being always set to the burst clock which is configured by > > the device tree. I unrolled a bit of my stuff and replaced it with > > yours. It worked at 1080p, but when I tried a few other resolutions, > > they did not work. I assume it's because the DSI clock is fixed and > > not changing based on the pixel clock. In the version I did, I only > > did that math when the lanes were > 1. In your patch, you divide by 8, > > and in mine, I fetch the bits-per-pixel (which is 8) and I divide by > > that just in case the bpp ever changes from 8. Overall, I think our > > patches basically do the same thing. > > The calculations in your and my patch are quite different. I'm not > taking into account the number of lanes or the MIPI format. I'm basing I was looking more at the division by 8 and the overhead correction of 6. This number 6 also appears in the NXP downstream kernel [1]. I know Marek V had some concerns about that. > the blanking size purely on the ratio between MIPI DSI byte clock and > the DPI interface clock. It's quite counter-intuitive that the host > would scale the blanking to the number of lanes automatically, but > still require the MIPI packet offset removed, but that's what my > measurements showed to produce the correct blanking after translation > to DPI by the TC358767 bridge chip. How many lanes is your DSI interface using? > > If you dynamically scale the HS clock, then you would need to input the > real used HS clock to the calculation in my patch, instead of the fixed > burst mode rate. I think what you're saying makes sense. The code I originally modeled this from was from the NXP downstream kernel where they define the calculation as being in words [2]. I am not saying the NXP code is perfect, but the NXP code works. With this series, my monitors are able to sync a bunch of different resolutions from 1080p down to 640x480 and a bunch in between with various refresh rates too. That was the goal of this series. Instead of just using your patch as-is, I will adapt yours to use the scaled clock to see how it behaves and get back to you. I have finished reworking the dynamic DPHY settings, and I've fixed up making the PLL device tree optional. If your patch works, I'll drop my calculation and just build off what you have to use the scaled HS clock when I submit the V2 and I'll make sure I CC you. adam [1] - https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/drivers/gpu/drm/br= idge/sec-dsim.c#L270 [2] - https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/drivers/gpu/drm/br= idge/sec-dsim.c#L914 > > Regards, > Lucas