Skip to content

Commit 3d97dc0

Browse files
committed
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>
1 parent bcd6808 commit 3d97dc0

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,13 @@ static int cdns_dsi_mode2cfg(struct cdns_dsi *dsi,
498498
dsi_cfg->hfp = dpi_to_dsi_timing(mode->hsync_start - mode->hdisplay,
499499
bpp, DSI_HFP_FRAME_OVERHEAD);
500500

501+
dsi_cfg->htotal = dsi_cfg->hbp + DSI_HBP_FRAME_OVERHEAD;
502+
if (output->dev->mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE)
503+
dsi_cfg->htotal += dsi_cfg->hsa + DSI_HSA_FRAME_OVERHEAD;
504+
505+
dsi_cfg->htotal += dsi_cfg->hact;
506+
dsi_cfg->htotal += dsi_cfg->hfp + DSI_HFP_FRAME_OVERHEAD;
507+
501508
return 0;
502509
}
503510

@@ -514,12 +521,7 @@ static int cdns_dsi_adjust_phy_config(struct cdns_dsi *dsi,
514521
unsigned int dsi_hfp_ext;
515522
unsigned int lanes = output->dev->lanes;
516523

517-
dsi_htotal = dsi_cfg->hbp + DSI_HBP_FRAME_OVERHEAD;
518-
if (output->dev->mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE)
519-
dsi_htotal += dsi_cfg->hsa + DSI_HSA_FRAME_OVERHEAD;
520-
521-
dsi_htotal += dsi_cfg->hact;
522-
dsi_htotal += dsi_cfg->hfp + DSI_HFP_FRAME_OVERHEAD;
524+
dsi_htotal = dsi_cfg->htotal;
523525

524526
/*
525527
* Make sure DSI htotal is aligned on a lane boundary when calculating

0 commit comments

Comments
 (0)