Skip to content

Commit 00d0352

Browse files
Jason-JH.LinChun-Kuang Hu
authored andcommitted
drm/mediatek: dsi: Support dynamic connector selection
Add implementation of mtk_dsi_encoder_index to mtk_ddp_comp_func to make mtk_dsi support dynamic connector selection. Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com> Reviewed-by: CK Hu <ck.hu@mediatek.com> Reviewed-by: Fei Shao <fshao@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: Fei Shao <fshao@chromium.org> Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-9-jason-jh.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
1 parent f6ec9da commit 00d0352

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
@@ -48,6 +48,7 @@ unsigned int mtk_dpi_encoder_index(struct device *dev);
4848

4949
void mtk_dsi_ddp_start(struct device *dev);
5050
void mtk_dsi_ddp_stop(struct device *dev);
51+
unsigned int mtk_dsi_encoder_index(struct device *dev);
5152

5253
int mtk_gamma_clk_enable(struct device *dev);
5354
void mtk_gamma_clk_disable(struct device *dev);

drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ static const struct mtk_ddp_comp_funcs ddp_dsc = {
318318
static const struct mtk_ddp_comp_funcs ddp_dsi = {
319319
.start = mtk_dsi_ddp_start,
320320
.stop = mtk_dsi_ddp_stop,
321+
.encoder_index = mtk_dsi_encoder_index,
321322
};
322323

323324
static const struct mtk_ddp_comp_funcs ddp_gamma = {

drivers/gpu/drm/mediatek/mtk_dsi.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,15 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
887887
return ret;
888888
}
889889

890+
unsigned int mtk_dsi_encoder_index(struct device *dev)
891+
{
892+
struct mtk_dsi *dsi = dev_get_drvdata(dev);
893+
unsigned int encoder_index = drm_encoder_index(&dsi->encoder);
894+
895+
dev_dbg(dev, "encoder index:%d\n", encoder_index);
896+
return encoder_index;
897+
}
898+
890899
static int mtk_dsi_bind(struct device *dev, struct device *master, void *data)
891900
{
892901
int ret;

0 commit comments

Comments
 (0)