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 #include "intel_frontbuffer.h"
12 
13 struct drm_i915_private;
14 struct intel_atomic_state;
15 struct intel_crtc;
16 struct intel_crtc_state;
17 struct intel_plane_state;
18 
19 void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
20 			   struct intel_atomic_state *state);
21 bool intel_fbc_is_active(struct drm_i915_private *dev_priv);
22 void intel_fbc_pre_update(struct intel_crtc *crtc,
23 			  struct intel_crtc_state *crtc_state,
24 			  struct intel_plane_state *plane_state);
25 void intel_fbc_post_update(struct intel_crtc *crtc);
26 void intel_fbc_init(struct drm_i915_private *dev_priv);
27 void intel_fbc_init_pipe_state(struct drm_i915_private *dev_priv);
28 void intel_fbc_enable(struct intel_crtc *crtc,
29 		      struct intel_crtc_state *crtc_state,
30 		      struct intel_plane_state *plane_state);
31 void intel_fbc_disable(struct intel_crtc *crtc);
32 void intel_fbc_global_disable(struct drm_i915_private *dev_priv);
33 void intel_fbc_invalidate(struct drm_i915_private *dev_priv,
34 			  unsigned int frontbuffer_bits,
35 			  enum fb_op_origin origin);
36 void intel_fbc_flush(struct drm_i915_private *dev_priv,
37 		     unsigned int frontbuffer_bits, enum fb_op_origin origin);
38 void intel_fbc_cleanup_cfb(struct drm_i915_private *dev_priv);
39 void intel_fbc_handle_fifo_underrun_irq(struct drm_i915_private *dev_priv);
40 int intel_fbc_reset_underrun(struct drm_i915_private *dev_priv);
41 
42 #endif /* __INTEL_FBC_H__ */
43