1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (c) 2015 MediaTek Inc.
4  * Author: CK Hu <ck.hu@mediatek.com>
5  */
6 
7 #ifndef _MTK_DRM_PLANE_H_
8 #define _MTK_DRM_PLANE_H_
9 
10 #include <drm/drm_crtc.h>
11 #include <linux/types.h>
12 
13 struct mtk_plane_pending_state {
14 	bool				config;
15 	bool				enable;
16 	dma_addr_t			addr;
17 	unsigned int			pitch;
18 	unsigned int			format;
19 	unsigned int			x;
20 	unsigned int			y;
21 	unsigned int			width;
22 	unsigned int			height;
23 	unsigned int			rotation;
24 	bool				dirty;
25 	bool				async_dirty;
26 	bool				async_config;
27 };
28 
29 struct mtk_plane_state {
30 	struct drm_plane_state		base;
31 	struct mtk_plane_pending_state	pending;
32 };
33 
34 static inline struct mtk_plane_state *
to_mtk_plane_state(struct drm_plane_state * state)35 to_mtk_plane_state(struct drm_plane_state *state)
36 {
37 	return container_of(state, struct mtk_plane_state, base);
38 }
39 
40 int mtk_plane_init(struct drm_device *dev, struct drm_plane *plane,
41 		   unsigned long possible_crtcs, enum drm_plane_type type,
42 		   unsigned int supported_rotations);
43 
44 #endif
45