Skip to content

Commit 6d5ebad

Browse files
bivvyrkhuangtao
authored andcommitted
drm/rockchip: dsi: fix loader protect for dual-channel mode
Change-Id: I2d5111269393b1eb77f9fccfa28b20fe366ad7d6 Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
1 parent 1e23e1d commit 6d5ebad

1 file changed

Lines changed: 25 additions & 23 deletions

File tree

drivers/gpu/drm/rockchip/dw-mipi-dsi.c

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,13 +1143,6 @@ static void dw_mipi_dsi_encoder_disable(struct drm_encoder *encoder)
11431143
dw_mipi_dsi_post_disable(dsi);
11441144
}
11451145

1146-
static bool dw_mipi_dsi_encoder_mode_fixup(struct drm_encoder *encoder,
1147-
const struct drm_display_mode *mode,
1148-
struct drm_display_mode *adjusted_mode)
1149-
{
1150-
return true;
1151-
}
1152-
11531146
static void dw_mipi_dsi_pre_init(struct dw_mipi_dsi *dsi)
11541147
{
11551148
if (dsi->dphy.phy)
@@ -1277,9 +1270,33 @@ dw_mipi_dsi_encoder_atomic_check(struct drm_encoder *encoder,
12771270
return 0;
12781271
}
12791272

1273+
static int dw_mipi_dsi_loader_protect(struct dw_mipi_dsi *dsi, bool on)
1274+
{
1275+
if (on)
1276+
pm_runtime_get_sync(dsi->dev);
1277+
else
1278+
pm_runtime_put(dsi->dev);
1279+
1280+
if (dsi->slave)
1281+
dw_mipi_dsi_loader_protect(dsi->slave, on);
1282+
1283+
return 0;
1284+
}
1285+
1286+
static int dw_mipi_dsi_encoder_loader_protect(struct drm_encoder *encoder,
1287+
bool on)
1288+
{
1289+
struct dw_mipi_dsi *dsi = encoder_to_dsi(encoder);
1290+
1291+
if (dsi->panel)
1292+
drm_panel_loader_protect(dsi->panel, on);
1293+
1294+
return dw_mipi_dsi_loader_protect(dsi, on);
1295+
}
1296+
12801297
static const struct drm_encoder_helper_funcs
12811298
dw_mipi_dsi_encoder_helper_funcs = {
1282-
.mode_fixup = dw_mipi_dsi_encoder_mode_fixup,
1299+
.loader_protect = dw_mipi_dsi_encoder_loader_protect,
12831300
.mode_set = dw_mipi_dsi_encoder_mode_set,
12841301
.enable = dw_mipi_dsi_encoder_enable,
12851302
.disable = dw_mipi_dsi_encoder_disable,
@@ -1305,23 +1322,8 @@ static struct drm_encoder *dw_mipi_dsi_connector_best_encoder(
13051322
return &dsi->encoder;
13061323
}
13071324

1308-
static int dw_mipi_loader_protect(struct drm_connector *connector, bool on)
1309-
{
1310-
struct dw_mipi_dsi *dsi = con_to_dsi(connector);
1311-
1312-
if (dsi->panel)
1313-
drm_panel_loader_protect(dsi->panel, on);
1314-
if (on)
1315-
pm_runtime_get_sync(dsi->dev);
1316-
else
1317-
pm_runtime_put(dsi->dev);
1318-
1319-
return 0;
1320-
}
1321-
13221325
static const struct drm_connector_helper_funcs
13231326
dw_mipi_dsi_connector_helper_funcs = {
1324-
.loader_protect = dw_mipi_loader_protect,
13251327
.get_modes = dw_mipi_dsi_connector_get_modes,
13261328
.best_encoder = dw_mipi_dsi_connector_best_encoder,
13271329
};

0 commit comments

Comments
 (0)