Skip to content

Commit f6ec9da

Browse files
Jason-JH.LinChun-Kuang Hu
authored andcommitted
drm/mediatek: dpi: Support dynamic connector selection
Add implementation of mtk_dpi_encoder_index to mtk_ddp_comp_func to make mtk_dpi support dynamic connector selection. Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: CK Hu <ck.hu@mediatek.com> Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-7-jason-jh.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
1 parent 01389b3 commit f6ec9da

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

drivers/gpu/drm/mediatek/mtk_disp_drv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ void mtk_dither_set_common(void __iomem *regs, struct cmdq_client_reg *cmdq_reg,
4444

4545
void mtk_dpi_start(struct device *dev);
4646
void mtk_dpi_stop(struct device *dev);
47+
unsigned int mtk_dpi_encoder_index(struct device *dev);
4748

4849
void mtk_dsi_ddp_start(struct device *dev);
4950
void mtk_dsi_ddp_stop(struct device *dev);

drivers/gpu/drm/mediatek/mtk_dpi.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,15 @@ void mtk_dpi_stop(struct device *dev)
781781
mtk_dpi_power_off(dpi);
782782
}
783783

784+
unsigned int mtk_dpi_encoder_index(struct device *dev)
785+
{
786+
struct mtk_dpi *dpi = dev_get_drvdata(dev);
787+
unsigned int encoder_index = drm_encoder_index(&dpi->encoder);
788+
789+
dev_dbg(dev, "encoder index:%d\n", encoder_index);
790+
return encoder_index;
791+
}
792+
784793
static int mtk_dpi_bind(struct device *dev, struct device *master, void *data)
785794
{
786795
struct mtk_dpi *dpi = dev_get_drvdata(dev);

drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ static const struct mtk_ddp_comp_funcs ddp_dither = {
304304
static const struct mtk_ddp_comp_funcs ddp_dpi = {
305305
.start = mtk_dpi_start,
306306
.stop = mtk_dpi_stop,
307+
.encoder_index = mtk_dpi_encoder_index,
307308
};
308309

309310
static const struct mtk_ddp_comp_funcs ddp_dsc = {

0 commit comments

Comments
 (0)