summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2025-07-23 13:05:14 +0300
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2025-08-13 10:20:37 +0300
commit3d97dc02a0869d2c8cff8ebb480c44ceff188157 (patch)
treed32ed57d7d57d52f45a9e0c3f95b8366e2db0356 /drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
parentbcd6808aff4029a7df690cf4c9911e5cc826098d (diff)
drm/bridge: cdns-dsi: Update htotal in cdns_dsi_mode2cfg()
cdns_dsi_mode2cfg() calculates the dsi timings, but for some reason doesn't set the htotal based on those timings. It is set only later, in cdns_dsi_adjust_phy_config(). As cdns_dsi_mode2cfg() is the logical place to calculate it, let's move it there. Especially as the following patch will remove cdns_dsi_adjust_phy_config(). Reviewed-by: Aradhya Bhatia <aradhya.bhatia@linux.dev> Tested-by: Parth Pancholi <parth.pancholi@toradex.com> Tested-by: Jayesh Choudhary <j-choudhary@ti.com> Reviewed-by: Devarsh Thakkar <devarsht@ti.com> Link: https://lore.kernel.org/r/20250723-cdns-dsi-impro-v5-8-e61cc06074c2@ideasonboard.com Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c')
-rw-r--r--drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
index b2b6529b1c70..7103878df1e7 100644
--- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
+++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
@@ -498,6 +498,13 @@ static int cdns_dsi_mode2cfg(struct cdns_dsi *dsi,
dsi_cfg->hfp = dpi_to_dsi_timing(mode->hsync_start - mode->hdisplay,
bpp, DSI_HFP_FRAME_OVERHEAD);
+ dsi_cfg->htotal = dsi_cfg->hbp + DSI_HBP_FRAME_OVERHEAD;
+ if (output->dev->mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE)
+ dsi_cfg->htotal += dsi_cfg->hsa + DSI_HSA_FRAME_OVERHEAD;
+
+ dsi_cfg->htotal += dsi_cfg->hact;
+ dsi_cfg->htotal += dsi_cfg->hfp + DSI_HFP_FRAME_OVERHEAD;
+
return 0;
}
@@ -514,12 +521,7 @@ static int cdns_dsi_adjust_phy_config(struct cdns_dsi *dsi,
unsigned int dsi_hfp_ext;
unsigned int lanes = output->dev->lanes;
- dsi_htotal = dsi_cfg->hbp + DSI_HBP_FRAME_OVERHEAD;
- if (output->dev->mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE)
- dsi_htotal += dsi_cfg->hsa + DSI_HSA_FRAME_OVERHEAD;
-
- dsi_htotal += dsi_cfg->hact;
- dsi_htotal += dsi_cfg->hfp + DSI_HFP_FRAME_OVERHEAD;
+ dsi_htotal = dsi_cfg->htotal;
/*
* Make sure DSI htotal is aligned on a lane boundary when calculating