1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright 2019 NXP.
4  */
5 
6 #ifndef _DCSS_KMS_H_
7 #define _DCSS_KMS_H_
8 
9 #include <drm/drm_encoder.h>
10 
11 struct dcss_plane {
12 	struct drm_plane base;
13 
14 	int ch_num;
15 };
16 
17 struct dcss_crtc {
18 	struct drm_crtc		base;
19 	struct drm_crtc_state	*state;
20 
21 	struct dcss_plane	*plane[3];
22 
23 	int			irq;
24 
25 	bool disable_ctxld_kick_irq;
26 };
27 
28 struct dcss_kms_dev {
29 	struct drm_device base;
30 	struct dcss_crtc crtc;
31 	struct drm_encoder encoder;
32 	struct drm_connector *connector;
33 };
34 
35 struct dcss_kms_dev *dcss_kms_attach(struct dcss_dev *dcss);
36 void dcss_kms_detach(struct dcss_kms_dev *kms);
37 int dcss_crtc_init(struct dcss_crtc *crtc, struct drm_device *drm);
38 void dcss_crtc_deinit(struct dcss_crtc *crtc, struct drm_device *drm);
39 struct dcss_plane *dcss_plane_init(struct drm_device *drm,
40 				   unsigned int possible_crtcs,
41 				   enum drm_plane_type type,
42 				   unsigned int zpos);
43 
44 #endif
45