1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2019 Intel Corporation
4  */
5 
6 #ifndef __INTEL_FBC_H__
7 #define __INTEL_FBC_H__
8 
9 #include <linux/types.h>
10 
11 enum fb_op_origin;
12 struct drm_i915_private;
13 struct intel_atomic_state;
14 struct intel_crtc;
15 struct intel_crtc_state;
16 struct intel_display;
17 struct intel_fbc;
18 struct intel_plane;
19 struct intel_plane_state;
20 
21 enum intel_fbc_id {
22 	INTEL_FBC_A,
23 	INTEL_FBC_B,
24 	INTEL_FBC_C,
25 	INTEL_FBC_D,
26 
27 	I915_MAX_FBCS,
28 };
29 
30 int intel_fbc_atomic_check(struct intel_atomic_state *state);
31 bool intel_fbc_pre_update(struct intel_atomic_state *state,
32 			  struct intel_crtc *crtc);
33 void intel_fbc_post_update(struct intel_atomic_state *state,
34 			   struct intel_crtc *crtc);
35 void intel_fbc_init(struct intel_display *display);
36 void intel_fbc_cleanup(struct intel_display *display);
37 void intel_fbc_sanitize(struct intel_display *display);
38 void intel_fbc_update(struct intel_atomic_state *state,
39 		      struct intel_crtc *crtc);
40 void intel_fbc_disable(struct intel_crtc *crtc);
41 void intel_fbc_invalidate(struct drm_i915_private *dev_priv,
42 			  unsigned int frontbuffer_bits,
43 			  enum fb_op_origin origin);
44 void intel_fbc_flush(struct drm_i915_private *dev_priv,
45 		     unsigned int frontbuffer_bits, enum fb_op_origin origin);
46 void intel_fbc_add_plane(struct intel_fbc *fbc, struct intel_plane *plane);
47 void intel_fbc_handle_fifo_underrun_irq(struct intel_display *display);
48 void intel_fbc_reset_underrun(struct intel_display *display);
49 void intel_fbc_crtc_debugfs_add(struct intel_crtc *crtc);
50 void intel_fbc_debugfs_register(struct intel_display *display);
51 
52 #endif /* __INTEL_FBC_H__ */
53