Skip to content

Commit 053d231

Browse files
Dafna HirschfeldChun-Kuang Hu
authored andcommitted
drm/mediatek: Switch the hdmi bridge ops to the atomic versions
The bridge operation '.enable' and the audio cb '.get_eld' access hdmi->conn. In the future we will want to support the flag DRM_BRIDGE_ATTACH_NO_CONNECTOR and then we will not have direct access to the connector. The atomic version '.atomic_enable' allows accessing the current connector from the state. This patch switches the bridge to the atomic version to prepare access to the connector in later patches. Signed-off-by: Dafna Hirschfeld <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent fdcbe17 commit 053d231

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

drivers/gpu/drm/mediatek/mtk_hdmi.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,8 @@ static bool mtk_hdmi_bridge_mode_fixup(struct drm_bridge *bridge,
13571357
return true;
13581358
}
13591359

1360-
static void mtk_hdmi_bridge_disable(struct drm_bridge *bridge)
1360+
static void mtk_hdmi_bridge_atomic_disable(struct drm_bridge *bridge,
1361+
struct drm_bridge_state *old_bridge_state)
13611362
{
13621363
struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge);
13631364

@@ -1371,7 +1372,8 @@ static void mtk_hdmi_bridge_disable(struct drm_bridge *bridge)
13711372
hdmi->enabled = false;
13721373
}
13731374

1374-
static void mtk_hdmi_bridge_post_disable(struct drm_bridge *bridge)
1375+
static void mtk_hdmi_bridge_atomic_post_disable(struct drm_bridge *bridge,
1376+
struct drm_bridge_state *old_state)
13751377
{
13761378
struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge);
13771379

@@ -1406,7 +1408,8 @@ static void mtk_hdmi_bridge_mode_set(struct drm_bridge *bridge,
14061408
drm_mode_copy(&hdmi->mode, adjusted_mode);
14071409
}
14081410

1409-
static void mtk_hdmi_bridge_pre_enable(struct drm_bridge *bridge)
1411+
static void mtk_hdmi_bridge_atomic_pre_enable(struct drm_bridge *bridge,
1412+
struct drm_bridge_state *old_state)
14101413
{
14111414
struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge);
14121415

@@ -1426,7 +1429,8 @@ static void mtk_hdmi_send_infoframe(struct mtk_hdmi *hdmi,
14261429
mtk_hdmi_setup_vendor_specific_infoframe(hdmi, mode);
14271430
}
14281431

1429-
static void mtk_hdmi_bridge_enable(struct drm_bridge *bridge)
1432+
static void mtk_hdmi_bridge_atomic_enable(struct drm_bridge *bridge,
1433+
struct drm_bridge_state *old_state)
14301434
{
14311435
struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge);
14321436

@@ -1440,13 +1444,16 @@ static void mtk_hdmi_bridge_enable(struct drm_bridge *bridge)
14401444
}
14411445

14421446
static const struct drm_bridge_funcs mtk_hdmi_bridge_funcs = {
1447+
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
1448+
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
1449+
.atomic_reset = drm_atomic_helper_bridge_reset,
14431450
.attach = mtk_hdmi_bridge_attach,
14441451
.mode_fixup = mtk_hdmi_bridge_mode_fixup,
1445-
.disable = mtk_hdmi_bridge_disable,
1446-
.post_disable = mtk_hdmi_bridge_post_disable,
1452+
.atomic_disable = mtk_hdmi_bridge_atomic_disable,
1453+
.atomic_post_disable = mtk_hdmi_bridge_atomic_post_disable,
14471454
.mode_set = mtk_hdmi_bridge_mode_set,
1448-
.pre_enable = mtk_hdmi_bridge_pre_enable,
1449-
.enable = mtk_hdmi_bridge_enable,
1455+
.atomic_pre_enable = mtk_hdmi_bridge_atomic_pre_enable,
1456+
.atomic_enable = mtk_hdmi_bridge_atomic_enable,
14501457
};
14511458

14521459
static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,

0 commit comments

Comments
 (0)