| Message ID | 20221110183853.3678209-2-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBFELWWNQMGQEWCKZIAI@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D67CF3F039 for <linux-amarula@patchwork.amarulasolutions.com>; Thu, 10 Nov 2022 19:40:21 +0100 (CET) Received: by mail-pj1-f72.google.com with SMTP id m2-20020a17090a730200b0021020cce6adsf3905378pjk.3 for <linux-amarula@patchwork.amarulasolutions.com>; Thu, 10 Nov 2022 10:40:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668105620; cv=pass; d=google.com; s=arc-20160816; b=cQY4JSsMkc5vnzb5YwGgoFiKwNBvtqlTWVHuL3iKI8vV+qbLZW7majPSg35FBGs0/1 jhPbhND0mfJUGsXQkiksLYY6AXRrMixerosg4giW5xcAkXhRewvu4KM5qs1NuQwqO9te ZUPZCtxLLAf6NMw1wtYaVWXsnee4QS2DWQ86FEq+snZH5R1PrgBJxL0MUfcPeMqECeyW hddk1u0KK4dwcuEJPkUWLb9KYT3KyHOyg4YD1Qw02hxJJiWJD9CI9VynEStBN47xO273 lj1jtCCcfIUgw0eQ4lnzWXkua+WJAvcYdCSQ9AOO3c4IuNk2F5yPXQ0GZes5JXEKHfpH NCbQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3YRQzIdR8pYoCooTr6M7fDKPNUffypdrApdlRQZWAhs=; b=WQ+lRtHuyEXhQIx3KsL7cXKJxRv+yRHvqnoapLjhABgudHERFTBx7wqYEErk2TQk7a 0M4wp4gTmVEeb1ouwRZ9d+xfyyQGYjjy8aWTogY1MwHp3bHkVbqoU2BKCZs+cw4VqhUy Qg2QPJVjtKgmsZEgYWcIjuF+MI2E9fW7+JBrFJbftfiW+fugHi2B9uwG+Ro8Vxt56EFN GRX0xg/AjMO1NnWDPMr1zi6kcmcgD6gmzrPizo0zqGkye0V5J8s7x8SufukS4hLFiYLY yZGl3Bi6p93V/NOG2ZnYSQ4JKlnsJ4YxZM735eqN45QPDr8FjS0xJfUY3YbRZXXKKQAm 9HCQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=l5FjXvkq; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=3YRQzIdR8pYoCooTr6M7fDKPNUffypdrApdlRQZWAhs=; b=SDD+SDMD681NOH082xrIuVBMKOcZMct80JxsAxad35C8bEu0Dxd5y4sy1vVLuDtCjO QWrGbTsaoOqaIabW62zkfoH4gVXBKMJADcVy0YZ9GGcgBmy+sdrkXtUVslnrPJTx5Rnn FlXwVrFVWJzMsWxhyeSSAwtXyEoKdAIqRrDQA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3YRQzIdR8pYoCooTr6M7fDKPNUffypdrApdlRQZWAhs=; b=K83KtKnRqnDcYMgiX7KHiwRMHCmJfkhCvlDHby3IDipYMVEKHTBMm302secx1mFK9A KcQCRVRIHxM4Tgc7W40VX5nNQgZ7Uv43ktkJ6Bwd0LD35s12706YosZJFz8is5pRkyzc t+zMQ+y5kokbUZYMXY8fSDOhVIxQgOEMc9By9Gnbq2NKxIZ/BkOIP31Kiw5KiPCUTwcY kQr7gkORaFfn+QS8ncrB0HbxfE+2a8eQpBce9t+Ie2Ql6vDd9sHeoxFWdMN0eu9/w5vH hx3EevrPZXLbHmq0s3bn5pVihGBaXtvBKvWfX7DvtHCchCrSV+gRVEuf8L/KRdUXSUld +IEQ== X-Gm-Message-State: ACrzQf27vLBD3ht666JzlZatFkWO9kEE+kvPodxHYGFOGaR7EfEKQmXx PMAEcJApOvrBXebPrjnk3v2NsGjG X-Google-Smtp-Source: AMsMyM5sy6TG9Qabn+tYDnRA63lpBQyNsdlkks3wwPXeTwPBmPmUq6JriCWCshU4BivN2lWpwK7BIg== X-Received: by 2002:a17:90a:f198:b0:212:c3cf:b8f4 with SMTP id bv24-20020a17090af19800b00212c3cfb8f4mr68173941pjb.49.1668105620498; Thu, 10 Nov 2022 10:40:20 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:1f48:b0:213:e:b27 with SMTP id y8-20020a17090a1f4800b00213000e0b27ls4164220pjy.0.-pod-canary-gmail; Thu, 10 Nov 2022 10:40:19 -0800 (PST) X-Received: by 2002:a17:902:c412:b0:186:a279:717f with SMTP id k18-20020a170902c41200b00186a279717fmr66228522plk.29.1668105619607; Thu, 10 Nov 2022 10:40:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668105619; cv=none; d=google.com; s=arc-20160816; b=f/ji8lJiSJTaoI03Bcm4z4CJCQ2jvd8sWGtf7+mST8hFnXKMbI3UIKSneg4YzX8jUb XRerkha07AuHMvP3DvkmkWT3Z5aUB/Wf8PIL2v5C6DUyEJgeH36QBV3oGS0Mh2nY8sfr 3dVH077UVCQFc8smxORci2d8IWy0CKTdGUh0nKAVAQ9WoEX/AW63SXMJtK+VAA6EYV5r 67H+0HG1cZFGpnU/grHkH7Qz/CvjpXCjIFN6ZsD6+vrQRL32dgoKDIPULyfEQQ0EpBFx QSzB7LZWtn1/yF2VnWcnP+xJTz4R1YD0DwbWQXdoiYQDodSQEIjfJd7s1C8puWLqsf1K m0Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=pI9nmADqBaRgKnAq2H3CdzUb+UwaNTPrY74SU7vfqFU=; b=YjUqMPO4jAdzmkqzE+0NSndJodWmNTP/EBgf1AYuRNZwpZbHfp9VezQZZP2R+tCrOW 181r7tSDuhcDrqPTlHV0UEnarqHbb3OLfL2CGkz+gx+Axrl6QEqPvrowBDs31eRmN5cN MzZWIH8DMWspPgdTLpz6zgulHfu9SjxwUoZYu1OP06Q67CAzZcYvlXgEcThomF5loOyB adcR1uM3vQiMx0vz7r5WBJCbvq0vkwnZC9mrNdCAvN5lbqF3JqcYlqXP9nAm97yhG+Vm JCawkyP+a0JBZucIiAKKlPXxxuBCMstYcG8A449V1crCqvAc2knvBdJrl8Vb6G+RcrJ2 GR+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=l5FjXvkq; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id s7-20020a17090a764700b00202e89816c3sor2186720pjl.8.2022.11.10.10.40.19 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Thu, 10 Nov 2022 10:40:19 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:90a:d814:b0:20a:b98f:b839 with SMTP id a20-20020a17090ad81400b0020ab98fb839mr1674598pjv.23.1668105619201; Thu, 10 Nov 2022 10:40:19 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:b5a4:486a:f07:f67e]) by smtp.gmail.com with ESMTPSA id c2-20020a170903234200b001869efb722csm11635627plh.215.2022.11.10.10.40.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 10:40:18 -0800 (PST) From: Jagan Teki <jagan@amarulasolutions.com> To: Andrzej Hajda <andrzej.hajda@intel.com>, Inki Dae <inki.dae@samsung.com>, Marek Szyprowski <m.szyprowski@samsung.com>, Joonyoung Shim <jy0922.shim@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com>, Frieder Schrempf <frieder.schrempf@kontron.de>, Fancy Fang <chen.fang@nxp.com>, Tim Harvey <tharvey@gateworks.com>, Michael Nazzareno Trimarchi <michael@amarulasolutions.com>, Adam Ford <aford173@gmail.com>, Neil Armstrong <narmstrong@linaro.org>, Robert Foss <robert.foss@linaro.org>, Laurent Pinchart <Laurent.pinchart@ideasonboard.com>, Tommaso Merciai <tommaso.merciai@amarulasolutions.com>, Marek Vasut <marex@denx.de> Cc: Matteo Lisi <matteo.lisi@engicam.com>, dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team <linux-imx@nxp.com>, linux-amarula <linux-amarula@amarulasolutions.com>, Jagan Teki <jagan@amarulasolutions.com>, Nicolas Boichat <drinkcat@chromium.org>, =?utf-8?q?S=C3=A9bastien_Szy?= =?utf-8?q?manski?= <sebastien.szymanski@armadeus.com> Subject: [PATCH v8 01/14] drm: exynos: dsi: Fix MIPI_DSI*_NO_* mode flags Date: Fri, 11 Nov 2022 00:08:40 +0530 Message-Id: <20221110183853.3678209-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221110183853.3678209-1-jagan@amarulasolutions.com> References: <20221110183853.3678209-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=l5FjXvkq; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
drm: bridge: Add Samsung MIPI DSIM bridge
|
|
Commit Message
Jagan Teki
Nov. 10, 2022, 6:38 p.m. UTC
HFP/HBP/HSA/EOT_PACKET modes in Exynos DSI host specifies
0 = Enable and 1 = Disable.
The logic for checking these mode flags was correct before
the MIPI_DSI*_NO_* mode flag conversion.
Fix the MIPI_DSI*_NO_* mode flags handling.
Fixes: 0f3b68b66a6d ("drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling
features")
Cc: Nicolas Boichat <drinkcat@chromium.org>
Reported-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Comments
On Fri, Nov 11, 2022 at 2:40 AM Jagan Teki <jagan@amarulasolutions.com> wrote: > > HFP/HBP/HSA/EOT_PACKET modes in Exynos DSI host specifies > 0 = Enable and 1 = Disable. Oh I see, that's confusing... IMHO you might want to change the register macro name... (but if that's what the datasheet uses, it might not be ideal either). At the _very_ least, I'd add a comment in the code so the next person doesn't attempt to "fix" it again... BTW, are you sure DSIM_HSE_MODE is correct now? > > The logic for checking these mode flags was correct before > the MIPI_DSI*_NO_* mode flag conversion. > > Fix the MIPI_DSI*_NO_* mode flags handling. > > Fixes: 0f3b68b66a6d ("drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling > features") > Cc: Nicolas Boichat <drinkcat@chromium.org> > Reported-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > --- > drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c > index ec673223d6b7..b5305b145ddb 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c > @@ -805,15 +805,15 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi) > reg |= DSIM_AUTO_MODE; > if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_HSE) > reg |= DSIM_HSE_MODE; > - if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HFP)) > + if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HFP) > reg |= DSIM_HFP_MODE; > - if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HBP)) > + if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HBP) > reg |= DSIM_HBP_MODE; > - if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HSA)) > + if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HSA) > reg |= DSIM_HSA_MODE; > } > > - if (!(dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)) > + if (dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET) > reg |= DSIM_EOT_DISABLE; > > switch (dsi->format) { > -- > 2.25.1 >
On Fri, Nov 11, 2022 at 6:19 AM Nicolas Boichat <drinkcat@chromium.org> wrote: > > On Fri, Nov 11, 2022 at 2:40 AM Jagan Teki <jagan@amarulasolutions.com> wrote: > > > > HFP/HBP/HSA/EOT_PACKET modes in Exynos DSI host specifies > > 0 = Enable and 1 = Disable. > > Oh I see, that's confusing... IMHO you might want to change the > register macro name... (but if that's what the datasheet uses, it > might not be ideal either). At the _very_ least, I'd add a comment in > the code so the next person doesn't attempt to "fix" it again... 02/14 on the same series doing the name change. https://lore.kernel.org/all/20221110183853.3678209-3-jagan@amarulasolutions.com/ > > BTW, are you sure DSIM_HSE_MODE is correct now? Yes, we have tested in imx8m platforms as well. Sébastien Szymanski initially observed this issue on the imx8m platform. Jagan.
On Fri, Nov 11, 2022 at 4:49 PM Jagan Teki <jagan@amarulasolutions.com> wrote: > > On Fri, Nov 11, 2022 at 6:19 AM Nicolas Boichat <drinkcat@chromium.org> wrote: > > > > On Fri, Nov 11, 2022 at 2:40 AM Jagan Teki <jagan@amarulasolutions.com> wrote: > > > > > > HFP/HBP/HSA/EOT_PACKET modes in Exynos DSI host specifies > > > 0 = Enable and 1 = Disable. > > > > Oh I see, that's confusing... IMHO you might want to change the > > register macro name... (but if that's what the datasheet uses, it > > might not be ideal either). At the _very_ least, I'd add a comment in > > the code so the next person doesn't attempt to "fix" it again... > > 02/14 on the same series doing the name change. > https://lore.kernel.org/all/20221110183853.3678209-3-jagan@amarulasolutions.com/ Oh thanks I wasn't cc'ed on that one, makes sense. You can add my reviewed tag to this one, as my HSE comment doesn't change this. Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> But please double check HSE. > > > > > BTW, are you sure DSIM_HSE_MODE is correct now? > > Yes, we have tested in imx8m platforms as well. Sébastien Szymanski > initially observed this issue on the imx8m platform. I'll repeat, are you sure about HSE specifically? You invert the polarity for HBP, HFP, and HSA, which makes sense given your patch 02/14. I'm concerned about HSE. Is the bit really a disable bit? MIPI_DSI_MODE_VIDEO_HSE is supposed to be an enable flag, so you should not do `reg |= DSIM_HSE_DISABLE;`, probably. Thanks, > > Jagan.
On Fri, Nov 11, 2022 at 5:42 PM Nicolas Boichat <drinkcat@chromium.org> wrote: > > On Fri, Nov 11, 2022 at 4:49 PM Jagan Teki <jagan@amarulasolutions.com> wrote: > > > > On Fri, Nov 11, 2022 at 6:19 AM Nicolas Boichat <drinkcat@chromium.org> wrote: > > > > > > On Fri, Nov 11, 2022 at 2:40 AM Jagan Teki <jagan@amarulasolutions.com> wrote: > > > > > > > > HFP/HBP/HSA/EOT_PACKET modes in Exynos DSI host specifies > > > > 0 = Enable and 1 = Disable. > > > > > > Oh I see, that's confusing... IMHO you might want to change the > > > register macro name... (but if that's what the datasheet uses, it > > > might not be ideal either). At the _very_ least, I'd add a comment in > > > the code so the next person doesn't attempt to "fix" it again... > > > > 02/14 on the same series doing the name change. > > https://lore.kernel.org/all/20221110183853.3678209-3-jagan@amarulasolutions.com/ > > Oh thanks I wasn't cc'ed on that one, makes sense. > > You can add my reviewed tag to this one, as my HSE comment doesn't change this. > > Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> > > But please double check HSE. > > > > > > > > > BTW, are you sure DSIM_HSE_MODE is correct now? > > > > Yes, we have tested in imx8m platforms as well. Sébastien Szymanski > > initially observed this issue on the imx8m platform. > > I'll repeat, are you sure about HSE specifically? You invert the > polarity for HBP, HFP, and HSA, which makes sense given your patch > 02/14. > > I'm concerned about HSE. Is the bit really a disable bit? > MIPI_DSI_MODE_VIDEO_HSE is supposed to be an enable flag, so you > should not do `reg |= DSIM_HSE_DISABLE;`, probably. HSE typically enables bit logic, unlike other bits which are disabled bits. HseDisableMod: In Vsync pulse and Vporch area, MIPI DSI master transfers only Hsync start packet to MIPI DSI slave at MIPI DSI spec 1.1r02. This bit transfers Hsync end packet in Vsync pulse and Vporch area (optional). 0 = Disables transfer 1 = Enables transfer HfpDisableMode: Specifies HFP disable mode. If this bit set, DSI master ignores HFP area in Video mode. 0 = Enables 1 = Disables I think the naming of 'HseDisableMod' is misleading in the datasheet, but I have used it as per the spec. Jagan.
On 11/11/22 13:12, Nicolas Boichat wrote: [...] >>> BTW, are you sure DSIM_HSE_MODE is correct now? >> >> Yes, we have tested in imx8m platforms as well. Sébastien Szymanski >> initially observed this issue on the imx8m platform. > > I'll repeat, are you sure about HSE specifically? You invert the > polarity for HBP, HFP, and HSA, which makes sense given your patch > 02/14. > > I'm concerned about HSE. Is the bit really a disable bit? > MIPI_DSI_MODE_VIDEO_HSE is supposed to be an enable flag, so you > should not do `reg |= DSIM_HSE_DISABLE;`, probably. I suspect the HSE bit is a misnomer, but its handling in the driver is correct. i.MX 8M Plus Applications Processor Reference Manual, Rev. 1, 06/2021 Page 5436 23 HseDisableMode In Vsync pulse and Vporch area, MIPI DSI master transfers only Hsync start packet to MIPI DSI slave at MIPI DSI spec 1.1r02. This bit transfers Hsync end packet in Vsync pulse and Vporch area (optional). 0 = Disables transfer 1 = Enables transfer In command mode, this bit is ignored.
On Sun, Nov 13, 2022 at 8:29 AM Marek Vasut <marex@denx.de> wrote: > > On 11/11/22 13:12, Nicolas Boichat wrote: > > [...] > > >>> BTW, are you sure DSIM_HSE_MODE is correct now? > >> > >> Yes, we have tested in imx8m platforms as well. Sébastien Szymanski > >> initially observed this issue on the imx8m platform. > > > > I'll repeat, are you sure about HSE specifically? You invert the > > polarity for HBP, HFP, and HSA, which makes sense given your patch > > 02/14. > > > > I'm concerned about HSE. Is the bit really a disable bit? > > MIPI_DSI_MODE_VIDEO_HSE is supposed to be an enable flag, so you > > should not do `reg |= DSIM_HSE_DISABLE;`, probably. > > I suspect the HSE bit is a misnomer, but its handling in the driver is > correct. > > i.MX 8M Plus Applications Processor Reference Manual, Rev. 1, 06/2021 > Page 5436 > > 23 HseDisableMode > > In Vsync pulse and Vporch area, MIPI DSI master transfers only Hsync > start packet to MIPI DSI slave at MIPI DSI spec 1.1r02. This bit > transfers Hsync end packet in Vsync pulse and Vporch area (optional). > > 0 = Disables transfer > 1 = Enables transfer > > In command mode, this bit is ignored. Okay. I'd suggest adding a comment in the code, it'd be so tempting to attempt to "fix" this as the if/or pattern looks different from the others. But it's up to you all. Thanks,
On 11/14/22 02:11, Nicolas Boichat wrote: > On Sun, Nov 13, 2022 at 8:29 AM Marek Vasut <marex@denx.de> wrote: >> >> On 11/11/22 13:12, Nicolas Boichat wrote: >> >> [...] >> >>>>> BTW, are you sure DSIM_HSE_MODE is correct now? >>>> >>>> Yes, we have tested in imx8m platforms as well. Sébastien Szymanski >>>> initially observed this issue on the imx8m platform. >>> >>> I'll repeat, are you sure about HSE specifically? You invert the >>> polarity for HBP, HFP, and HSA, which makes sense given your patch >>> 02/14. >>> >>> I'm concerned about HSE. Is the bit really a disable bit? >>> MIPI_DSI_MODE_VIDEO_HSE is supposed to be an enable flag, so you >>> should not do `reg |= DSIM_HSE_DISABLE;`, probably. >> >> I suspect the HSE bit is a misnomer, but its handling in the driver is >> correct. >> >> i.MX 8M Plus Applications Processor Reference Manual, Rev. 1, 06/2021 >> Page 5436 >> >> 23 HseDisableMode >> >> In Vsync pulse and Vporch area, MIPI DSI master transfers only Hsync >> start packet to MIPI DSI slave at MIPI DSI spec 1.1r02. This bit >> transfers Hsync end packet in Vsync pulse and Vporch area (optional). >> >> 0 = Disables transfer >> 1 = Enables transfer >> >> In command mode, this bit is ignored. > > Okay. I'd suggest adding a comment in the code, it'd be so tempting to > attempt to "fix" this as the if/or pattern looks different from the > others. > > But it's up to you all. I agree. Clearly the discrepancy is confusing and leads to mistakes.
On 14.11.22 04:16, Marek Vasut wrote: > On 11/14/22 02:11, Nicolas Boichat wrote: >> On Sun, Nov 13, 2022 at 8:29 AM Marek Vasut <marex@denx.de> wrote: >>> >>> On 11/11/22 13:12, Nicolas Boichat wrote: >>> >>> [...] >>> >>>>>> BTW, are you sure DSIM_HSE_MODE is correct now? >>>>> >>>>> Yes, we have tested in imx8m platforms as well. Sébastien Szymanski >>>>> initially observed this issue on the imx8m platform. >>>> >>>> I'll repeat, are you sure about HSE specifically? You invert the >>>> polarity for HBP, HFP, and HSA, which makes sense given your patch >>>> 02/14. >>>> >>>> I'm concerned about HSE. Is the bit really a disable bit? >>>> MIPI_DSI_MODE_VIDEO_HSE is supposed to be an enable flag, so you >>>> should not do `reg |= DSIM_HSE_DISABLE;`, probably. >>> >>> I suspect the HSE bit is a misnomer, but its handling in the driver is >>> correct. >>> >>> i.MX 8M Plus Applications Processor Reference Manual, Rev. 1, 06/2021 >>> Page 5436 >>> >>> 23 HseDisableMode >>> >>> In Vsync pulse and Vporch area, MIPI DSI master transfers only Hsync >>> start packet to MIPI DSI slave at MIPI DSI spec 1.1r02. This bit >>> transfers Hsync end packet in Vsync pulse and Vporch area (optional). >>> >>> 0 = Disables transfer >>> 1 = Enables transfer >>> >>> In command mode, this bit is ignored. >> >> Okay. I'd suggest adding a comment in the code, it'd be so tempting to >> attempt to "fix" this as the if/or pattern looks different from the >> others. >> >> But it's up to you all. > > I agree. Clearly the discrepancy is confusing and leads to mistakes. +1 for a comment in the code that explains the misnamed bit. Otherwise: Reviewed-By: Frieder Schrempf <frieder.schrempf@kontron.de>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index ec673223d6b7..b5305b145ddb 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -805,15 +805,15 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi) reg |= DSIM_AUTO_MODE; if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_HSE) reg |= DSIM_HSE_MODE; - if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HFP)) + if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HFP) reg |= DSIM_HFP_MODE; - if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HBP)) + if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HBP) reg |= DSIM_HBP_MODE; - if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HSA)) + if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HSA) reg |= DSIM_HSA_MODE; } - if (!(dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)) + if (dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET) reg |= DSIM_EOT_DISABLE; switch (dsi->format) {