Skip to content

Commit

Permalink
drm/mediatek: mtk-dpi: Set out_fmt from config if not the last bridge
Browse files Browse the repository at this point in the history
atomic_get_output_bus_fmts() is only called when the bridge is the last
element in the bridge chain.

If mtk-dpi is not the last bridge, the format of output_bus_cfg is
MEDIA_BUS_FMT_FIXED, and mtk_dpi_dual_edge() will fail to write correct
value to regs.

Fixes: ec8747c ("drm/mediatek: dpi: Add bus format negotiation")
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
  • Loading branch information
Hsin-Yi Wang authored and Chun-Kuang Hu committed Jul 22, 2021
1 parent e062233 commit 6b57ba3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/mediatek/mtk_dpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,10 @@ static int mtk_dpi_bridge_atomic_check(struct drm_bridge *bridge,

out_bus_format = bridge_state->output_bus_cfg.format;

if (out_bus_format == MEDIA_BUS_FMT_FIXED)
if (dpi->conf->num_output_fmts)
out_bus_format = dpi->conf->output_fmts[0];

dev_dbg(dpi->dev, "input format 0x%04x, output format 0x%04x\n",
bridge_state->input_bus_cfg.format,
bridge_state->output_bus_cfg.format);
Expand Down

0 comments on commit 6b57ba3

Please sign in to comment.