summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
diff options
context:
space:
mode:
authorNancy.Lin <nancy.lin@mediatek.com>2023-03-21 20:18:56 +0800
committerChun-Kuang Hu <chunkuang.hu@kernel.org>2023-03-22 16:31:21 +0000
commitcb1d6bcca54261932948b9c55bd23daaae1606d4 (patch)
treeb8bcb39b0ea1937ad14063a208414481dec00067 /drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
parent453c3364632a1f305db7d425dc9f8d6711cd3491 (diff)
drm/mediatek: Add dma dev get function
This is a preparation for adding support for the ovl_adaptor sub driver Ovl_adaptor is a DRM sub driver, which doesn't have dma dev. Add dma_dev_get function for getting representative dma dev in ovl_adaptor. Signed-off-by: Nancy.Lin <nancy.lin@mediatek.com> Reviewed-by: AngeloGioachino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: Bo-Chen Chen <rex-bc.chen@mediatek.com> Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230321121859.2355-5-nancy.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h')
-rw-r--r--drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
index 7f2e638cfdc2..1b03496b641a 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
+++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
@@ -71,6 +71,7 @@ struct mtk_ddp_comp_funcs {
void (*bgclr_in_off)(struct device *dev);
void (*ctm_set)(struct device *dev,
struct drm_crtc_state *state);
+ struct device * (*dma_dev_get)(struct device *dev);
const u32 *(*get_formats)(struct device *dev);
size_t (*get_num_formats)(struct device *dev);
};
@@ -205,6 +206,13 @@ static inline void mtk_ddp_ctm_set(struct mtk_ddp_comp *comp,
comp->funcs->ctm_set(comp->dev, state);
}
+static inline struct device *mtk_ddp_comp_dma_dev_get(struct mtk_ddp_comp *comp)
+{
+ if (comp->funcs && comp->funcs->dma_dev_get)
+ return comp->funcs->dma_dev_get(comp->dev);
+ return comp->dev;
+}
+
static inline
const u32 *mtk_ddp_comp_get_formats(struct mtk_ddp_comp *comp)
{