1 /* SPDX-License-Identifier: MIT */
3 * Copyright © 2023 Intel Corporation
6 #ifndef __INTEL_PMDEMAND_H__
7 #define __INTEL_PMDEMAND_H__
9 #include "intel_display_limits.h"
10 #include "intel_global_state.h"
12 struct drm_i915_private;
13 struct intel_atomic_state;
14 struct intel_crtc_state;
16 struct intel_plane_state;
18 struct pmdemand_params {
24 /* Total number of non type C active phys from active_phys_mask */
28 /* max from ddi_clocks[] */
33 struct intel_pmdemand_state {
34 struct intel_global_state base;
36 /* Maintain a persistent list of port clocks across all crtcs */
37 int ddi_clocks[I915_MAX_PIPES];
39 /* Maintain a persistent list of non type C phys mask */
40 u16 active_combo_phys_mask;
42 /* Parameters to be configured in the pmdemand registers */
43 struct pmdemand_params params;
46 #define to_intel_pmdemand_state(x) container_of((x), \
47 struct intel_pmdemand_state, \
50 void intel_pmdemand_init_early(struct drm_i915_private *i915);
51 int intel_pmdemand_init(struct drm_i915_private *i915);
52 void intel_pmdemand_init_pmdemand_params(struct drm_i915_private *i915,
53 struct intel_pmdemand_state *pmdemand_state);
54 void intel_pmdemand_update_port_clock(struct drm_i915_private *i915,
55 struct intel_pmdemand_state *pmdemand_state,
56 enum pipe pipe, int port_clock);
57 void intel_pmdemand_update_phys_mask(struct drm_i915_private *i915,
58 struct intel_encoder *encoder,
59 struct intel_pmdemand_state *pmdemand_state,
61 void intel_pmdemand_program_dbuf(struct drm_i915_private *i915,
63 void intel_pmdemand_pre_plane_update(struct intel_atomic_state *state);
64 void intel_pmdemand_post_plane_update(struct intel_atomic_state *state);
65 int intel_pmdemand_atomic_check(struct intel_atomic_state *state);
67 #endif /* __INTEL_PMDEMAND_H__ */