1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2019 Intel Corporation
4  */
5 
6 #ifndef __INTEL_PSR_H__
7 #define __INTEL_PSR_H__
8 
9 #include "intel_frontbuffer.h"
10 
11 struct drm_i915_private;
12 struct intel_crtc_state;
13 struct intel_dp;
14 
15 #define CAN_PSR(dev_priv) (HAS_PSR(dev_priv) && dev_priv->psr.sink_support)
16 void intel_psr_init_dpcd(struct intel_dp *intel_dp);
17 void intel_psr_enable(struct intel_dp *intel_dp,
18 		      const struct intel_crtc_state *crtc_state);
19 void intel_psr_disable(struct intel_dp *intel_dp,
20 		       const struct intel_crtc_state *old_crtc_state);
21 void intel_psr_update(struct intel_dp *intel_dp,
22 		      const struct intel_crtc_state *crtc_state);
23 int intel_psr_debug_set(struct drm_i915_private *dev_priv, u64 value);
24 void intel_psr_invalidate(struct drm_i915_private *dev_priv,
25 			  unsigned frontbuffer_bits,
26 			  enum fb_op_origin origin);
27 void intel_psr_flush(struct drm_i915_private *dev_priv,
28 		     unsigned frontbuffer_bits,
29 		     enum fb_op_origin origin);
30 void intel_psr_init(struct drm_i915_private *dev_priv);
31 void intel_psr_compute_config(struct intel_dp *intel_dp,
32 			      struct intel_crtc_state *crtc_state);
33 void intel_psr_irq_control(struct drm_i915_private *dev_priv, u32 debug);
34 void intel_psr_irq_handler(struct drm_i915_private *dev_priv, u32 psr_iir);
35 void intel_psr_short_pulse(struct intel_dp *intel_dp);
36 int intel_psr_wait_for_idle(const struct intel_crtc_state *new_crtc_state,
37 			    u32 *out_value);
38 bool intel_psr_enabled(struct intel_dp *intel_dp);
39 
40 #endif /* __INTEL_PSR_H__ */
41