diff options
author | Sean Paul <seanpaul@chromium.org> | 2019-11-05 22:10:20 +0100 |
---|---|---|
committer | CK Hu <ck.hu@mediatek.com> | 2019-11-06 09:00:44 +0100 |
commit | f7c710d1e48414b16e5b1b64e2940606148123a7 (patch) | |
tree | 2d3dbb672d18e3f9fa98668f67d0388230709285 /drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | |
parent | drm/mediatek: Add helper to get component for a plane (diff) | |
download | linux-f7c710d1e48414b16e5b1b64e2940606148123a7.tar.xz linux-f7c710d1e48414b16e5b1b64e2940606148123a7.zip |
drm/mediatek: Add plumbing for layer_check hook
This allows components to implement a .layer_check callback for their
layers which is called during atomic_check.
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: CK Hu <ck.hu@mediatek.com>
Diffstat (limited to 'drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h')
-rw-r--r-- | drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 12 |
1 files changed, 12 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 26441f4d1ad3..3de371e28bdf 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h @@ -80,6 +80,9 @@ struct mtk_ddp_comp_funcs { unsigned int (*layer_nr)(struct mtk_ddp_comp *comp); void (*layer_on)(struct mtk_ddp_comp *comp, unsigned int idx); void (*layer_off)(struct mtk_ddp_comp *comp, unsigned int idx); + int (*layer_check)(struct mtk_ddp_comp *comp, + unsigned int idx, + struct mtk_plane_state *state); void (*layer_config)(struct mtk_ddp_comp *comp, unsigned int idx, struct mtk_plane_state *state); void (*gamma_set)(struct mtk_ddp_comp *comp, @@ -152,6 +155,15 @@ static inline void mtk_ddp_comp_layer_off(struct mtk_ddp_comp *comp, comp->funcs->layer_off(comp, idx); } +static inline int mtk_ddp_comp_layer_check(struct mtk_ddp_comp *comp, + unsigned int idx, + struct mtk_plane_state *state) +{ + if (comp->funcs && comp->funcs->layer_check) + return comp->funcs->layer_check(comp, idx, state); + return 0; +} + static inline void mtk_ddp_comp_layer_config(struct mtk_ddp_comp *comp, unsigned int idx, struct mtk_plane_state *state) |