Skip to content

Commit 5855d42

Browse files
AngeloGioacchino Del RegnoChun-Kuang Hu
authored andcommitted
drm: mediatek: mtk_dsi: Fix NO_EOT_PACKET settings/handling
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: 8b2b99f ("drm/mediatek: dsi: Fine tune the line time caused by EOTp") Fixes: c87d1c4 ("drm/mediatek: dsi: Use symbolized register definition") Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Tested-by: Michael Walle <mwalle@kernel.org> Link: https://patchwork.kernel.org/project/dri-devel/patch/20230523104234.7849-1-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
1 parent 3f86604 commit 5855d42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/mediatek/mtk_dsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ static void mtk_dsi_rxtx_control(struct mtk_dsi *dsi)
409409
if (dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS)
410410
tmp_reg |= HSTX_CKLP_EN;
411411

412-
if (!(dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET))
412+
if (dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)
413413
tmp_reg |= DIS_EOT;
414414

415415
writel(tmp_reg, dsi->regs + DSI_TXRX_CTRL);
@@ -486,7 +486,7 @@ static void mtk_dsi_config_vdo_timing(struct mtk_dsi *dsi)
486486
timing->da_hs_zero + timing->da_hs_exit + 3;
487487

488488
delta = dsi->mode_flags & MIPI_DSI_MODE_VIDEO_BURST ? 18 : 12;
489-
delta += dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET ? 2 : 0;
489+
delta += dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET ? 0 : 2;
490490

491491
horizontal_frontporch_byte = vm->hfront_porch * dsi_tmp_buf_bpp;
492492
horizontal_front_back_byte = horizontal_frontporch_byte + horizontal_backporch_byte;

0 commit comments

Comments
 (0)