Skip to content

Commit 7405609

Browse files
achrisanmlankhorst
authored andcommitted
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: 98521f4 ("drm/kmb: Mipi DSI part of the display driver") Co-developed-by: Edmund Dea <[email protected]> Signed-off-by: Edmund Dea <[email protected]> Signed-off-by: Anitha Chrisanthus <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Acked-by: Sam Ravnborg <[email protected]> Signed-off-by: Maarten Lankhorst <[email protected]>
1 parent 004d271 commit 7405609

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

drivers/gpu/drm/kmb/kmb_crtc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ static const struct drm_crtc_funcs kmb_crtc_funcs = {
6666
.disable_vblank = kmb_crtc_disable_vblank,
6767
};
6868

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)
7071
{
7172
struct drm_device *dev = crtc->dev;
7273
struct drm_display_mode *m = &crtc->state->adjusted_mode;
@@ -75,7 +76,7 @@ static void kmb_crtc_set_mode(struct drm_crtc *crtc)
7576
unsigned int val = 0;
7677

7778
/* Initialize mipi */
78-
kmb_dsi_mode_set(kmb->kmb_dsi, m, kmb->sys_clk_mhz);
79+
kmb_dsi_mode_set(kmb->kmb_dsi, m, kmb->sys_clk_mhz, old_state);
7980
drm_info(dev,
8081
"vfp= %d vbp= %d vsync_len=%d hfp=%d hbp=%d hsync_len=%d\n",
8182
m->crtc_vsync_start - m->crtc_vdisplay,
@@ -138,7 +139,7 @@ static void kmb_crtc_atomic_enable(struct drm_crtc *crtc,
138139
struct kmb_drm_private *kmb = crtc_to_kmb_priv(crtc);
139140

140141
clk_prepare_enable(kmb->kmb_clk.clk_lcd);
141-
kmb_crtc_set_mode(crtc);
142+
kmb_crtc_set_mode(crtc, state);
142143
drm_crtc_vblank_on(crtc);
143144
}
144145

drivers/gpu/drm/kmb/kmb_dsi.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,8 @@ static u32 mipi_tx_init_dphy(struct kmb_dsi *kmb_dsi,
13311331
return 0;
13321332
}
13331333

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)
13351336
{
13361337
struct regmap *msscam;
13371338

@@ -1340,7 +1341,7 @@ static void connect_lcd_to_mipi(struct kmb_dsi *kmb_dsi)
13401341
dev_dbg(kmb_dsi->dev, "failed to get msscam syscon");
13411342
return;
13421343
}
1343-
1344+
drm_atomic_bridge_chain_enable(adv_bridge, old_state);
13441345
/* DISABLE MIPI->CIF CONNECTION */
13451346
regmap_write(msscam, MSS_MIPI_CIF_CFG, 0);
13461347

@@ -1351,7 +1352,7 @@ static void connect_lcd_to_mipi(struct kmb_dsi *kmb_dsi)
13511352
}
13521353

13531354
int kmb_dsi_mode_set(struct kmb_dsi *kmb_dsi, struct drm_display_mode *mode,
1354-
int sys_clk_mhz)
1355+
int sys_clk_mhz, struct drm_atomic_state *old_state)
13551356
{
13561357
u64 data_rate;
13571358

@@ -1399,7 +1400,7 @@ int kmb_dsi_mode_set(struct kmb_dsi *kmb_dsi, struct drm_display_mode *mode,
13991400
/* Dphy initialization */
14001401
mipi_tx_init_dphy(kmb_dsi, &mipi_tx_init_cfg);
14011402

1402-
connect_lcd_to_mipi(kmb_dsi);
1403+
connect_lcd_to_mipi(kmb_dsi, old_state);
14031404
dev_info(kmb_dsi->dev, "mipi hw initialized");
14041405

14051406
return 0;

drivers/gpu/drm/kmb/kmb_dsi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ int kmb_dsi_host_bridge_init(struct device *dev);
380380
struct kmb_dsi *kmb_dsi_init(struct platform_device *pdev);
381381
void kmb_dsi_host_unregister(struct kmb_dsi *kmb_dsi);
382382
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);
384384
int kmb_dsi_map_mmio(struct kmb_dsi *kmb_dsi);
385385
int kmb_dsi_clk_init(struct kmb_dsi *kmb_dsi);
386386
int kmb_dsi_encoder_init(struct drm_device *dev, struct kmb_dsi *kmb_dsi);

0 commit comments

Comments
 (0)