1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2019 Intel Corporation
4  */
5 
6 #ifndef __INTEL_ATOMIC_PLANE_H__
7 #define __INTEL_ATOMIC_PLANE_H__
8 
9 #include <linux/types.h>
10 
11 struct drm_crtc_state;
12 struct drm_plane;
13 struct drm_property;
14 struct intel_atomic_state;
15 struct intel_crtc;
16 struct intel_crtc_state;
17 struct intel_plane;
18 struct intel_plane_state;
19 
20 extern const struct drm_plane_helper_funcs intel_plane_helper_funcs;
21 
22 unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state,
23 				   const struct intel_plane_state *plane_state);
24 void intel_update_plane(struct intel_plane *plane,
25 			const struct intel_crtc_state *crtc_state,
26 			const struct intel_plane_state *plane_state);
27 void intel_update_slave(struct intel_plane *plane,
28 			const struct intel_crtc_state *crtc_state,
29 			const struct intel_plane_state *plane_state);
30 void intel_disable_plane(struct intel_plane *plane,
31 			 const struct intel_crtc_state *crtc_state);
32 struct intel_plane *intel_plane_alloc(void);
33 void intel_plane_free(struct intel_plane *plane);
34 struct drm_plane_state *intel_plane_duplicate_state(struct drm_plane *plane);
35 void intel_plane_destroy_state(struct drm_plane *plane,
36 			       struct drm_plane_state *state);
37 void skl_update_planes_on_crtc(struct intel_atomic_state *state,
38 			       struct intel_crtc *crtc);
39 void i9xx_update_planes_on_crtc(struct intel_atomic_state *state,
40 				struct intel_crtc *crtc);
41 int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state,
42 					struct intel_crtc_state *crtc_state,
43 					const struct intel_plane_state *old_plane_state,
44 					struct intel_plane_state *intel_state);
45 int intel_plane_atomic_calc_changes(const struct intel_crtc_state *old_crtc_state,
46 				    struct drm_crtc_state *crtc_state,
47 				    const struct intel_plane_state *old_plane_state,
48 				    struct drm_plane_state *plane_state);
49 
50 #endif /* __INTEL_ATOMIC_PLANE_H__ */
51