Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/kmb: Enable ADV bridge after modeset

On KMB, ADV bridge must be programmed and powered on prior to
MIPI DSI HW initialization.

v2: changed to atomic_bridge_chain_enable (Sam)

Fixes: 98521f4d4b4c ("drm/kmb: Mipi DSI part of the display driver")
Co-developed-by: Edmund Dea <edmund.j.dea@intel.com>
Signed-off-by: Edmund Dea <edmund.j.dea@intel.com>
Signed-off-by: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211019230719.789958-1-anitha.chrisanthus@intel.com
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

authored by

Anitha Chrisanthus and committed by
Maarten Lankhorst
74056092 004d2719

+10 -8
+4 -3
drivers/gpu/drm/kmb/kmb_crtc.c
··· 66 66 .disable_vblank = kmb_crtc_disable_vblank, 67 67 }; 68 68 69 - static void kmb_crtc_set_mode(struct drm_crtc *crtc) 69 + static void kmb_crtc_set_mode(struct drm_crtc *crtc, 70 + struct drm_atomic_state *old_state) 70 71 { 71 72 struct drm_device *dev = crtc->dev; 72 73 struct drm_display_mode *m = &crtc->state->adjusted_mode; ··· 76 75 unsigned int val = 0; 77 76 78 77 /* Initialize mipi */ 79 - kmb_dsi_mode_set(kmb->kmb_dsi, m, kmb->sys_clk_mhz); 78 + kmb_dsi_mode_set(kmb->kmb_dsi, m, kmb->sys_clk_mhz, old_state); 80 79 drm_info(dev, 81 80 "vfp= %d vbp= %d vsync_len=%d hfp=%d hbp=%d hsync_len=%d\n", 82 81 m->crtc_vsync_start - m->crtc_vdisplay, ··· 139 138 struct kmb_drm_private *kmb = crtc_to_kmb_priv(crtc); 140 139 141 140 clk_prepare_enable(kmb->kmb_clk.clk_lcd); 142 - kmb_crtc_set_mode(crtc); 141 + kmb_crtc_set_mode(crtc, state); 143 142 drm_crtc_vblank_on(crtc); 144 143 } 145 144
+5 -4
drivers/gpu/drm/kmb/kmb_dsi.c
··· 1331 1331 return 0; 1332 1332 } 1333 1333 1334 - static void connect_lcd_to_mipi(struct kmb_dsi *kmb_dsi) 1334 + static void connect_lcd_to_mipi(struct kmb_dsi *kmb_dsi, 1335 + struct drm_atomic_state *old_state) 1335 1336 { 1336 1337 struct regmap *msscam; 1337 1338 ··· 1341 1340 dev_dbg(kmb_dsi->dev, "failed to get msscam syscon"); 1342 1341 return; 1343 1342 } 1344 - 1343 + drm_atomic_bridge_chain_enable(adv_bridge, old_state); 1345 1344 /* DISABLE MIPI->CIF CONNECTION */ 1346 1345 regmap_write(msscam, MSS_MIPI_CIF_CFG, 0); 1347 1346 ··· 1352 1351 } 1353 1352 1354 1353 int kmb_dsi_mode_set(struct kmb_dsi *kmb_dsi, struct drm_display_mode *mode, 1355 - int sys_clk_mhz) 1354 + int sys_clk_mhz, struct drm_atomic_state *old_state) 1356 1355 { 1357 1356 u64 data_rate; 1358 1357 ··· 1400 1399 /* Dphy initialization */ 1401 1400 mipi_tx_init_dphy(kmb_dsi, &mipi_tx_init_cfg); 1402 1401 1403 - connect_lcd_to_mipi(kmb_dsi); 1402 + connect_lcd_to_mipi(kmb_dsi, old_state); 1404 1403 dev_info(kmb_dsi->dev, "mipi hw initialized"); 1405 1404 1406 1405 return 0;
+1 -1
drivers/gpu/drm/kmb/kmb_dsi.h
··· 380 380 struct kmb_dsi *kmb_dsi_init(struct platform_device *pdev); 381 381 void kmb_dsi_host_unregister(struct kmb_dsi *kmb_dsi); 382 382 int kmb_dsi_mode_set(struct kmb_dsi *kmb_dsi, struct drm_display_mode *mode, 383 - int sys_clk_mhz); 383 + int sys_clk_mhz, struct drm_atomic_state *old_state); 384 384 int kmb_dsi_map_mmio(struct kmb_dsi *kmb_dsi); 385 385 int kmb_dsi_clk_init(struct kmb_dsi *kmb_dsi); 386 386 int kmb_dsi_encoder_init(struct drm_device *dev, struct kmb_dsi *kmb_dsi);