xref: /linux/drivers/gpu/drm/i915/display/intel_atomic_plane.h (revision 7f71507851fc7764b36a3221839607d3a45c2025)
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_plane;
12 struct drm_property;
13 struct drm_rect;
14 struct intel_atomic_state;
15 struct intel_crtc;
16 struct intel_crtc_state;
17 struct intel_dsb;
18 struct intel_plane;
19 struct intel_plane_state;
20 enum plane_id;
21 
22 unsigned int intel_adjusted_rate(const struct drm_rect *src,
23 				 const struct drm_rect *dst,
24 				 unsigned int rate);
25 unsigned int intel_plane_pixel_rate(const struct intel_crtc_state *crtc_state,
26 				    const struct intel_plane_state *plane_state);
27 
28 unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state,
29 				   const struct intel_plane_state *plane_state,
30 				   int color_plane);
31 void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state,
32 				       const struct intel_plane_state *from_plane_state,
33 				       struct intel_crtc *crtc);
34 void intel_plane_copy_hw_state(struct intel_plane_state *plane_state,
35 			       const struct intel_plane_state *from_plane_state);
36 void intel_plane_async_flip(struct intel_dsb *dsb,
37 			    struct intel_plane *plane,
38 			    const struct intel_crtc_state *crtc_state,
39 			    const struct intel_plane_state *plane_state,
40 			    bool async_flip);
41 void intel_plane_update_noarm(struct intel_dsb *dsb,
42 			      struct intel_plane *plane,
43 			      const struct intel_crtc_state *crtc_state,
44 			      const struct intel_plane_state *plane_state);
45 void intel_plane_update_arm(struct intel_dsb *dsb,
46 			    struct intel_plane *plane,
47 			    const struct intel_crtc_state *crtc_state,
48 			    const struct intel_plane_state *plane_state);
49 void intel_plane_disable_arm(struct intel_dsb *dsb,
50 			     struct intel_plane *plane,
51 			     const struct intel_crtc_state *crtc_state);
52 struct intel_plane *intel_plane_alloc(void);
53 void intel_plane_free(struct intel_plane *plane);
54 struct drm_plane_state *intel_plane_duplicate_state(struct drm_plane *plane);
55 void intel_plane_destroy_state(struct drm_plane *plane,
56 			       struct drm_plane_state *state);
57 void intel_crtc_planes_update_noarm(struct intel_dsb *dsb,
58 				    struct intel_atomic_state *state,
59 				    struct intel_crtc *crtc);
60 void intel_crtc_planes_update_arm(struct intel_dsb *dsbx,
61 				  struct intel_atomic_state *state,
62 				  struct intel_crtc *crtc);
63 int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state,
64 					struct intel_crtc_state *crtc_state,
65 					const struct intel_plane_state *old_plane_state,
66 					struct intel_plane_state *intel_state);
67 int intel_plane_atomic_check(struct intel_atomic_state *state,
68 			     struct intel_plane *plane);
69 int intel_plane_calc_min_cdclk(struct intel_atomic_state *state,
70 			       struct intel_plane *plane,
71 			       bool *need_cdclk_calc);
72 int intel_atomic_plane_check_clipping(struct intel_plane_state *plane_state,
73 				      struct intel_crtc_state *crtc_state,
74 				      int min_scale, int max_scale,
75 				      bool can_position);
76 int intel_plane_check_src_coordinates(struct intel_plane_state *plane_state);
77 void intel_plane_set_invisible(struct intel_crtc_state *crtc_state,
78 			       struct intel_plane_state *plane_state);
79 void intel_plane_helper_add(struct intel_plane *plane);
80 bool intel_plane_needs_physical(struct intel_plane *plane);
81 void intel_plane_init_cursor_vblank_work(struct intel_plane_state *old_plane_state,
82 					 struct intel_plane_state *new_plane_state);
83 
84 #endif /* __INTEL_ATOMIC_PLANE_H__ */
85