diff options
author | Liu Ying <victor.liu@nxp.com> | 2023-08-21 11:40:03 +0800 |
---|---|---|
committer | Robert Foss <rfoss@kernel.org> | 2023-10-16 11:38:42 +0200 |
commit | 5a67ec8c64ec88b5c34060b347ccec4a31af3369 (patch) | |
tree | 7b0b9a3e9d198ba0676e8d9b4f75450f98b978f2 /drivers/gpu | |
parent | d5116fb29dc09bd4b9d9175f4f571e6eac539c93 (diff) | |
download | linux-5a67ec8c64ec88b5c34060b347ccec4a31af3369.tar.gz linux-5a67ec8c64ec88b5c34060b347ccec4a31af3369.tar.bz2 linux-5a67ec8c64ec88b5c34060b347ccec4a31af3369.zip |
drm/bridge: synopsys: dw-mipi-dsi: Add mode fixup support
Vendor drivers may need to fixup mode due to pixel clock tree limitation,
so introduce the ->mode_fixup() callcack to struct dw_mipi_dsi_plat_data
and call it at atomic check stage if available.
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Robert Foss <rfoss@kernel.org>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230821034008.3876938-5-victor.liu@nxp.com
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 4e5171b5978a..40d699428b1b 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -573,9 +573,23 @@ static int dw_mipi_dsi_bridge_atomic_check(struct drm_bridge *bridge, struct drm_crtc_state *crtc_state, struct drm_connector_state *conn_state) { + struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge); + const struct dw_mipi_dsi_plat_data *pdata = dsi->plat_data; + bool ret; + bridge_state->input_bus_cfg.flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE; + if (pdata->mode_fixup) { + ret = pdata->mode_fixup(pdata->priv_data, &crtc_state->mode, + &crtc_state->adjusted_mode); + if (!ret) { + DRM_DEBUG_DRIVER("failed to fixup mode " DRM_MODE_FMT "\n", + DRM_MODE_ARG(&crtc_state->mode)); + return -EINVAL; + } + } + return 0; } |