Message ID | 20230523104234.7849-1-angelogioacchino.delregno@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2054609vqo; Tue, 23 May 2023 04:10:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4gsVE6j41lQXofRBiXwLticxrNo7AePu/vp21bpnUkNWyFs4TlZN4UhLOcACUuRUmaqghO X-Received: by 2002:a17:90a:51e6:b0:253:44e7:9454 with SMTP id u93-20020a17090a51e600b0025344e79454mr19316481pjh.17.1684840224976; Tue, 23 May 2023 04:10:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684840224; cv=none; d=google.com; s=arc-20160816; b=pSXHgvd0nFnhhxkpz9oyLG9GiemqHs9xeluMKqPYBM1eG0MPDhoM9id0u/UfDaNO6h I+e3kKGE5uj7FPXI89GiP3Ca7wKrfd2iwTiwmX/k2rMDt6NuAa0hT4MDSd45+Dp4729F rv2OdKlB2rcKe7W+72Tj8izGe2pp43KxO/ntZAnaH1b8+1l6nv+9uMlpFWn8nlUNkW1q RC860RXavMvH4tOu3GyV3j91pcAR8BUsI9nwvAevPaqj4IZWLzX6dnhQpm9lAZiVoUQZ Bk59awGSPxnBtwifO3pmxtY/QHzS1CPlOPOyIWb8ATpIQmq7CH6OyPXoNVN2zzBeS76O pOLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2Bg95vTG7i5qmcG2L2s281WoQBxWPUoLiqODwtHlxWM=; b=VVK+7/0igHQi1lNUoV990aGdGtrq+J3oWVOg+ya2VjSJSFGGv4hvzCIXwAODEzNor0 CeIQtxabuF4VAwXgRSKGi+u2ctLe2TwxxfFHNUxLZFrs4OElq/n/FT8bYrucEiF0hHYr GMTCZ/KNPR/rOgk37/g8qlOZuTnbwZGYw4330X6mW0u+HXe9+2DstFsNTMUWRC5Zlnhp dacm8v552hPhVmcajNLPVl2wNArjdXcOAYZqA6u0XM8IP5/5GEpo3P5VwxaDcAes2BAB JiyO4Y4KyWxxxchjJBpvCuqnUnqwx2AUoX8d27hwf1Z8HDQq1I9pIaa2ErivZYa9xidX TeDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="kh9Nd6T/"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ig11-20020a17090b154b00b00253667cf6e4si8284830pjb.20.2023.05.23.04.10.10; Tue, 23 May 2023 04:10:24 -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=@collabora.com header.s=mail header.b="kh9Nd6T/"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235983AbjEWKmn (ORCPT <rfc822;ahmedalshaiji.dev@gmail.com> + 99 others); Tue, 23 May 2023 06:42:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232939AbjEWKmm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 23 May 2023 06:42:42 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 861B8FD for <linux-kernel@vger.kernel.org>; Tue, 23 May 2023 03:42:40 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (unknown [IPv6:2001:b07:2ed:14ed:a962:cd4d:a84:1eab]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 55C266606E75; Tue, 23 May 2023 11:42:38 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1684838559; bh=k5mp+NPuC3+C8fsMCLAcwWhJ5WFcu3o02Q0hZe0dwhM=; h=From:To:Cc:Subject:Date:From; b=kh9Nd6T/8k3VroYVDmlTaX9A4m+npPH+O9zAx3WHJpRFbk+pgK0L0UUpGM3/Fs4Kn OTjzxp0TjpGa0DEVfUchWsh+VDDnBlpQoTHdufvsnfQLl8MaRs/cSywPTY067VrSwe GeFKVBhciJSweTohL+O2FGr8iZYTziU0eqXZPZoPl0DqH2+vTTKEf9/EyTCbQ8SA1X 6NPgp4cGiXEiivriAE7wy6TuQTLRzw1hFpf55St20SMQvlFwbfB6aR2BUu1bqEpMkp /FNhW68+w8IHtHpiYTEI37DjUfqtpA8k4smcp820azJ9sKU/YSNIr52QYtwiTTBvE+ ZWpAw39yMbftQ== From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> To: chunkuang.hu@kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, jitao.shi@mediatek.com, ck.hu@mediatek.com, shaoming.chen@mediatek.com, yt.shen@mediatek.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] drm: mediatek: mtk_dsi: Fix NO_EOT_PACKET settings/handling Date: Tue, 23 May 2023 12:42:34 +0200 Message-Id: <20230523104234.7849-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766683023574764439?= X-GMAIL-MSGID: =?utf-8?q?1766683023574764439?= |
Series |
drm: mediatek: mtk_dsi: Fix NO_EOT_PACKET settings/handling
|
|
Commit Message
AngeloGioacchino Del Regno
May 23, 2023, 10:42 a.m. UTC
Due to the initial confusion about MIPI_DSI_MODE_EOT_PACKET, properly
renamed to MIPI_DSI_MODE_NO_EOT_PACKET, reflecting its actual meaning,
both the DSI_TXRX_CON register setting for bit (HSTX_)DIS_EOT and the
later calculation for horizontal sync-active (HSA), back (HBP) and
front (HFP) porches got incorrect due to the logic being inverted.
This means that a number of settings were wrong because....:
- DSI_TXRX_CON register setting: bit (HSTX_)DIS_EOT should be
set in order to disable the End of Transmission packet;
- Horizontal Sync and Back/Front porches: The delta used to
calculate all of HSA, HBP and HFP should account for the
additional EOT packet.
Before this change...
- Bit (HSTX_)DIS_EOT was being set when EOT packet was enabled;
- For HSA/HBP/HFP delta... all three were wrong, as words were
added when EOT disabled, instead of when EOT packet enabled!
Invert the logic around flag MIPI_DSI_MODE_NO_EOT_PACKET in the
MediaTek DSI driver to fix the aforementioned issues.
Fixes: 8b2b99fd7931 ("drm/mediatek: dsi: Fine tune the line time caused by EOTp")
Fixes: 2d52bfba09d1 ("drm/mediatek: add non-continuous clock mode and EOT packet control")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
drivers/gpu/drm/mediatek/mtk_dsi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Il 23/05/23 12:42, AngeloGioacchino Del Regno ha scritto: > Due to the initial confusion about MIPI_DSI_MODE_EOT_PACKET, properly > renamed to MIPI_DSI_MODE_NO_EOT_PACKET, reflecting its actual meaning, > both the DSI_TXRX_CON register setting for bit (HSTX_)DIS_EOT and the > later calculation for horizontal sync-active (HSA), back (HBP) and > front (HFP) porches got incorrect due to the logic being inverted. > > This means that a number of settings were wrong because....: > - DSI_TXRX_CON register setting: bit (HSTX_)DIS_EOT should be > set in order to disable the End of Transmission packet; > - Horizontal Sync and Back/Front porches: The delta used to > calculate all of HSA, HBP and HFP should account for the > additional EOT packet. > > Before this change... > - Bit (HSTX_)DIS_EOT was being set when EOT packet was enabled; > - For HSA/HBP/HFP delta... all three were wrong, as words were > added when EOT disabled, instead of when EOT packet enabled! > > Invert the logic around flag MIPI_DSI_MODE_NO_EOT_PACKET in the > MediaTek DSI driver to fix the aforementioned issues. > > Fixes: 8b2b99fd7931 ("drm/mediatek: dsi: Fine tune the line time caused by EOTp") > Fixes: 2d52bfba09d1 ("drm/mediatek: add non-continuous clock mode and EOT packet control") > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Gentle ping for an important fix. Regards, Angelo > --- > drivers/gpu/drm/mediatek/mtk_dsi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c > index 7d5250351193..b0ab38e59db9 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c > @@ -407,7 +407,7 @@ static void mtk_dsi_rxtx_control(struct mtk_dsi *dsi) > if (dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) > tmp_reg |= HSTX_CKLP_EN; > > - if (!(dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)) > + if (dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET) > tmp_reg |= DIS_EOT; > > writel(tmp_reg, dsi->regs + DSI_TXRX_CTRL); > @@ -484,7 +484,7 @@ static void mtk_dsi_config_vdo_timing(struct mtk_dsi *dsi) > timing->da_hs_zero + timing->da_hs_exit + 3; > > delta = dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST ? 18 : 12; > - delta += dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET ? 2 : 0; > + delta += dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET ? 0 : 2; > > horizontal_frontporch_byte = vm->hfront_porch * dsi_tmp_buf_bpp; > horizontal_front_back_byte = horizontal_frontporch_byte + horizontal_backporch_byte;
On 23/06/2023 11:47, AngeloGioacchino Del Regno wrote: > Il 23/05/23 12:42, AngeloGioacchino Del Regno ha scritto: >> Due to the initial confusion about MIPI_DSI_MODE_EOT_PACKET, properly >> renamed to MIPI_DSI_MODE_NO_EOT_PACKET, reflecting its actual meaning, >> both the DSI_TXRX_CON register setting for bit (HSTX_)DIS_EOT and the >> later calculation for horizontal sync-active (HSA), back (HBP) and >> front (HFP) porches got incorrect due to the logic being inverted. >> >> This means that a number of settings were wrong because....: >> - DSI_TXRX_CON register setting: bit (HSTX_)DIS_EOT should be >> set in order to disable the End of Transmission packet; >> - Horizontal Sync and Back/Front porches: The delta used to >> calculate all of HSA, HBP and HFP should account for the >> additional EOT packet. >> >> Before this change... >> - Bit (HSTX_)DIS_EOT was being set when EOT packet was enabled; >> - For HSA/HBP/HFP delta... all three were wrong, as words were >> added when EOT disabled, instead of when EOT packet enabled! >> >> Invert the logic around flag MIPI_DSI_MODE_NO_EOT_PACKET in the >> MediaTek DSI driver to fix the aforementioned issues. >> >> Fixes: 8b2b99fd7931 ("drm/mediatek: dsi: Fine tune the line time >> caused by EOTp") >> Fixes: 2d52bfba09d1 ("drm/mediatek: add non-continuous clock mode and >> EOT packet control") >> Signed-off-by: AngeloGioacchino Del Regno >> <angelogioacchino.delregno@collabora.com> > > Gentle ping for an important fix. > > Regards, > Angelo > >> --- >> drivers/gpu/drm/mediatek/mtk_dsi.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c >> b/drivers/gpu/drm/mediatek/mtk_dsi.c >> index 7d5250351193..b0ab38e59db9 100644 >> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c >> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c >> @@ -407,7 +407,7 @@ static void mtk_dsi_rxtx_control(struct mtk_dsi *dsi) >> if (dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) >> tmp_reg |= HSTX_CKLP_EN; >> - if (!(dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)) >> + if (dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET) >> tmp_reg |= DIS_EOT; >> writel(tmp_reg, dsi->regs + DSI_TXRX_CTRL); >> @@ -484,7 +484,7 @@ static void mtk_dsi_config_vdo_timing(struct >> mtk_dsi *dsi) >> timing->da_hs_zero + timing->da_hs_exit + 3; >> delta = dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST ? 18 : 12; >> - delta += dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET ? 2 : 0; >> + delta += dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET ? 0 : 2; >> horizontal_frontporch_byte = vm->hfront_porch * dsi_tmp_buf_bpp; >> horizontal_front_back_byte = horizontal_frontporch_byte + >> horizontal_backporch_byte; > > Sounds logic Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Il 23/06/23 13:29, Alexandre Mergnat ha scritto: > > > On 23/06/2023 11:47, AngeloGioacchino Del Regno wrote: >> Il 23/05/23 12:42, AngeloGioacchino Del Regno ha scritto: >>> Due to the initial confusion about MIPI_DSI_MODE_EOT_PACKET, properly >>> renamed to MIPI_DSI_MODE_NO_EOT_PACKET, reflecting its actual meaning, >>> both the DSI_TXRX_CON register setting for bit (HSTX_)DIS_EOT and the >>> later calculation for horizontal sync-active (HSA), back (HBP) and >>> front (HFP) porches got incorrect due to the logic being inverted. >>> >>> This means that a number of settings were wrong because....: >>> - DSI_TXRX_CON register setting: bit (HSTX_)DIS_EOT should be >>> set in order to disable the End of Transmission packet; >>> - Horizontal Sync and Back/Front porches: The delta used to >>> calculate all of HSA, HBP and HFP should account for the >>> additional EOT packet. >>> >>> Before this change... >>> - Bit (HSTX_)DIS_EOT was being set when EOT packet was enabled; >>> - For HSA/HBP/HFP delta... all three were wrong, as words were >>> added when EOT disabled, instead of when EOT packet enabled! >>> >>> Invert the logic around flag MIPI_DSI_MODE_NO_EOT_PACKET in the >>> MediaTek DSI driver to fix the aforementioned issues. >>> >>> Fixes: 8b2b99fd7931 ("drm/mediatek: dsi: Fine tune the line time caused by EOTp") >>> Fixes: 2d52bfba09d1 ("drm/mediatek: add non-continuous clock mode and EOT packet >>> control") >>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> >> >> Gentle ping for an important fix. >> >> Regards, >> Angelo >> >>> --- >>> drivers/gpu/drm/mediatek/mtk_dsi.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c >>> b/drivers/gpu/drm/mediatek/mtk_dsi.c >>> index 7d5250351193..b0ab38e59db9 100644 >>> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c >>> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c >>> @@ -407,7 +407,7 @@ static void mtk_dsi_rxtx_control(struct mtk_dsi *dsi) >>> if (dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) >>> tmp_reg |= HSTX_CKLP_EN; >>> - if (!(dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)) >>> + if (dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET) >>> tmp_reg |= DIS_EOT; >>> writel(tmp_reg, dsi->regs + DSI_TXRX_CTRL); >>> @@ -484,7 +484,7 @@ static void mtk_dsi_config_vdo_timing(struct mtk_dsi *dsi) >>> timing->da_hs_zero + timing->da_hs_exit + 3; >>> delta = dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST ? 18 : 12; >>> - delta += dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET ? 2 : 0; >>> + delta += dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET ? 0 : 2; >>> horizontal_frontporch_byte = vm->hfront_porch * dsi_tmp_buf_bpp; >>> horizontal_front_back_byte = horizontal_frontporch_byte + >>> horizontal_backporch_byte; >> >> > > Sounds logic > > Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> > Ping again. Regards, Angelo
Hi, Jitao: Do you have any comment? If you have no comment, I would apply this patch. Regards, Chun-Kuang. AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> 於 2023年5月23日 週二 下午6:42寫道: > > Due to the initial confusion about MIPI_DSI_MODE_EOT_PACKET, properly > renamed to MIPI_DSI_MODE_NO_EOT_PACKET, reflecting its actual meaning, > both the DSI_TXRX_CON register setting for bit (HSTX_)DIS_EOT and the > later calculation for horizontal sync-active (HSA), back (HBP) and > front (HFP) porches got incorrect due to the logic being inverted. > > This means that a number of settings were wrong because....: > - DSI_TXRX_CON register setting: bit (HSTX_)DIS_EOT should be > set in order to disable the End of Transmission packet; > - Horizontal Sync and Back/Front porches: The delta used to > calculate all of HSA, HBP and HFP should account for the > additional EOT packet. > > Before this change... > - Bit (HSTX_)DIS_EOT was being set when EOT packet was enabled; > - For HSA/HBP/HFP delta... all three were wrong, as words were > added when EOT disabled, instead of when EOT packet enabled! > > Invert the logic around flag MIPI_DSI_MODE_NO_EOT_PACKET in the > MediaTek DSI driver to fix the aforementioned issues. > > Fixes: 8b2b99fd7931 ("drm/mediatek: dsi: Fine tune the line time caused by EOTp") > Fixes: 2d52bfba09d1 ("drm/mediatek: add non-continuous clock mode and EOT packet control") > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> > --- > drivers/gpu/drm/mediatek/mtk_dsi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c > index 7d5250351193..b0ab38e59db9 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c > @@ -407,7 +407,7 @@ static void mtk_dsi_rxtx_control(struct mtk_dsi *dsi) > if (dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) > tmp_reg |= HSTX_CKLP_EN; > > - if (!(dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)) > + if (dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET) > tmp_reg |= DIS_EOT; > > writel(tmp_reg, dsi->regs + DSI_TXRX_CTRL); > @@ -484,7 +484,7 @@ static void mtk_dsi_config_vdo_timing(struct mtk_dsi *dsi) > timing->da_hs_zero + timing->da_hs_exit + 3; > > delta = dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST ? 18 : 12; > - delta += dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET ? 2 : 0; > + delta += dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET ? 0 : 2; > > horizontal_frontporch_byte = vm->hfront_porch * dsi_tmp_buf_bpp; > horizontal_front_back_byte = horizontal_frontporch_byte + horizontal_backporch_byte; > -- > 2.40.1 >
> Due to the initial confusion about MIPI_DSI_MODE_EOT_PACKET, properly > renamed to MIPI_DSI_MODE_NO_EOT_PACKET, reflecting its actual meaning, > both the DSI_TXRX_CON register setting for bit (HSTX_)DIS_EOT and the > later calculation for horizontal sync-active (HSA), back (HBP) and > front (HFP) porches got incorrect due to the logic being inverted. > > This means that a number of settings were wrong because....: > - DSI_TXRX_CON register setting: bit (HSTX_)DIS_EOT should be > set in order to disable the End of Transmission packet; > - Horizontal Sync and Back/Front porches: The delta used to > calculate all of HSA, HBP and HFP should account for the > additional EOT packet. > > Before this change... > - Bit (HSTX_)DIS_EOT was being set when EOT packet was enabled; > - For HSA/HBP/HFP delta... all three were wrong, as words were > added when EOT disabled, instead of when EOT packet enabled! > > Invert the logic around flag MIPI_DSI_MODE_NO_EOT_PACKET in the > MediaTek DSI driver to fix the aforementioned issues. > > Fixes: 8b2b99fd7931 ("drm/mediatek: dsi: Fine tune the line time caused by EOTp") > Fixes: 2d52bfba09d1 ("drm/mediatek: add non-continuous clock mode and EOT packet control") > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: Michael Walle <mwalle@kernel.org> Thanks, -michael
Il 15/09/23 12:11, Michael Walle ha scritto: >> Due to the initial confusion about MIPI_DSI_MODE_EOT_PACKET, properly >> renamed to MIPI_DSI_MODE_NO_EOT_PACKET, reflecting its actual meaning, >> both the DSI_TXRX_CON register setting for bit (HSTX_)DIS_EOT and the >> later calculation for horizontal sync-active (HSA), back (HBP) and >> front (HFP) porches got incorrect due to the logic being inverted. >> >> This means that a number of settings were wrong because....: >> - DSI_TXRX_CON register setting: bit (HSTX_)DIS_EOT should be >> set in order to disable the End of Transmission packet; >> - Horizontal Sync and Back/Front porches: The delta used to >> calculate all of HSA, HBP and HFP should account for the >> additional EOT packet. >> >> Before this change... >> - Bit (HSTX_)DIS_EOT was being set when EOT packet was enabled; >> - For HSA/HBP/HFP delta... all three were wrong, as words were >> added when EOT disabled, instead of when EOT packet enabled! >> >> Invert the logic around flag MIPI_DSI_MODE_NO_EOT_PACKET in the >> MediaTek DSI driver to fix the aforementioned issues. >> >> Fixes: 8b2b99fd7931 ("drm/mediatek: dsi: Fine tune the line time caused by EOTp") >> Fixes: 2d52bfba09d1 ("drm/mediatek: add non-continuous clock mode and EOT packet control") >> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> > Hello CK, can you please pick this fix? Thanks, Angelo
Hi, Angelo: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> 於 2023年10月18日 週三 下午6:21寫道: > > Il 15/09/23 12:11, Michael Walle ha scritto: > >> Due to the initial confusion about MIPI_DSI_MODE_EOT_PACKET, properly > >> renamed to MIPI_DSI_MODE_NO_EOT_PACKET, reflecting its actual meaning, > >> both the DSI_TXRX_CON register setting for bit (HSTX_)DIS_EOT and the > >> later calculation for horizontal sync-active (HSA), back (HBP) and > >> front (HFP) porches got incorrect due to the logic being inverted. > >> > >> This means that a number of settings were wrong because....: > >> - DSI_TXRX_CON register setting: bit (HSTX_)DIS_EOT should be > >> set in order to disable the End of Transmission packet; > >> - Horizontal Sync and Back/Front porches: The delta used to > >> calculate all of HSA, HBP and HFP should account for the > >> additional EOT packet. > >> > >> Before this change... > >> - Bit (HSTX_)DIS_EOT was being set when EOT packet was enabled; > >> - For HSA/HBP/HFP delta... all three were wrong, as words were > >> added when EOT disabled, instead of when EOT packet enabled! > >> > >> Invert the logic around flag MIPI_DSI_MODE_NO_EOT_PACKET in the > >> MediaTek DSI driver to fix the aforementioned issues. > >> > >> Fixes: 8b2b99fd7931 ("drm/mediatek: dsi: Fine tune the line time caused by EOTp") > >> Fixes: 2d52bfba09d1 ("drm/mediatek: add non-continuous clock mode and EOT packet control") > >> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> > > > > Hello CK, > > can you please pick this fix? Applied with the changing Fixes: 2d52bfba09d1 ("drm/mediatek: add non-continuous clock mode and EOT packet control") to Fixes: c87d1c4b5b9a ("drm/mediatek: dsi: Use symbolized register definition") Regards, Chun-Kuang. > > Thanks, > Angelo >
diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index 7d5250351193..b0ab38e59db9 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -407,7 +407,7 @@ static void mtk_dsi_rxtx_control(struct mtk_dsi *dsi) if (dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) tmp_reg |= HSTX_CKLP_EN; - if (!(dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)) + if (dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET) tmp_reg |= DIS_EOT; writel(tmp_reg, dsi->regs + DSI_TXRX_CTRL); @@ -484,7 +484,7 @@ static void mtk_dsi_config_vdo_timing(struct mtk_dsi *dsi) timing->da_hs_zero + timing->da_hs_exit + 3; delta = dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST ? 18 : 12; - delta += dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET ? 2 : 0; + delta += dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET ? 0 : 2; horizontal_frontporch_byte = vm->hfront_porch * dsi_tmp_buf_bpp; horizontal_front_back_byte = horizontal_frontporch_byte + horizontal_backporch_byte;