drm: exynos: dsi: Fix MIPI_DSI*_NO_* mode flags
Subsystems (5)
PATCH v10 1/2 drm: exynos: dsi: Fix MIPI_DSI*_NO_* mode flags
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.
This patch is trying to fix this MIPI_DSI*_NO_* mode flags handling Exynos DSI host and update the mode_flags in relevant panel drivers.
Fixes: <0f3b68b66a6d> ("drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling features")
---
Changes for v10:
- add Marek V review tag
- add panel driver fixes
Changes for v9:
- none
drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 ++++---- drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 4 +++- drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c | 3 ++- drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c | 2 -- 4 files changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dsi.c +4 -4
@@ -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) {
drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c +3 -1
@@ -692,7 +692,9 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi) dsi->lanes =4 ; dsi->format =MIPI_DSI_FMT_RGB888 ; - dsi->mode_flags =MIPI_DSI_CLOCK_NON_CONTINUOUS ; + dsi->mode_flags =MIPI_DSI_CLOCK_NON_CONTINUOUS | +MIPI_DSI_MODE_VIDEO_NO_HFP |MIPI_DSI_MODE_VIDEO_NO_HBP | +MIPI_DSI_MODE_VIDEO_NO_HSA |MIPI_DSI_MODE_NO_EOT_PACKET ; ctx->supplies[0 ].supply ="vdd3" ; ctx->supplies[1 ].supply ="vci" ;
drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c +2 -1
@@ -446,7 +446,8 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi) dsi->lanes =1 ; dsi->format =MIPI_DSI_FMT_RGB888 ; - dsi->mode_flags =MIPI_DSI_MODE_NO_EOT_PACKET ; + dsi->mode_flags =MIPI_DSI_MODE_VIDEO_NO_HFP | +MIPI_DSI_MODE_VIDEO_NO_HBP |MIPI_DSI_MODE_VIDEO_NO_HSA ; ctx->supplies[0 ].supply ="vdd3" ; ctx->supplies[1 ].supply ="vci" ;
drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c +0 -2
@@ -990,8 +990,6 @@ static int s6e8aa0_probe(struct mipi_dsi_device *dsi) dsi->lanes =4 ; dsi->format =MIPI_DSI_FMT_RGB888 ; dsi->mode_flags =MIPI_DSI_MODE_VIDEO |MIPI_DSI_MODE_VIDEO_BURST - |MIPI_DSI_MODE_VIDEO_NO_HFP |MIPI_DSI_MODE_VIDEO_NO_HBP - |MIPI_DSI_MODE_VIDEO_NO_HSA |MIPI_DSI_MODE_NO_EOT_PACKET |MIPI_DSI_MODE_VSYNC_FLUSH |MIPI_DSI_MODE_VIDEO_AUTO_VERT ; ret =s6e8aa0_parse_dt (ctx);
Signature · 1 line
2.25.1
PATCH v10 2/2 drm: exynos: dsi: Properly name HSA/HBP/HFP/HSE bits
HSA/HBP/HFP/HSE mode bits in Processor Reference Manuals specify a naming conversion as 'disable mode bit' due to its bit definition, 0 = Enable and 1 = Disable.
For HSE bit, the i.MX 8M Mini/Nano/Plus Applications Processor Reference Manual named this bit as 'HseDisableMode' but the bit definition is quite opposite like
0 = Disables transfer
1 = Enables transfer
which clearly states that HSE is not a disable bit.
HSE is named as per the manual even though it is not a disable bit however the driver logic for handling HSE is based on the MIPI_DSI_MODE_VIDEO_HSE flag itself.
---
Changes for v10:
- add Marek V review tag
Changes for v9:
- new patch
drivers/gpu/drm/exynos/exynos_drm_dsi.c | 33 +++++++++++++++++++------ 1 file changed, 25 insertions(+), 8 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dsi.c +25 -8
@@ -75,10 +75,27 @@#define DSIM_MAIN_PIX_FORMAT_RGB565 (0x4 << 12)#define DSIM_SUB_VC (((x) & 0x3) << 16)#define DSIM_MAIN_VC (((x) & 0x3) << 18) -#define DSIM_HSA_MODE (1 << 20) -#define DSIM_HBP_MODE (1 << 21) -#define DSIM_HFP_MODE (1 << 22) -#define DSIM_HSE_MODE (1 << 23) +#define DSIM_HSA_DISABLE_MODE (1 << 20) +#define DSIM_HBP_DISABLE_MODE (1 << 21) +#define DSIM_HFP_DISABLE_MODE (1 << 22) +/* +* The i.MX 8M Mini Applications Processor Reference Manual, +* Rev. 3, 11/2020 Page 4091 +* The i.MX 8M Nano Applications Processor Reference Manual, +* Rev. 2, 07/2022 Page 3058 +* The i.MX 8M Plus Applications Processor Reference Manual, +* Rev. 1, 06/2021 Page 5436 +* named this bit as 'HseDisableMode' but the bit definition +* is quite opposite like +* 0 = Disables transfer +* 1 = Enables transfer +* which clearly states that HSE is not a disable bit. +* +* This bit is named as per the manual even though it is not +* a disable bit however the driver logic for handling HSE +* is based on the MIPI_DSI_MODE_VIDEO_HSE flag itself. +*/ +#define DSIM_HSE_DISABLE_MODE (1 << 23)#define DSIM_AUTO_MODE (1 << 24)#define DSIM_VIDEO_MODE (1 << 25)#define DSIM_BURST_MODE (1 << 26)
@@ -804,13 +821,13 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi)if (dsi->mode_flags &MIPI_DSI_MODE_VIDEO_AUTO_VERT ) reg |=DSIM_AUTO_MODE ;if (dsi->mode_flags &MIPI_DSI_MODE_VIDEO_HSE ) - reg |=DSIM_HSE_MODE ; + reg |=DSIM_HSE_DISABLE_MODE ;if (dsi->mode_flags &MIPI_DSI_MODE_VIDEO_NO_HFP ) - reg |=DSIM_HFP_MODE ; + reg |=DSIM_HFP_DISABLE_MODE ;if (dsi->mode_flags &MIPI_DSI_MODE_VIDEO_NO_HBP ) - reg |=DSIM_HBP_MODE ; + reg |=DSIM_HBP_DISABLE_MODE ;if (dsi->mode_flags &MIPI_DSI_MODE_VIDEO_NO_HSA ) - reg |=DSIM_HSA_MODE ; + reg |=DSIM_HSA_DISABLE_MODE ; }if (dsi->mode_flags &MIPI_DSI_MODE_NO_EOT_PACKET )
Signature · 1 line
2.25.1
Re: [PATCH v10 2/2] drm: exynos: dsi: Properly name HSA/HBP/HFP/HSE bits
Quoted 11 lines · Jagan Teki
HSA/HBP/HFP/HSE mode bits in Processor Reference Manuals specify a naming conversion as 'disable mode bit' due to its bit definition, 0 = Enable and 1 = Disable.
For HSE bit, the i.MX 8M Mini/Nano/Plus Applications Processor Reference Manual named this bit as 'HseDisableMode' but the bit definition is quite opposite like
0 = Disables transfer
1 = Enables transfer
which clearly states that HSE is not a disable bit.
Quoted 7 lines
HSE is named as per the manual even though it is not a disable bit however the driver logic for handling HSE is based on the
MIPI_DSI_MODE_VIDEO_HSEflag itself.Cc Nicolas Boichat <[email protected]>Reviewed-by Marek Vasut <[email protected]>Signed-off-by Jagan Teki <[email protected]>
Quoted 9 lines · Jagan Teki
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.
This patch is trying to fix this MIPI_DSI*_NO_* mode flags handling Exynos DSI host and update the
mode_flagsin relevant panel drivers.
Quoted 6 lines
Fixes: <
0f3b68b66a6d> ("drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling features")Reviewed-by Marek Vasut <[email protected]>Reviewed-by Nicolas Boichat <[email protected]>Reported-by Sébastien Szymanski <[email protected]>Signed-off-by Jagan Teki <[email protected]>
Quoted 10 lines · Jagan Teki
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.
This patch is trying to fix this MIPI_DSI*_NO_* mode flags handling Exynos DSI host and update the
mode_flagsin relevant panel drivers.
Quoted 7 lines
Fixes: <
0f3b68b66a6d> ("drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling features")Reviewed-by Marek Vasut <[email protected]>Reviewed-by Nicolas Boichat <[email protected]>Reported-by Sébastien Szymanski <[email protected]>Signed-off-by Jagan Teki <[email protected]>---
Any update on this?