1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2019 Intel Corporation
4  */
5 
6 #ifndef __INTEL_CDCLK_H__
7 #define __INTEL_CDCLK_H__
8 
9 #include <linux/types.h>
10 
11 #include "intel_display.h"
12 
13 struct drm_i915_private;
14 struct intel_atomic_state;
15 struct intel_cdclk_state;
16 struct intel_crtc_state;
17 
18 int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state);
19 void intel_cdclk_init(struct drm_i915_private *i915);
20 void intel_cdclk_uninit(struct drm_i915_private *i915);
21 void intel_init_cdclk_hooks(struct drm_i915_private *dev_priv);
22 void intel_update_max_cdclk(struct drm_i915_private *dev_priv);
23 void intel_update_cdclk(struct drm_i915_private *dev_priv);
24 void intel_update_rawclk(struct drm_i915_private *dev_priv);
25 bool intel_cdclk_needs_cd2x_update(struct drm_i915_private *dev_priv,
26 				   const struct intel_cdclk_state *a,
27 				   const struct intel_cdclk_state *b);
28 bool intel_cdclk_needs_modeset(const struct intel_cdclk_state *a,
29 			       const struct intel_cdclk_state *b);
30 bool intel_cdclk_changed(const struct intel_cdclk_state *a,
31 			 const struct intel_cdclk_state *b);
32 void intel_cdclk_swap_state(struct intel_atomic_state *state);
33 void
34 intel_set_cdclk_pre_plane_update(struct drm_i915_private *dev_priv,
35 				 const struct intel_cdclk_state *old_state,
36 				 const struct intel_cdclk_state *new_state,
37 				 enum pipe pipe);
38 void
39 intel_set_cdclk_post_plane_update(struct drm_i915_private *dev_priv,
40 				  const struct intel_cdclk_state *old_state,
41 				  const struct intel_cdclk_state *new_state,
42 				  enum pipe pipe);
43 void intel_dump_cdclk_state(const struct intel_cdclk_state *cdclk_state,
44 			    const char *context);
45 
46 #endif /* __INTEL_CDCLK_H__ */
47